Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.
So I defined a new "lldb::offset_t" which should be used for all file offsets.
After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.
Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.
llvm-svn: 173463
return self.process.target
def create_thread(self, tid, context):
+ print 'tid type is: ' + str(type(tid))
if tid == 0x444444444:
- thread_info = { 'tid' : 0x444444444, 'name' : 'four' , 'queue' : 'queue4', 'state' : 'stopped', 'stop_reason' : 'none' }
+ thread_info = { 'tid' : tid, 'name' : 'four' , 'queue' : 'queue4', 'state' : 'stopped', 'stop_reason' : 'none' }
self.threads.append(thread_info)
return thread_info
return None
SetByteOrder (lldb::ByteOrder endian);
float
- GetFloat (lldb::SBError& error, uint32_t offset);
+ GetFloat (lldb::SBError& error, lldb::offset_t offset);
double
- GetDouble (lldb::SBError& error, uint32_t offset);
+ GetDouble (lldb::SBError& error, lldb::offset_t offset);
long double
- GetLongDouble (lldb::SBError& error, uint32_t offset);
+ GetLongDouble (lldb::SBError& error, lldb::offset_t offset);
lldb::addr_t
- GetAddress (lldb::SBError& error, uint32_t offset);
+ GetAddress (lldb::SBError& error, lldb::offset_t offset);
uint8_t
- GetUnsignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset);
uint16_t
- GetUnsignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset);
uint32_t
- GetUnsignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset);
uint64_t
- GetUnsignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset);
int8_t
- GetSignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset);
int16_t
- GetSignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset);
int32_t
- GetSignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset);
int64_t
- GetSignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset);
const char*
- GetString (lldb::SBError& error, uint32_t offset);
+ GetString (lldb::SBError& error, lldb::offset_t offset);
size_t
ReadRawData (lldb::SBError& error,
- uint32_t offset,
+ lldb::offset_t offset,
void *buf,
size_t size);
static lldb::BreakpointLocationSP
GetBreakpointLocationAtIndexFromEvent (const lldb::EventSP &event_sp, uint32_t loc_idx);
- static uint32_t
+ static size_t
GetNumBreakpointLocationsFromEvent (const lldb::EventSP &event_sp);
static const BreakpointEventData *
/// greater than then number of actual locations.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetLocationAtIndex (uint32_t index);
+ GetLocationAtIndex (size_t index);
//------------------------------------------------------------------
// The next section deals with various breakpoint options.
GetSize();
BreakpointID &
- GetBreakpointIDAtIndex (uint32_t index);
+ GetBreakpointIDAtIndex (size_t index);
bool
- RemoveBreakpointIDAtIndex (uint32_t index);
+ RemoveBreakpointIDAtIndex (size_t index);
void
Clear();
AddBreakpointID (const char *bp_id);
bool
- FindBreakpointID (BreakpointID &bp_id, uint32_t *position);
+ FindBreakpointID (BreakpointID &bp_id, size_t *position);
bool
- FindBreakpointID (const char *bp_id, uint32_t *position);
+ FindBreakpointID (const char *bp_id, size_t *position);
void
- InsertStringArray (const char **string_array, uint32_t array_size, CommandReturnObject &result);
+ InsertStringArray (const char **string_array, size_t array_size, CommandReturnObject &result);
static bool
- StringContainsIDRangeExpression (const char *in_string, uint32_t *range_start_len, uint32_t *range_end_pos);
+ StringContainsIDRangeExpression (const char *in_string, size_t *range_start_len, size_t *range_end_pos);
static void
FindAndReplaceIDRanges (Args &old_args, Target *target, CommandReturnObject &result, Args &new_args);
/// breakpoint doesn't exist.
//------------------------------------------------------------------
lldb::BreakpointSP
- GetBreakpointAtIndex (uint32_t i);
+ GetBreakpointAtIndex (size_t i);
//------------------------------------------------------------------
/// Returns a shared pointer to the breakpoint with index \a i, const version
/// breakpoint doesn't exist.
//------------------------------------------------------------------
const lldb::BreakpointSP
- GetBreakpointAtIndex (uint32_t i) const;
+ GetBreakpointAtIndex (size_t i) const;
//------------------------------------------------------------------
/// Returns the number of elements in this breakpoint list.
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetByIndex (uint32_t i);
+ GetByIndex (size_t i);
//------------------------------------------------------------------
/// Returns a shared pointer to the breakpoint location with index
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
const lldb::BreakpointLocationSP
- GetByIndex (uint32_t i) const;
+ GetByIndex (size_t i) const;
//------------------------------------------------------------------
/// Returns the number of elements in this breakpoint location list.
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetByIndex (uint32_t i);
+ GetByIndex (size_t i);
//------------------------------------------------------------------
/// Returns a shared pointer to the breakpoint location with index
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
const lldb::BreakpointLocationSP
- GetByIndex (uint32_t i) const;
+ GetByIndex (size_t i) const;
//------------------------------------------------------------------
/// Removes all the locations in this list from their breakpoint site
//------------------------------------------------------------------
bool
SetTrapOpcode (const uint8_t *trap_opcode,
- size_t trap_opcode_size);
+ uint32_t trap_opcode_size);
//------------------------------------------------------------------
/// Gets the original instruction bytes that were overwritten by the trap
/// @return
/// The number of owners.
//------------------------------------------------------------------
- uint32_t
+ size_t
GetNumberOfOwners ();
//------------------------------------------------------------------
/// A shared pointer to the breakpoint location at that index.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetOwnerAtIndex (uint32_t index);
+ GetOwnerAtIndex (size_t idx);
//------------------------------------------------------------------
/// Check whether the owners of this breakpoint site have any
/// @param[in] context
/// \a break_loc_id is the Breakpoint Location to remove.
//------------------------------------------------------------------
- uint32_t
+ size_t
RemoveOwner (lldb::break_id_t break_id,
lldb::break_id_t break_loc_id);
BreakpointSite (BreakpointSiteList *list,
const lldb::BreakpointLocationSP& owner,
lldb::addr_t m_addr,
- lldb::tid_t tid,
bool use_hardware);
DISALLOW_COPY_AND_ASSIGN(BreakpointSite);
DISALLOW_COPY_AND_ASSIGN (WatchpointEventData);
};
- Watchpoint (Target& target, lldb::addr_t addr, size_t size, const ClangASTType *type, bool hardware = true);
+ Watchpoint (Target& target, lldb::addr_t addr, uint32_t size, const ClangASTType *type, bool hardware = true);
~Watchpoint ();
void
const ArchSpec&
operator= (const ArchSpec& rhs);
- static uint32_t
+ static size_t
AutoComplete (const char *name,
StringList &matches);
public:
NSArrayMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
public:
NSArrayISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
private:
ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size;
- uint64_t m_items;
+ size_t m_items;
lldb::addr_t m_data_ptr;
ClangASTType m_id_type;
std::vector<lldb::ValueObjectSP> m_children;
public:
NSArrayCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
public:
NSDictionaryISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
public:
NSDictionaryMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
public:
NSDictionaryCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
/// @param[in] addr_size
/// A new address byte size value.
//------------------------------------------------------------------
- DataExtractor (const void* data, uint32_t data_length, lldb::ByteOrder byte_order, uint8_t addr_size);
+ DataExtractor (const void* data, lldb::offset_t data_length, lldb::ByteOrder byte_order, uint32_t addr_size);
//------------------------------------------------------------------
/// Construct with shared data.
/// @param[in] addr_size
/// A new address byte size value.
//------------------------------------------------------------------
- DataExtractor (const lldb::DataBufferSP& data_sp, lldb::ByteOrder byte_order, uint8_t addr_size);
+ DataExtractor (const lldb::DataBufferSP& data_sp, lldb::ByteOrder byte_order, uint32_t addr_size);
//------------------------------------------------------------------
/// Construct with a subset of \a data.
/// @param[in] length
/// The length in bytes of the subset of data.
//------------------------------------------------------------------
- DataExtractor (const DataExtractor& data, uint32_t offset, uint32_t length);
+ DataExtractor (const DataExtractor& data, lldb::offset_t offset, lldb::offset_t length);
DataExtractor (const DataExtractor& rhs);
//------------------------------------------------------------------
/// @return
/// The offset at which dumping ended.
//------------------------------------------------------------------
- uint32_t
+ lldb::offset_t
PutToLog (Log *log,
- uint32_t offset,
- uint32_t length,
+ lldb::offset_t offset,
+ lldb::offset_t length,
uint64_t base_addr,
uint32_t num_per_line,
Type type,
/// @return
/// The offset at which dumping ended.
//------------------------------------------------------------------
- uint32_t
+ lldb::offset_t
Dump (Stream *s,
- uint32_t offset,
+ lldb::offset_t offset,
lldb::Format item_format,
- uint32_t item_byte_size,
- uint32_t item_count,
- uint32_t num_per_line,
+ size_t item_byte_size,
+ size_t item_count,
+ size_t num_per_line,
uint64_t base_addr,
uint32_t item_bit_size,
uint32_t item_bit_offset,
/// UUID value.
//------------------------------------------------------------------
void
- DumpUUID (Stream *s, uint32_t offset) const;
+ DumpUUID (Stream *s, lldb::offset_t offset) const;
//------------------------------------------------------------------
/// Extract an arbitrary number of bytes in the specified byte
/// if there aren't enough bytes at the specified offset.
//------------------------------------------------------------------
size_t
- ExtractBytes (uint32_t offset, uint32_t length, lldb::ByteOrder dst_byte_order, void *dst) const;
+ ExtractBytes (lldb::offset_t offset, lldb::offset_t length, lldb::ByteOrder dst_byte_order, void *dst) const;
//------------------------------------------------------------------
/// Extract an address from \a *offset_ptr.
/// The extracted address value.
//------------------------------------------------------------------
uint64_t
- GetAddress (uint32_t *offset_ptr) const;
+ GetAddress (lldb::offset_t *offset_ptr) const;
uint64_t
- GetAddress_unchecked (uint32_t *offset_ptr) const;
+ GetAddress_unchecked (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Get the current address size.
/// @return
/// The size in bytes of address values that will be extracted.
//------------------------------------------------------------------
- uint8_t
+ uint32_t
GetAddressByteSize () const
{
return m_addr_size;
/// @return
/// The total number of bytes of data this object refers to.
//------------------------------------------------------------------
- size_t
+ uint64_t
GetByteSize () const
{
return m_end - m_start;
/// NULL will be returned.
//------------------------------------------------------------------
const char *
- GetCStr (uint32_t *offset_ptr) const;
+ GetCStr (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a length bytes from \a *offset_ptr.
/// and length are valid, or NULL otherwise.
//------------------------------------------------------------------
const void*
- GetData (uint32_t *offset_ptr, uint32_t length) const;
+ GetData (lldb::offset_t *offset_ptr, lldb::offset_t length) const;
//------------------------------------------------------------------
/// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied
/// Returns the number of bytes that were copied, or zero if
/// anything goes wrong.
//------------------------------------------------------------------
- uint32_t
- CopyByteOrderedData (uint32_t src_offset,
- uint32_t src_len,
+ lldb::offset_t
+ CopyByteOrderedData (lldb::offset_t src_offset,
+ lldb::offset_t src_len,
void *dst,
- uint32_t dst_len,
+ lldb::offset_t dst_len,
lldb::ByteOrder dst_byte_order) const;
//------------------------------------------------------------------
/// The floating value that was extracted, or zero on failure.
//------------------------------------------------------------------
float
- GetFloat (uint32_t *offset_ptr) const;
+ GetFloat (lldb::offset_t *offset_ptr) const;
double
- GetDouble (uint32_t *offset_ptr) const;
+ GetDouble (lldb::offset_t *offset_ptr) const;
long double
- GetLongDouble (uint32_t *offset_ptr) const;
+ GetLongDouble (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract a GNU encoded pointer value from \a *offset_ptr.
/// The extracted GNU encoded pointer value.
//------------------------------------------------------------------
uint64_t
- GetGNUEHPointer (uint32_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr);
+ GetGNUEHPointer (lldb::offset_t *offset_ptr,
+ uint32_t eh_ptr_enc,
+ lldb::addr_t pc_rel_addr,
+ lldb::addr_t text_addr,
+ lldb::addr_t data_addr);
//------------------------------------------------------------------
/// Extract an integer of size \a byte_size from \a *offset_ptr.
/// The integer value that was extracted, or zero on failure.
//------------------------------------------------------------------
uint32_t
- GetMaxU32 (uint32_t *offset_ptr, uint32_t byte_size) const;
+ GetMaxU32 (lldb::offset_t *offset_ptr, size_t byte_size) const;
//------------------------------------------------------------------
/// Extract an unsigned integer of size \a byte_size from \a
/// failure.
//------------------------------------------------------------------
uint64_t
- GetMaxU64 (uint32_t *offset_ptr, uint32_t byte_size) const;
+ GetMaxU64 (lldb::offset_t *offset_ptr, size_t byte_size) const;
uint64_t
- GetMaxU64_unchecked (uint32_t *offset_ptr, uint32_t byte_size) const;
+ GetMaxU64_unchecked (lldb::offset_t *offset_ptr, size_t byte_size) const;
//------------------------------------------------------------------
/// Extract an signed integer of size \a byte_size from \a *offset_ptr.
/// or zero on failure.
//------------------------------------------------------------------
int64_t
- GetMaxS64 (uint32_t *offset_ptr, uint32_t size) const;
+ GetMaxS64 (lldb::offset_t *offset_ptr, size_t size) const;
//------------------------------------------------------------------
/// Extract an unsigned integer of size \a byte_size from \a
/// zero on failure.
//------------------------------------------------------------------
uint64_t
- GetMaxU64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const;
+ GetMaxU64Bitfield (lldb::offset_t *offset_ptr,
+ size_t size,
+ uint32_t bitfield_bit_size,
+ uint32_t bitfield_bit_offset) const;
//------------------------------------------------------------------
/// Extract an signed integer of size \a byte_size from \a
/// zero on failure.
//------------------------------------------------------------------
int64_t
- GetMaxS64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const;
+ GetMaxS64Bitfield (lldb::offset_t *offset_ptr,
+ size_t size,
+ uint32_t bitfield_bit_size,
+ uint32_t bitfield_bit_offset) const;
//------------------------------------------------------------------
/// Extract an pointer from \a *offset_ptr.
/// The extracted pointer value as a 64 integer.
//------------------------------------------------------------------
uint64_t
- GetPointer (uint32_t *offset_ptr) const;
+ GetPointer (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Get the current byte order value.
/// The extracted uint8_t value.
//------------------------------------------------------------------
uint8_t
- GetU8 ( uint32_t *offset_ptr) const;
+ GetU8 ( lldb::offset_t *offset_ptr) const;
uint8_t
- GetU8_unchecked (uint32_t *offset_ptr) const
+ GetU8_unchecked (lldb::offset_t *offset_ptr) const
{
uint8_t val = m_start[*offset_ptr];
*offset_ptr += 1;
}
uint16_t
- GetU16_unchecked (uint32_t *offset_ptr) const;
+ GetU16_unchecked (lldb::offset_t *offset_ptr) const;
uint32_t
- GetU32_unchecked (uint32_t *offset_ptr) const;
+ GetU32_unchecked (lldb::offset_t *offset_ptr) const;
uint64_t
- GetU64_unchecked (uint32_t *offset_ptr) const;
+ GetU64_unchecked (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint8_t values from \a *offset_ptr.
///
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU8 ( uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU8 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a uint16_t value from \a *offset_ptr.
/// The extracted uint16_t value.
//------------------------------------------------------------------
uint16_t
- GetU16 (uint32_t *offset_ptr) const;
+ GetU16 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint16_t values from \a *offset_ptr.
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU16 (uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU16 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a uint32_t value from \a *offset_ptr.
/// The extracted uint32_t value.
//------------------------------------------------------------------
uint32_t
- GetU32 (uint32_t *offset_ptr) const;
+ GetU32 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint32_t values from \a *offset_ptr.
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU32 (uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU32 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a uint64_t value from \a *offset_ptr.
/// The extracted uint64_t value.
//------------------------------------------------------------------
uint64_t
- GetU64 (uint32_t *offset_ptr) const;
+ GetU64 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint64_t values from \a *offset_ptr.
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU64 ( uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU64 ( lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a signed LEB128 value from \a *offset_ptr.
/// The extracted signed integer value.
//------------------------------------------------------------------
int64_t
- GetSLEB128 (uint32_t *offset_ptr) const;
+ GetSLEB128 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract a unsigned LEB128 value from \a *offset_ptr.
/// The extracted unsigned integer value.
//------------------------------------------------------------------
uint64_t
- GetULEB128 (uint32_t *offset_ptr) const;
+ GetULEB128 (lldb::offset_t *offset_ptr) const;
lldb::DataBufferSP &
GetSharedDataBuffer ()
/// NULL otherwise.
//------------------------------------------------------------------
const char *
- PeekCStr (uint32_t offset) const;
+ PeekCStr (lldb::offset_t offset) const;
//------------------------------------------------------------------
/// Peek at a bytes at \a offset.
/// otherwise.
//------------------------------------------------------------------
const uint8_t*
- PeekData (uint32_t offset, uint32_t length) const;
+ PeekData (lldb::offset_t offset, lldb::offset_t length) const;
//------------------------------------------------------------------
/// Set the address byte size.
/// The size in bytes to use when extracting addresses.
//------------------------------------------------------------------
void
- SetAddressByteSize (uint8_t addr_size)
+ SetAddressByteSize (uint32_t addr_size)
{
m_addr_size = addr_size;
}
/// @return
/// The number of bytes that this object now contains.
//------------------------------------------------------------------
- uint32_t
- SetData (const void *bytes, uint32_t length, lldb::ByteOrder byte_order);
+ lldb::offset_t
+ SetData (const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order);
//------------------------------------------------------------------
/// Adopt a subset of \a data.
/// @return
/// The number of bytes that this object now contains.
//------------------------------------------------------------------
- uint32_t
- SetData (const DataExtractor& data, uint32_t offset, uint32_t length);
+ lldb::offset_t
+ SetData (const DataExtractor& data, lldb::offset_t offset, lldb::offset_t length);
//------------------------------------------------------------------
/// Adopt a subset of shared data in \a data_sp.
/// @return
/// The number of bytes that this object now contains.
//------------------------------------------------------------------
- uint32_t
- SetData (const lldb::DataBufferSP& data_sp, uint32_t offset = 0, uint32_t length = UINT32_MAX);
+ lldb::offset_t
+ SetData (const lldb::DataBufferSP& data_sp, lldb::offset_t offset = 0, lldb::offset_t length = LLDB_INVALID_OFFSET);
//------------------------------------------------------------------
/// Set the byte_order value.
// The number of bytes consumed during the extraction.
//------------------------------------------------------------------
uint32_t
- Skip_LEB128 (uint32_t *offset_ptr) const;
+ Skip_LEB128 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Test the validity of \a offset.
/// object, \b false otherwise.
//------------------------------------------------------------------
bool
- ValidOffset (uint32_t offset) const
+ ValidOffset (lldb::offset_t offset) const
{
return offset < GetByteSize();
}
/// length bytes available at that offset, \b false otherwise.
//------------------------------------------------------------------
bool
- ValidOffsetForDataOfSize (uint32_t offset, uint32_t length) const;
+ ValidOffsetForDataOfSize (lldb::offset_t offset, lldb::offset_t length) const;
size_t
Copy (DataExtractor& dest_data) const;
Append (DataExtractor& rhs);
bool
- Append (void* bytes, uint32_t length);
+ Append (void* bytes, lldb::offset_t length);
protected:
//------------------------------------------------------------------
const uint8_t * m_start; ///< A pointer to the first byte of data.
const uint8_t * m_end; ///< A pointer to the byte that is past the end of the data.
lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from.
- uint8_t m_addr_size; ///< The address size to use when extracting pointers or addresses
+ uint32_t m_addr_size; ///< The address size to use when extracting pointers or addresses
mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multilple instances
};
static lldb::DebuggerSP
FindDebuggerWithInstanceName (const ConstString &instance_name);
- static uint32_t
+ static size_t
GetNumDebuggers();
static lldb::DebuggerSP
- GetDebuggerAtIndex (uint32_t);
+ GetDebuggerAtIndex (size_t index);
static bool
FormatPrompt (const char *format,
virtual size_t
Decode (const Disassembler &disassembler,
- const DataExtractor& data,
- uint32_t data_offset) = 0;
+ const DataExtractor& data,
+ lldb::offset_t data_offset) = 0;
virtual void
SetDescription (const char *) {} // May be overridden in sub-classes that have descriptions.
GetMaxOpcocdeByteSize () const;
lldb::InstructionSP
- GetInstructionAtIndex (uint32_t idx) const;
+ GetInstructionAtIndex (size_t idx) const;
uint32_t
GetIndexOfNextBranchInstruction(uint32_t start) const;
virtual size_t
Decode (const Disassembler &disassembler,
const DataExtractor &data,
- uint32_t data_offset);
+ lldb::offset_t data_offset);
void
SetOpcode (size_t opcode_size, void *opcode_data);
virtual size_t
DecodeInstructions (const Address &base_addr,
const DataExtractor& data,
- uint32_t data_offset,
- uint32_t num_instructions,
+ lldb::offset_t data_offset,
+ size_t num_instructions,
bool append) = 0;
InstructionList &
/// The index of the file that matches \a file if it is found,
/// else UINT32_MAX is returned.
//------------------------------------------------------------------
- uint32_t
- FindFileIndex (uint32_t idx, const FileSpec &file, bool full) const;
+ size_t
+ FindFileIndex (size_t idx, const FileSpec &file, bool full) const;
//------------------------------------------------------------------
/// Get file at index.
/// returned.
//------------------------------------------------------------------
const FileSpec &
- GetFileSpecAtIndex (uint32_t idx) const;
+ GetFileSpecAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get file specification pointer at index.
/// If \a idx is out of range, then an NULL is returned.
//------------------------------------------------------------------
const FileSpec *
- GetFileSpecPointerAtIndex (uint32_t idx) const;
+ GetFileSpecPointerAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get the memory cost of this object.
/// @return
/// The number of files in the file spec list.
//------------------------------------------------------------------
- uint32_t
+ size_t
GetSize () const;
bool
- Insert (uint32_t idx, const FileSpec &file)
+ Insert (size_t idx, const FileSpec &file)
{
if (idx < m_files.size())
{
}
bool
- Replace (uint32_t idx, const FileSpec &file)
+ Replace (size_t idx, const FileSpec &file)
{
if (idx < m_files.size())
{
}
bool
- Remove (uint32_t idx)
+ Remove (size_t idx)
{
if (idx < m_files.size())
{
{
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren () = 0;
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx) = 0;
+ GetChildAtIndex (size_t idx) = 0;
virtual uint32_t
GetIndexOfChildWithName (const ConstString &name) = 0;
m_expression_paths.clear();
}
- int
+ size_t
GetCount() const
{
return m_expression_paths.size();
}
const char*
- GetExpressionPathAtIndex(int i) const
+ GetExpressionPathAtIndex(size_t i) const
{
return m_expression_paths[i].c_str();
}
{
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren()
{
return filter->GetCount();
}
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
if (idx >= filter->GetCount())
return lldb::ValueObjectSP();
virtual
~FrontEnd();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren()
{
if (!m_wrapper_sp || m_interpreter == NULL)
}
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update()
}
int
- GetRealIndexForIndex(int i);
+ GetRealIndexForIndex(size_t i);
bool
IsScripted()
{
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren()
{
return filter->GetCount();
}
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
if (idx >= filter->GetCount())
return lldb::ValueObjectSP();
#endif
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierForSummaryAtIndex (uint32_t index)
+ GetTypeNameSpecifierForSummaryAtIndex (size_t index)
{
if (index < m_summary_nav->GetCount())
return m_summary_nav->GetTypeNameSpecifierAtIndex(index);
}
SummaryNavigator::MapValueType
- GetSummaryAtIndex (uint32_t index)
+ GetSummaryAtIndex (size_t index)
{
if (index < m_summary_nav->GetCount())
return m_summary_nav->GetAtIndex(index);
}
FilterNavigator::MapValueType
- GetFilterAtIndex (uint32_t index)
+ GetFilterAtIndex (size_t index)
{
if (index < m_filter_nav->GetCount())
return m_filter_nav->GetAtIndex(index);
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierForFilterAtIndex (uint32_t index)
+ GetTypeNameSpecifierForFilterAtIndex (size_t index)
{
if (index < m_filter_nav->GetCount())
return m_filter_nav->GetTypeNameSpecifierAtIndex(index);
}
SynthNavigator::MapValueType
- GetSyntheticAtIndex (uint32_t index)
+ GetSyntheticAtIndex (size_t index)
{
if (index < m_synth_nav->GetCount())
return m_synth_nav->GetAtIndex(index);
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierForSyntheticAtIndex (uint32_t index)
+ GetTypeNameSpecifierForSyntheticAtIndex (size_t index)
{
if (index < m_synth_nav->GetCount())
return m_synth_nav->GetTypeNameSpecifierAtIndex(index);
LoopThrough (CallbackType callback, void* param);
lldb::TypeCategoryImplSP
- GetAtIndex (uint32_t);
+ GetAtIndex (size_t index);
bool
AnyMatches (ConstString type_name,
const char** matching_category = NULL,
TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);
- uint32_t
+ size_t
GetCount ()
{
return m_map.size();
return m_categories_map.Clear();
}
- uint32_t
+ size_t
GetCategoriesCount ()
{
return m_categories_map.GetCount();
}
lldb::TypeCategoryImplSP
- GetCategoryAtIndex (uint32_t index)
+ GetCategoryAtIndex (size_t index)
{
return m_categories_map.GetAtIndex(index);
}
}
}
- uint32_t
+ size_t
GetCount ()
{
return m_map.size();
}
ValueSP
- GetValueAtIndex (uint32_t index)
+ GetValueAtIndex (size_t index)
{
Mutex::Locker locker(m_map_mutex);
MapIterator iter = m_map.begin();
}
KeyType
- GetKeyAtIndex (uint32_t index)
+ GetKeyAtIndex (size_t index)
{
Mutex::Locker locker(m_map_mutex);
MapIterator iter = m_map.begin();
}
MapValueType
- GetAtIndex (uint32_t index)
+ GetAtIndex (size_t index)
{
return m_format_map.GetValueAtIndex(index);
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex (uint32_t index)
+ GetTypeNameSpecifierAtIndex (size_t index)
{
return GetTypeNameSpecifierAtIndex_Impl(index, (KeyType*)NULL);
}
m_format_map.LoopThrough(callback,param);
}
- uint32_t
+ size_t
GetCount ()
{
return m_format_map.GetCount();
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex_Impl (uint32_t index, ConstString *dummy)
+ GetTypeNameSpecifierAtIndex_Impl (size_t index, ConstString *dummy)
{
ConstString key = m_format_map.GetKeyAtIndex(index);
if (key)
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex_Impl (uint32_t index, lldb::RegularExpressionSP *dummy)
+ GetTypeNameSpecifierAtIndex_Impl (size_t index, lldb::RegularExpressionSP *dummy)
{
lldb::RegularExpressionSP regex = m_format_map.GetKeyAtIndex(index);
if (regex.get() == NULL)
}
static uint32_t
- HashString (const uint8_t hash_function, const char *s)
+ HashString (uint32_t hash_function, const char *s)
{
switch (hash_function)
{
s.Printf ("header.header_data_len = 0x%8.8x %u\n", header_data_len, header_data_len);
}
- virtual uint32_t
- Read (lldb_private::DataExtractor &data, uint32_t offset)
+ virtual lldb::offset_t
+ Read (lldb_private::DataExtractor &data, lldb::offset_t offset)
{
if (data.ValidOffsetForDataOfSize (offset,
sizeof (magic) +
data.SetByteOrder(lldb::eByteOrderBig);
break;
default:
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
}
else
{
// Magic bytes didn't match
version = 0;
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
}
if (version != 1)
{
// Unsupported version
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
hash_function = data.GetU16 (&offset);
if (hash_function == 4)
header_data_len = data.GetU32 (&offset);
return offset;
}
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
//
// // Returns a buffer that contains a serialized version of this table
m_hash_values (NULL),
m_hash_offsets (NULL)
{
- uint32_t offset = m_header.Read (data, 0);
- if (offset != UINT32_MAX && IsValid ())
+ lldb::offset_t offset = m_header.Read (data, 0);
+ if (offset != LLDB_INVALID_OFFSET && IsValid ())
{
m_hash_indexes = (uint32_t *)data.GetData (&offset, m_header.bucket_count * sizeof(uint32_t));
m_hash_values = (uint32_t *)data.GetData (&offset, m_header.hashes_count * sizeof(uint32_t));
const uint32_t curr_hash_value = GetHashValue (hash_idx);
if (curr_hash_value == hash_value)
{
- uint32_t hash_data_offset = GetHashDataOffset (hash_idx);
+ lldb::offset_t hash_data_offset = GetHashDataOffset (hash_idx);
while (hash_data_offset != UINT32_MAX)
{
- const uint32_t prev_hash_data_offset = hash_data_offset;
+ const lldb::offset_t prev_hash_data_offset = hash_data_offset;
Result hash_result = GetHashDataForName (name, &hash_data_offset, pair);
// Check the result of getting our hash data
switch (hash_result)
virtual Result
GetHashDataForName (const char *name,
- uint32_t* hash_data_offset_ptr,
+ lldb::offset_t* hash_data_offset_ptr,
Pair &pair) const = 0;
const HeaderType &
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list);
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindFunctions (const RegularExpression& regex,
bool symbols_ok,
bool inlines_ok,
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list);
//------------------------------------------------------------------
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list);
//------------------------------------------------------------------
/// @return
/// The number of matches added to \a type_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindTypes (const SymbolContext& sc,
const ConstString &type_name,
bool exact_match,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types);
lldb::TypeSP
/// @return
/// The number of matches added to \a type_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindTypesInNamespace (const SymbolContext& sc,
const ConstString &type_name,
const ClangNamespaceDecl *namespace_decl,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& type_list);
//------------------------------------------------------------------
/// The number of compile units that the symbol vendor plug-in
/// finds.
//------------------------------------------------------------------
- uint32_t
+ size_t
GetNumCompileUnits();
lldb::CompUnitSP
- GetCompileUnitAtIndex (uint32_t);
+ GetCompileUnitAtIndex (size_t idx);
const ConstString &
GetObjectName() const;
private:
- uint32_t
+ size_t
FindTypes_Impl (const SymbolContext& sc,
const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types);
return m_modules_mutex;
}
- uint32_t
+ size_t
GetIndexForModule (const Module *module) const;
//------------------------------------------------------------------
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
lldb::ModuleSP
- GetModuleAtIndex (uint32_t idx) const;
+ GetModuleAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get the module shared pointer for the module at index \a idx without
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
lldb::ModuleSP
- GetModuleAtIndexUnlocked (uint32_t idx) const;
+ GetModuleAtIndexUnlocked (size_t idx) const;
//------------------------------------------------------------------
/// Get the module pointer for the module at index \a idx.
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
Module*
- GetModulePointerAtIndex (uint32_t idx) const;
+ GetModulePointerAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get the module pointer for the module at index \a idx without
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
Module*
- GetModulePointerAtIndexUnlocked (uint32_t idx) const;
+ GetModulePointerAtIndexUnlocked (size_t idx) const;
//------------------------------------------------------------------
/// Find compile units by partial or full path.
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list) const;
//------------------------------------------------------------------
/// @see Module::FindFunctions ()
//------------------------------------------------------------------
- uint32_t
+ size_t
FindFunctions (const ConstString &name,
uint32_t name_type_mask,
bool include_symbols,
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const ConstString &name,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const;
//------------------------------------------------------------------
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const;
//------------------------------------------------------------------
/// @return
/// The number of matches added to \a type_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindTypes (const SymbolContext& sc,
const ConstString &name,
bool name_is_fully_qualified,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types) const;
bool
FindSharedModules (const ModuleSpec &module_spec,
ModuleList &matching_module_list);
- static uint32_t
+ static size_t
RemoveOrphanSharedModules (bool mandatory);
static bool
static const char *
GetPlatformPluginDescriptionAtIndex (uint32_t idx);
- static uint32_t
+ static size_t
AutoCompletePlatformName (const char *partial_name,
StringList &matches);
//------------------------------------------------------------------
Error
SetValueFromData (const RegisterInfo *reg_info,
DataExtractor &data,
- uint32_t offset,
+ lldb::offset_t offset,
bool partial_data_ok);
// The default value of 0 for reg_name_right_align_at means no alignment at all.
bool
GetData (DataExtractor &data, size_t limit_byte_size = UINT32_MAX) const;
- uint32_t
+ size_t
GetAsMemoryData (void *dst,
- uint32_t dst_len,
+ size_t dst_len,
lldb::ByteOrder dst_byte_order,
Error &error) const;
GetRawBits64 (uint64_t fail_value) const;
Error
- SetValueFromCString (const char *s, lldb::Encoding encoding, uint32_t byte_size);
+ SetValueFromCString (const char *s, lldb::Encoding encoding, size_t byte_size);
static bool
UIntValueIsValidForSize (uint64_t uval64, size_t total_byte_size)
}
protected:
+ typedef int sint_t;
+ typedef unsigned int uint_t;
+ typedef long slong_t;
+ typedef unsigned long ulong_t;
+ typedef long long slonglong_t;
+ typedef unsigned long long ulonglong_t;
+ typedef float float_t;
+ typedef double double_t;
+ typedef long double long_double_t;
+
union ValueData
{
int sint;
virtual
~SectionList();
- uint32_t
+ size_t
AddSection (const lldb::SectionSP& section_sp);
- uint32_t
+ size_t
AddUniqueSection (const lldb::SectionSP& section_sp);
- uint32_t
+ size_t
FindSectionIndex (const Section* sect);
bool
FindSectionByID (lldb::user_id_t sect_id) const;
lldb::SectionSP
- FindSectionByType (lldb::SectionType sect_type, bool check_children, uint32_t start_idx = 0) const;
+ FindSectionByType (lldb::SectionType sect_type, bool check_children, size_t start_idx = 0) const;
lldb::SectionSP
FindSectionContainingFileAddress (lldb::addr_t addr, uint32_t depth = UINT32_MAX) const;
ReplaceSection (lldb::user_id_t sect_id, const lldb::SectionSP& section_sp, uint32_t depth = UINT32_MAX);
lldb::SectionSP
- GetSectionAtIndex (uint32_t idx) const;
+ GetSectionAtIndex (size_t idx) const;
size_t
Slide (lldb::addr_t slide_amount, bool slide_children);
/// @return
/// The number of bytes that were appended to the stream.
//------------------------------------------------------------------
- virtual int
+ virtual size_t
Write (const void *src, size_t src_len) = 0;
//------------------------------------------------------------------
// Member functions
//------------------------------------------------------------------
- int
+ size_t
PutChar (char ch);
//------------------------------------------------------------------
/// @return
/// The number of bytes that were appended to the stream.
//------------------------------------------------------------------
- int
+ size_t
PrintfAsRawHex8 (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
//------------------------------------------------------------------
/// @return
/// The number of bytes that were appended to the stream.
//------------------------------------------------------------------
- int
+ size_t
PutHex8 (uint8_t uvalue);
- int
+ size_t
PutNHex8 (size_t n, uint8_t uvalue);
- int
+ size_t
PutHex16 (uint16_t uvalue,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutHex32 (uint32_t uvalue,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutHex64 (uint64_t uvalue,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutMaxHex64 (uint64_t uvalue,
size_t byte_size,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutFloat (float f,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutDouble (double d,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutLongDouble (long double ld,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutPointer (void *ptr);
// Append \a src_len bytes from \a src to the stream as hex characters
// (two ascii characters per byte of input data)
- int
+ size_t
PutBytesAsRawHex8 (const void *src,
size_t src_len,
lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid,
lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid);
// Append \a src_len bytes from \a s to the stream as binary data.
- int
+ size_t
PutRawBytes (const void *s,
size_t src_len,
lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid,
lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutCStringAsRawHex8 (const char *s);
//------------------------------------------------------------------
/// A suffix C string. If NULL, no suffix will be output.
//------------------------------------------------------------------
void
- Address (uint64_t addr, int addr_size, const char *prefix = NULL, const char *suffix = NULL);
+ Address (uint64_t addr, uint32_t addr_size, const char *prefix = NULL, const char *suffix = NULL);
//------------------------------------------------------------------
/// Output an address range to this stream.
/// A suffix C string. If NULL, no suffix will be output.
//------------------------------------------------------------------
void
- AddressRange(uint64_t lo_addr, uint64_t hi_addr, int addr_size, const char *prefix = NULL, const char *suffix = NULL);
+ AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, const char *prefix = NULL, const char *suffix = NULL);
//------------------------------------------------------------------
/// Output a C string to the stream.
/// @param[in] cstr
/// The string to be output to the stream.
//------------------------------------------------------------------
- int
+ size_t
PutCString (const char *cstr);
//------------------------------------------------------------------
/// Output and End of Line character to the stream.
//------------------------------------------------------------------
- int
+ size_t
EOL();
//------------------------------------------------------------------
/// The size of an address in bytes that is used when outputting
/// address and pointer values to the stream.
//------------------------------------------------------------------
- uint8_t
+ uint32_t
GetAddressByteSize () const;
//------------------------------------------------------------------
/// A C string to print following the indentation. If NULL, just
/// output the indentation characters.
//------------------------------------------------------------------
- int
+ size_t
Indent(const char *s = NULL);
//------------------------------------------------------------------
/// Variable arguments that are needed for the printf style
/// format string \a format.
//------------------------------------------------------------------
- int
+ size_t
Printf (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
- int
+ size_t
PrintfVarArg(const char *format, va_list args);
//------------------------------------------------------------------
/// address and pointer values.
//------------------------------------------------------------------
void
- SetAddressByteSize (uint8_t addr_size);
+ SetAddressByteSize (uint32_t addr_size);
//------------------------------------------------------------------
/// Set the current indentation level.
/// @param[in] format
/// The optional printf format that can be overridden.
//------------------------------------------------------------------
- int
+ size_t
PutSLEB128 (int64_t uval);
//------------------------------------------------------------------
/// @param[in] format
/// The optional printf format that can be overridden.
//------------------------------------------------------------------
- int
+ size_t
PutULEB128 (uint64_t uval);
static void
//------------------------------------------------------------------
// Member variables
//------------------------------------------------------------------
- Flags m_flags; ///< Dump flags.
- uint8_t m_addr_size; ///< Size of an address in bytes.
- lldb::ByteOrder m_byte_order;///< Byte order to use when encoding scalar types.
- int m_indent_level; ///< Indention level.
+ Flags m_flags; ///< Dump flags.
+ uint32_t m_addr_size; ///< Size of an address in bytes.
+ lldb::ByteOrder m_byte_order; ///< Byte order to use when encoding scalar types.
+ int m_indent_level; ///< Indention level.
- int _PutHex8 (uint8_t uvalue, bool add_prefix);
+ size_t _PutHex8 (uint8_t uvalue, bool add_prefix);
};
} // namespace lldb_private
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *src, size_t src_len);
// Nothing to do when flushing a buffer based stream...
}
- virtual int
+ virtual size_t
Write (const void *s, size_t length)
{
if (s && length)
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *src, size_t src_len);
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *s, size_t length);
protected:
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *s, size_t length);
void
}
}
- virtual int
+ virtual size_t
Write (const void *s, size_t length)
{
Mutex::Locker locker (m_streams_mutex);
if (m_streams.empty())
return 0;
- int min_bytes_written = INT_MAX;
+ size_t min_bytes_written = SIZE_MAX;
collection::iterator pos, end;
for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos)
{
Stream *strm = pos->get();
if (strm)
{
- int bytes_written = strm->Write (s, length);
+ const size_t bytes_written = strm->Write (s, length);
if (min_bytes_written > bytes_written)
min_bytes_written = bytes_written;
}
}
+ if (min_bytes_written == SIZE_MAX)
+ return 0;
return min_bytes_written;
}
bool
ReadFileLines (FileSpec &input_file);
- uint32_t
+ size_t
GetSize () const;
const char *
// Returns a valid index into coll when a match is found, else UINT32_MAX
// is returned
- static uint32_t
+ static size_t
FindRangeIndexThatContainsValue (const VMRange::collection& coll, lldb::addr_t value);
protected:
}
void
- ResizeData(int len);
+ ResizeData(size_t len);
bool
ValueOf(ExecutionContext *exe_ctx, clang::ASTContext *ast_context);
GetName() const;
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx, bool can_create);
+ GetChildAtIndex (size_t idx, bool can_create);
// this will always create the children if necessary
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::initializer_list<uint32_t> &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::initializer_list<size_t> &idxs,
+ size_t* index_of_error = NULL);
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::vector<uint32_t> &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::vector<size_t> &idxs,
+ size_t* index_of_error = NULL);
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::initializer_list< std::pair<uint32_t, bool> > &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::initializer_list< std::pair<size_t, bool> > &idxs,
+ size_t* index_of_error = NULL);
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::vector< std::pair<uint32_t, bool> > &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::vector< std::pair<size_t, bool> > &idxs,
+ size_t* index_of_error = NULL);
virtual lldb::ValueObjectSP
GetChildMemberWithName (const ConstString &name, bool can_create);
- virtual uint32_t
+ virtual size_t
GetIndexOfChildWithName (const ConstString &name);
- uint32_t
+ size_t
GetNumChildren ();
const Value &
GetSyntheticChild (const ConstString &key) const;
lldb::ValueObjectSP
- GetSyntheticArrayMember (int32_t index, bool can_create);
+ GetSyntheticArrayMember (size_t index, bool can_create);
lldb::ValueObjectSP
- GetSyntheticArrayMemberFromPointer (int32_t index, bool can_create);
+ GetSyntheticArrayMemberFromPointer (size_t index, bool can_create);
lldb::ValueObjectSP
- GetSyntheticArrayMemberFromArray (int32_t index, bool can_create);
+ GetSyntheticArrayMemberFromArray (size_t index, bool can_create);
lldb::ValueObjectSP
GetSyntheticBitFieldChild (uint32_t from, uint32_t to, bool can_create);
{
public:
ChildrenManager() :
- m_mutex(Mutex::eMutexTypeRecursive),
- m_children(),
- m_children_count(0)
+ m_mutex(Mutex::eMutexTypeRecursive),
+ m_children(),
+ m_children_count(0)
{}
bool
- HasChildAtIndex (uint32_t idx)
+ HasChildAtIndex (size_t idx)
{
Mutex::Locker locker(m_mutex);
ChildrenIterator iter = m_children.find(idx);
}
ValueObject*
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
Mutex::Locker locker(m_mutex);
ChildrenIterator iter = m_children.find(idx);
}
void
- SetChildAtIndex (uint32_t idx, ValueObject* valobj)
+ SetChildAtIndex (size_t idx, ValueObject* valobj)
{
ChildrenPair pair(idx,valobj); // we do not need to be mutex-protected to make a pair
Mutex::Locker locker(m_mutex);
}
void
- SetChildrenCount (uint32_t count)
+ SetChildrenCount (size_t count)
{
m_children_count = count;
}
- uint32_t
+ size_t
GetChildrenCount ()
{
return m_children_count;
}
private:
- typedef std::map<uint32_t, ValueObject*> ChildrenMap;
+ typedef std::map<size_t, ValueObject*> ChildrenMap;
typedef ChildrenMap::iterator ChildrenIterator;
typedef ChildrenMap::value_type ChildrenPair;
Mutex m_mutex;
ChildrenMap m_children;
- uint32_t m_children_count;
+ size_t m_children_count;
};
//------------------------------------------------------------------
// Should only be called by ValueObject::GetChildAtIndex()
// Returns a ValueObject managed by this ValueObject's manager.
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
// Should only be called by ValueObject::GetNumChildren()
- virtual uint32_t
+ virtual size_t
CalculateNumChildren() = 0;
void
- SetNumChildren (uint32_t num_children);
+ SetNumChildren (size_t num_children);
void
SetValueDidChange (bool value_changed);
virtual size_t
GetByteSize();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
virtual lldb::ValueType
GetValueType() const;
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ConstString
const ConstString &name,
const lldb::DataBufferSP &result_data_sp,
lldb::ByteOrder byte_order,
- uint8_t addr_size,
+ uint32_t addr_size,
lldb::addr_t address = LLDB_INVALID_ADDRESS);
static lldb::ValueObjectSP
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size);
+ uint32_t addr_byte_size);
static lldb::ValueObjectSP
Create (ExecutionContextScope *exe_scope,
virtual lldb::ValueType
GetValueType() const;
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ConstString
Dereference (Error &error);
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
virtual lldb::ValueObjectSP
GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create);
clang::ASTContext *m_clang_ast; // The clang AST that the clang type comes from
ConstString m_type_name;
- uint32_t m_byte_size;
+ size_t m_byte_size;
ValueObjectConstResultImpl m_impl;
const ConstString &name,
const lldb::DataBufferSP &result_data_sp,
lldb::ByteOrder byte_order,
- uint8_t addr_size,
+ uint32_t addr_size,
lldb::addr_t address);
ValueObjectConstResult (ExecutionContextScope *exe_scope,
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size);
+ uint32_t addr_byte_size);
ValueObjectConstResult (ExecutionContextScope *exe_scope,
clang::ASTContext *clang_ast,
Dereference (Error &error);
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
virtual lldb::clang_type_t
GetClangType ()
Dereference (Error &error);
ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
lldb::ValueObjectSP
GetSyntheticChildAtOffset (uint32_t offset, const ClangASTType& type, bool can_create);
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
lldb::ValueObjectSP
FindValueObjectByPointer (ValueObject *valobj);
- uint32_t
+ size_t
GetSize () const;
void
- Resize (uint32_t size);
+ Resize (size_t size);
lldb::ValueObjectSP
- GetValueObjectAtIndex (uint32_t idx);
+ GetValueObjectAtIndex (size_t idx);
lldb::ValueObjectSP
- RemoveValueObjectAtIndex (uint32_t idx);
+ RemoveValueObjectAtIndex (size_t idx);
void
- SetValueObjectAtIndex (uint32_t idx,
+ SetValueObjectAtIndex (size_t idx,
const lldb::ValueObjectSP &valobj_sp);
lldb::ValueObjectSP
virtual ConstString
GetTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
protected:
virtual bool
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
virtual lldb::ValueObjectSP
GetChildMemberWithName (const ConstString &name, bool can_create);
- virtual uint32_t
+ virtual size_t
GetIndexOfChildWithName (const ConstString &name);
virtual ConstString
GetTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual bool
virtual bool
MightHaveChildren();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
GetValueType() const;
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx, bool can_create);
+ GetChildAtIndex (size_t idx, bool can_create);
virtual lldb::ValueObjectSP
GetChildMemberWithName (const ConstString &name, bool can_create);
- virtual uint32_t
+ virtual size_t
GetIndexOfChildWithName (const ConstString &name);
virtual bool
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
#endif
/* Constants */
-#define DW_INVALID_ADDRESS (~(dw_addr_t)0)
#define DW_INVALID_OFFSET (~(dw_offset_t)0)
#define DW_INVALID_INDEX 0xFFFFFFFFul
/// @return
/// The number of errors.
//------------------------------------------------------------------
- unsigned CompileFunction (Stream &errors);
+ unsigned
+ CompileFunction (Stream &errors);
//------------------------------------------------------------------
/// Insert the default function wrapper and its default argument struct
/// @return
/// True on success; false otherwise.
//------------------------------------------------------------------
- bool InsertFunction (ExecutionContext &exe_ctx,
- lldb::addr_t &args_addr_ref,
- Stream &errors);
+ bool
+ InsertFunction (ExecutionContext &exe_ctx,
+ lldb::addr_t &args_addr_ref,
+ Stream &errors);
//------------------------------------------------------------------
/// Insert the default function wrapper (using the JIT)
/// The byte length of the location expression.
//------------------------------------------------------------------
DWARFExpression(const DataExtractor& data,
- uint32_t data_offset,
- uint32_t data_length);
+ lldb::offset_t data_offset,
+ lldb::offset_t data_length);
//------------------------------------------------------------------
/// Copy constructor
/// The byte length of the location expression.
//------------------------------------------------------------------
void
- SetOpcodeData(const DataExtractor& data, uint32_t data_offset, uint32_t data_length);
+ SetOpcodeData(const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length);
//------------------------------------------------------------------
/// Copy the DWARF location expression into a local buffer.
//------------------------------------------------------------------
void
CopyOpcodeData (const DataExtractor& data,
- uint32_t data_offset,
- uint32_t data_length);
+ lldb::offset_t data_offset,
+ lldb::offset_t data_length);
//------------------------------------------------------------------
ClangExpressionDeclMap *decl_map,
RegisterContext *reg_ctx,
const DataExtractor& opcodes,
- const uint32_t offset,
- const uint32_t length,
+ const lldb::offset_t offset,
+ const lldb::offset_t length,
const uint32_t reg_set,
const Value* initial_value_ptr,
Value& result,
//------------------------------------------------------------------
void
DumpLocation(Stream *s,
- uint32_t offset,
- uint32_t length,
+ lldb::offset_t offset,
+ lldb::offset_t length,
lldb::DescriptionLevel level,
ABI *abi) const;
bool
GetLocation (lldb::addr_t base_addr,
lldb::addr_t pc,
- uint32_t &offset,
- uint32_t &len);
+ lldb::offset_t &offset,
+ lldb::offset_t &len);
//------------------------------------------------------------------
/// Classes that inherit from DWARFExpression can see and modify these
/// Variable arguments that are needed for the printf style
/// format string \a format.
//------------------------------------------------------------------
- int
+ size_t
Printf (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
- int
+ size_t
PrintfVarArg(const char *format, va_list args);
protected:
// FIXME: Handle the quote character somehow.
//------------------------------------------------------------------
void
- SetArguments (int argc, const char **argv);
+ SetArguments (size_t argc, const char **argv);
void
SetArguments (const char **argv);
static bool
StringToBoolean (const char *s, bool fail_value, bool *success_ptr);
- static int32_t
+ static int64_t
StringToOptionEnum (const char *s, OptionEnumValueElement *enum_values, int32_t fail_value, Error &error);
static lldb::ScriptLanguage
static Error
StringToFormat (const char *s,
lldb::Format &format,
- uint32_t *byte_size_ptr); // If non-NULL, then a byte size can precede the format character
+ size_t *byte_size_ptr); // If non-NULL, then a byte size can precede the format character
static lldb::Encoding
StringToEncoding (const char *s,
const char *command_word,
const char *separator,
const char *help_text,
- uint32_t max_word_len);
+ size_t max_word_len);
// this mimics OutputFormattedHelpText but it does perform a much simpler
// formatting, basically ensuring line alignment. This is only good if you have
/// total number of matches, and the window the user wants returned.
///
/// @return
- /// \btrue if we were in an option, \bfalse otherwise.
+ /// The number of completions.
//------------------------------------------------------------------
virtual int
AppendMessageWithFormat (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
void
- AppendRawWarning (const char *in_string, int len = -1);
+ AppendRawWarning (const char *in_string);
void
AppendWarning (const char *in_string);
AppendError (const char *in_string);
void
- AppendRawError (const char *in_string, int len = -1);
+ AppendRawError (const char *in_string);
void
AppendErrorWithFormat (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
// Subclass specific functions
//---------------------------------------------------------------------
- uint32_t
+ size_t
GetSize () const
{
return m_values.size();
}
lldb::OptionValueSP
- operator[](uint32_t idx) const
+ operator[](size_t idx) const
{
lldb::OptionValueSP value_sp;
if (idx < m_values.size())
}
lldb::OptionValueSP
- GetValueAtIndex (uint32_t idx) const
+ GetValueAtIndex (size_t idx) const
{
lldb::OptionValueSP value_sp;
if (idx < m_values.size())
}
bool
- InsertValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
+ InsertValue (size_t idx, const lldb::OptionValueSP &value_sp)
{
// Make sure the value_sp object is allowed to contain
// values of the type passed in...
}
bool
- ReplaceValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
+ ReplaceValue (size_t idx, const lldb::OptionValueSP &value_sp)
{
// Make sure the value_sp object is allowed to contain
// values of the type passed in...
}
bool
- DeleteValue (uint32_t idx)
+ DeleteValue (size_t idx)
{
if (idx < m_values.size())
{
// Subclass specific functions
//---------------------------------------------------------------------
- uint32_t
+ size_t
GetNumValues() const
{
return m_values.size();
return false;
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor)
{
return 0;
lldb::tid_t tid,
lldb::addr_t context);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor);
virtual lldb::ValueObjectSP
Block *
FindBlockByID (lldb::user_id_t block_id);
- uint32_t
+ size_t
GetNumRanges () const
{
return m_ranges.GetSize();
static lldb::clang_type_t
GetDirectBaseClassAtIndex (clang::ASTContext *ast,
lldb::clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr);
static lldb::clang_type_t
GetVirtualBaseClassAtIndex (clang::ASTContext *ast,
lldb::clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr);
static lldb::clang_type_t
GetFieldAtIndex (clang::ASTContext *ast,
lldb::clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
std::string& name,
uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
GetChildClangTypeAtIndex (ExecutionContext *exe_ctx,
const char *parent_name,
lldb::clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
clang::ASTContext *ast,
const char *parent_name,
lldb::clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
/// architecture (and object for archives). Returns zero if no
/// architecture or object has been selected.
//------------------------------------------------------------------
- virtual size_t
+ virtual uint32_t
GetAddressByteSize () const = 0;
//------------------------------------------------------------------
bool is_artificial,
const lldb::SectionSP §ion_sp,
lldb::addr_t value,
- uint32_t size,
+ lldb::addr_t size,
uint32_t flags);
Symbol (uint32_t symID,
GetByteSize () const;
void
- SetByteSize (uint32_t size)
+ SetByteSize (lldb::addr_t size)
{
m_calculated_size = size > 0;
m_addr_range.SetByteSize(size);
/// otherwise.
//------------------------------------------------------------------
bool
- GetContextAtIndex(uint32_t idx, SymbolContext& sc) const;
+ GetContextAtIndex(size_t idx, SymbolContext& sc) const;
bool
- RemoveContextAtIndex (uint32_t idx);
+ RemoveContextAtIndex (size_t idx);
//------------------------------------------------------------------
/// Get accessor for a symbol context list size.
///
uint32_t resolve_scope,
SymbolContextList& sc_list);
- virtual uint32_t
+ virtual size_t
FindGlobalVariables (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variables);
- virtual uint32_t
+ virtual size_t
FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variables);
- virtual uint32_t
+ virtual size_t
FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
bool append,
SymbolContextList& sc_list);
- virtual uint32_t
+ virtual size_t
FindFunctions (const RegularExpression& regex,
bool include_inlines,
bool append,
SymbolContextList& sc_list);
- virtual uint32_t
+ virtual size_t
FindTypes (const SymbolContext& sc,
const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types);
virtual lldb_private::ClangNamespaceDecl
const ConstString &name,
const ClangNamespaceDecl *parent_namespace_decl);
- virtual uint32_t
+ virtual size_t
GetNumCompileUnits();
virtual bool
- SetCompileUnitAtIndex (uint32_t cu_idx,
+ SetCompileUnitAtIndex (size_t cu_idx,
const lldb::CompUnitSP &cu_sp);
virtual lldb::CompUnitSP
- GetCompileUnitAtIndex(uint32_t idx);
+ GetCompileUnitAtIndex(size_t idx);
TypeList&
GetTypeList()
Symtab(ObjectFile *objfile);
~Symtab();
- void Reserve (uint32_t count);
- Symbol * Resize (uint32_t count);
+ void Reserve (size_t count);
+ Symbol * Resize (size_t count);
uint32_t AddSymbol(const Symbol& symbol);
size_t GetNumSymbols() const;
void Dump(Stream *s, Target *target, SortOrder sort_type);
return m_mutex;
}
Symbol * FindSymbolByID (lldb::user_id_t uid) const;
- Symbol * SymbolAtIndex (uint32_t idx);
- const Symbol * SymbolAtIndex (uint32_t idx) const;
+ Symbol * SymbolAtIndex (size_t idx);
+ const Symbol * SymbolAtIndex (size_t idx) const;
Symbol * FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx);
uint32_t AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
uint32_t AppendSymbolIndexesWithTypeAndFlagsValue (lldb::SymbolType symbol_type, uint32_t flags_value, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
private:
bool
- CheckSymbolAtIndex (uint32_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
+ CheckSymbolAtIndex (size_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
{
switch (symbol_debug_type)
{
m_loc_is_const_data = b;
}
- typedef uint32_t (*GetVariableCallback) (void *baton,
- const char *name,
- VariableList &var_list);
+ typedef size_t (*GetVariableCallback) (void *baton,
+ const char *name,
+ VariableList &var_list);
static Error
Dump(Stream *s, bool show_context) const;
lldb::VariableSP
- GetVariableAtIndex(uint32_t idx) const;
+ GetVariableAtIndex(size_t idx) const;
lldb::VariableSP
- RemoveVariableAtIndex (uint32_t idx);
+ RemoveVariableAtIndex (size_t idx);
lldb::VariableSP
FindVariable (const ConstString& name);
}
// Used for column widths
- uint32_t
+ size_t
GetMaxUserIDNameLength() const
{
return m_max_uid_name_len;
}
// Used for column widths
- uint32_t
+ size_t
GetMaxGroupIDNameLength() const
{
return m_max_gid_name_len;
Mutex m_gid_map_mutex;
IDToNameMap m_uid_map;
IDToNameMap m_gid_map;
- uint32_t m_max_uid_name_len;
- uint32_t m_max_gid_name_len;
+ size_t m_max_uid_name_len;
+ size_t m_max_gid_name_len;
const char *
GetCachedUserName (uint32_t uid)
const FileAction *
GetFileActionForFD (int fd) const
{
- for (uint32_t idx=0, count=m_file_actions.size(); idx < count; ++idx)
+ for (size_t idx=0, count=m_file_actions.size(); idx < count; ++idx)
{
if (m_file_actions[idx].GetFD () == fd)
return &m_file_actions[idx];
m_infos.clear();
}
- uint32_t
+ size_t
GetSize()
{
return m_infos.size();
}
const char *
- GetProcessNameAtIndex (uint32_t idx)
+ GetProcessNameAtIndex (size_t idx)
{
if (idx < m_infos.size())
return m_infos[idx].GetName();
}
size_t
- GetProcessNameLengthAtIndex (uint32_t idx)
+ GetProcessNameLengthAtIndex (size_t idx)
{
if (idx < m_infos.size())
return m_infos[idx].GetNameLength();
}
lldb::pid_t
- GetProcessIDAtIndex (uint32_t idx)
+ GetProcessIDAtIndex (size_t idx)
{
if (idx < m_infos.size())
return m_infos[idx].GetProcessID();
}
bool
- GetInfoAtIndex (uint32_t idx, ProcessInstanceInfo &info)
+ GetInfoAtIndex (size_t idx, ProcessInstanceInfo &info)
{
if (idx < m_infos.size())
{
// You must ensure "idx" is valid before calling this function
const ProcessInstanceInfo &
- GetProcessInfoAtIndex (uint32_t idx) const
+ GetProcessInfoAtIndex (size_t idx) const
{
assert (idx < m_infos.size());
return m_infos[idx];
size_t
WriteScalarToMemory (lldb::addr_t vm_addr,
const Scalar &scalar,
- uint32_t size,
+ size_t size,
Error &error);
size_t
GetRegisterCount () = 0;
virtual const RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg) = 0;
+ GetRegisterInfoAtIndex (size_t reg) = 0;
virtual size_t
GetRegisterSetCount () = 0;
virtual const RegisterSet *
- GetRegisterSet (uint32_t reg_set) = 0;
+ GetRegisterSet (size_t reg_set) = 0;
virtual bool
ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value) = 0;
#define LLDB_INVALID_THREAD_ID 0
#define LLDB_INVALID_FRAME_ID UINT32_MAX
#define LLDB_INVALID_SIGNAL_NUMBER INT32_MAX
+#define LLDB_INVALID_OFFSET UINT64_MAX // Must match max of lldb::offset_t
//----------------------------------------------------------------------
/// CPU Type defintions
typedef uint64_t user_id_t;
typedef uint64_t pid_t;
typedef uint64_t tid_t;
+ typedef uint64_t offset_t;
typedef int32_t break_id_t;
typedef int32_t watch_id_t;
typedef void * clang_type_t;
SetByteOrder (lldb::ByteOrder endian);
float
- GetFloat (lldb::SBError& error, uint32_t offset);
+ GetFloat (lldb::SBError& error, lldb::offset_t offset);
double
- GetDouble (lldb::SBError& error, uint32_t offset);
+ GetDouble (lldb::SBError& error, lldb::offset_t offset);
long double
- GetLongDouble (lldb::SBError& error, uint32_t offset);
+ GetLongDouble (lldb::SBError& error, lldb::offset_t offset);
lldb::addr_t
- GetAddress (lldb::SBError& error, uint32_t offset);
+ GetAddress (lldb::SBError& error, lldb::offset_t offset);
uint8_t
- GetUnsignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset);
uint16_t
- GetUnsignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset);
uint32_t
- GetUnsignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset);
uint64_t
- GetUnsignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset);
int8_t
- GetSignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset);
int16_t
- GetSignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset);
int32_t
- GetSignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset);
int64_t
- GetSignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset);
const char*
- GetString (lldb::SBError& error, uint32_t offset);
+ GetString (lldb::SBError& error, lldb::offset_t offset);
bool
GetDescription (lldb::SBStream &description, lldb::addr_t base_addr);
size_t
ReadRawData (lldb::SBError& error,
- uint32_t offset,
+ lldb::offset_t offset,
void *buf,
size_t size);
float
-SBData::GetFloat (lldb::SBError& error, uint32_t offset)
+SBData::GetFloat (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
float value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetFloat (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => "
"(%f)", error.get(), offset, value);
return value;
}
double
-SBData::GetDouble (lldb::SBError& error, uint32_t offset)
+SBData::GetDouble (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
double value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetDouble (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
"(%f)", error.get(), offset, value);
return value;
}
long double
-SBData::GetLongDouble (lldb::SBError& error, uint32_t offset)
+SBData::GetLongDouble (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
long double value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetLongDouble (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
"(%Lf)", error.get(), offset, value);
return value;
}
lldb::addr_t
-SBData::GetAddress (lldb::SBError& error, uint32_t offset)
+SBData::GetAddress (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
lldb::addr_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetAddress (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
"(%p)", error.get(), offset, (void*)value);
return value;
}
uint8_t
-SBData::GetUnsignedInt8 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint8_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
"(%c)", error.get(), offset, value);
return value;
}
uint16_t
-SBData::GetUnsignedInt16 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint16_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
"(%hd)", error.get(), offset, value);
return value;
}
uint32_t
-SBData::GetUnsignedInt32 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint32_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
"(%d)", error.get(), offset, value);
return value;
}
uint64_t
-SBData::GetUnsignedInt64 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint64_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
"(%" PRId64 ")", error.get(), offset, value);
return value;
}
int8_t
-SBData::GetSignedInt8 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int8_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
"(%c)", error.get(), offset, value);
return value;
}
int16_t
-SBData::GetSignedInt16 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int16_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
"(%hd)", error.get(), offset, value);
return value;
}
int32_t
-SBData::GetSignedInt32 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int32_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
"(%d)", error.get(), offset, value);
return value;
}
int64_t
-SBData::GetSignedInt64 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int64_t value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
"(%" PRId64 ")", error.get(), offset, value);
return value;
}
const char*
-SBData::GetString (lldb::SBError& error, uint32_t offset)
+SBData::GetString (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
const char* value = 0;
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetString (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetString (error=%p,offset=%" PRIu64 ") => "
"(%p)", error.get(), offset, value);
return value;
}
size_t
SBData::ReadRawData (lldb::SBError& error,
- uint32_t offset,
+ lldb::offset_t offset,
void *buf,
size_t size)
{
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::ReadRawData (error=%p,offset=%d,buf=%p,size=%lu) => "
+ log->Printf ("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%lu) => "
"(%p)", error.get(), offset, buf, size, ok);
return ok ? size : 0;
}
}
BreakpointLocationSP
-Breakpoint::GetLocationAtIndex (uint32_t index)
+Breakpoint::GetLocationAtIndex (size_t index)
{
return m_locations.GetByIndex(index);
}
return bp_sp;
}
-uint32_t
+size_t
Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent (const EventSP &event_sp)
{
const BreakpointEventData *data = GetEventDataFromEvent (event_sp.get());
}
BreakpointID &
-BreakpointIDList::GetBreakpointIDAtIndex (uint32_t index)
+BreakpointIDList::GetBreakpointIDAtIndex (size_t index)
{
if (index < m_breakpoint_ids.size())
return m_breakpoint_ids[index];
}
bool
-BreakpointIDList::RemoveBreakpointIDAtIndex (uint32_t index)
+BreakpointIDList::RemoveBreakpointIDAtIndex (size_t index)
{
if (index >= m_breakpoint_ids.size())
return false;
}
bool
-BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, uint32_t *position)
+BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, size_t *position)
{
- BreakpointIDArray::iterator tmp_pos;
-
for (size_t i = 0; i < m_breakpoint_ids.size(); ++i)
{
BreakpointID tmp_id = m_breakpoint_ids[i];
}
bool
-BreakpointIDList::FindBreakpointID (const char *bp_id_str, uint32_t *position)
+BreakpointIDList::FindBreakpointID (const char *bp_id_str, size_t *position)
{
BreakpointID temp_bp_id;
break_id_t bp_id;
}
void
-BreakpointIDList::InsertStringArray (const char **string_array, uint32_t array_size, CommandReturnObject &result)
+BreakpointIDList::InsertStringArray (const char **string_array, size_t array_size, CommandReturnObject &result)
{
if (string_array == NULL)
return;
bool is_range = false;
current_arg = old_args.GetArgumentAtIndex (i);
- uint32_t range_start_len = 0;
- uint32_t range_end_pos = 0;
+ size_t range_start_len = 0;
+ size_t range_end_pos = 0;
if (BreakpointIDList::StringContainsIDRangeExpression (current_arg, &range_start_len, &range_end_pos))
{
is_range = true;
bool
BreakpointIDList::StringContainsIDRangeExpression (const char *in_string,
- uint32_t *range_start_len,
- uint32_t *range_end_pos)
+ size_t *range_start_len,
+ size_t *range_end_pos)
{
bool is_range_expression = false;
std::string arg_str = in_string;
for (int i = 0; i < specifiers_size && !is_range_expression; ++i)
{
const char *specifier_str = BreakpointID::g_range_specifiers[i];
- int len = strlen (specifier_str);
+ size_t len = strlen (specifier_str);
idx = arg_str.find (BreakpointID::g_range_specifiers[i]);
if (idx != std::string::npos)
{
BreakpointSP
-BreakpointList::GetBreakpointAtIndex (uint32_t i)
+BreakpointList::GetBreakpointAtIndex (size_t i)
{
Mutex::Locker locker(m_mutex);
BreakpointSP stop_sp;
bp_collection::iterator end = m_breakpoints.end();
bp_collection::iterator pos;
- uint32_t curr_i = 0;
+ size_t curr_i = 0;
for (pos = m_breakpoints.begin(), curr_i = 0; pos != end; ++pos, ++curr_i)
{
if (curr_i == i)
}
const BreakpointSP
-BreakpointList::GetBreakpointAtIndex (uint32_t i) const
+BreakpointList::GetBreakpointAtIndex (size_t i) const
{
Mutex::Locker locker(m_mutex);
BreakpointSP stop_sp;
bp_collection::const_iterator end = m_breakpoints.end();
bp_collection::const_iterator pos;
- uint32_t curr_i = 0;
+ size_t curr_i = 0;
for (pos = m_breakpoints.begin(), curr_i = 0; pos != end; ++pos, ++curr_i)
{
if (curr_i == i)
}
BreakpointLocationSP
-BreakpointLocationCollection::GetByIndex (uint32_t i)
+BreakpointLocationCollection::GetByIndex (size_t i)
{
BreakpointLocationSP stop_sp;
if (i < m_break_loc_collection.size())
}
const BreakpointLocationSP
-BreakpointLocationCollection::GetByIndex (uint32_t i) const
+BreakpointLocationCollection::GetByIndex (size_t i) const
{
BreakpointLocationSP stop_sp;
if (i < m_break_loc_collection.size())
BreakpointLocationSP
-BreakpointLocationList::GetByIndex (uint32_t i)
+BreakpointLocationList::GetByIndex (size_t i)
{
Mutex::Locker locker (m_mutex);
BreakpointLocationSP bp_loc_sp;
}
const BreakpointLocationSP
-BreakpointLocationList::GetByIndex (uint32_t i) const
+BreakpointLocationList::GetByIndex (size_t i) const
{
Mutex::Locker locker (m_mutex);
BreakpointLocationSP bp_loc_sp;
// So we go through the match list and pull out the sets that have the same file spec in their line_entry
// and treat each set separately.
- uint32_t num_comp_units = context.module_sp->GetNumCompileUnits();
- for (uint32_t i = 0; i < num_comp_units; i++)
+ const size_t num_comp_units = context.module_sp->GetNumCompileUnits();
+ for (size_t i = 0; i < num_comp_units; i++)
{
CompUnitSP cu_sp (context.module_sp->GetCompileUnitAtIndex (i));
if (cu_sp)
size_t num_names = m_func_names.size();
for (int j = 0; j < num_names; j++)
{
- uint32_t num_functions = context.module_sp->FindFunctions (m_func_names[j],
- NULL,
- m_func_name_type_mask,
- include_symbols,
- include_inlines,
- append,
- func_list);
+ size_t num_functions = context.module_sp->FindFunctions (m_func_names[j],
+ NULL,
+ m_func_name_type_mask,
+ include_symbols,
+ include_inlines,
+ append,
+ func_list);
// If the search filter specifies a Compilation Unit, then we don't need to bother to look in plain
// symbols, since all the ones from a set compilation unit will have been found above already.
BreakpointSiteList *list,
const BreakpointLocationSP& owner,
lldb::addr_t addr,
- lldb::tid_t tid,
bool use_hardware
) :
- StoppointLocation(GetNextID(), addr, tid, use_hardware),
+ StoppointLocation(GetNextID(), addr, 0, use_hardware),
m_type (eSoftware), // Process subclasses need to set this correctly using SetType()
m_saved_opcode(),
m_trap_opcode(),
}
bool
-BreakpointSite::SetTrapOpcode (const uint8_t *trap_opcode, size_t trap_opcode_size)
+BreakpointSite::SetTrapOpcode (const uint8_t *trap_opcode, uint32_t trap_opcode_size)
{
if (trap_opcode_size > 0 && trap_opcode_size <= sizeof(m_trap_opcode))
{
m_owners.Add(owner);
}
-uint32_t
+size_t
BreakpointSite::RemoveOwner (lldb::break_id_t break_id, lldb::break_id_t break_loc_id)
{
m_owners.Remove(break_id, break_loc_id);
return m_owners.GetSize();
}
-uint32_t
+size_t
BreakpointSite::GetNumberOfOwners ()
{
return m_owners.GetSize();
}
BreakpointLocationSP
-BreakpointSite::GetOwnerAtIndex (uint32_t index)
+BreakpointSite::GetOwnerAtIndex (size_t index)
{
return m_owners.GetByIndex (index);
}
using namespace lldb;
using namespace lldb_private;
-Watchpoint::Watchpoint (Target& target, lldb::addr_t addr, size_t size, const ClangASTType *type, bool hardware) :
+Watchpoint::Watchpoint (Target& target, lldb::addr_t addr, uint32_t size, const ClangASTType *type, bool hardware) :
StoppointLocation (0, addr, size, hardware),
m_target(target),
m_enabled(false),
// I'm going to use the "glob" function with GLOB_TILDE for user directory expansion.
// If it is not defined on your host system, you'll need to implement it yourself...
- int partial_name_len = strlen(partial_file_name);
+ size_t partial_name_len = strlen(partial_file_name);
if (partial_name_len >= PATH_MAX)
return matches.GetSize();
bool
CommandObjectApropos::DoExecute (Args& args, CommandReturnObject &result)
{
- const int argc = args.GetArgumentCount ();
+ const size_t argc = args.GetArgumentCount ();
if (argc == 1)
{
return false;
}
- int num_args = args.GetArgumentCount ();
+ const size_t num_args = args.GetArgumentCount ();
int arg_index;
if (!num_args)
case eSetTypeFileAndLine: // Breakpoint by source position
{
FileSpec file;
- uint32_t num_files = m_options.m_filenames.GetSize();
+ const size_t num_files = m_options.m_filenames.GetSize();
if (num_files == 0)
{
if (!GetDefaultFile (target, file, result))
break;
case eSetTypeSourceRegexp: // Breakpoint by regexp on source text.
{
- int num_files = m_options.m_filenames.GetSize();
+ const size_t num_files = m_options.m_filenames.GetSize();
if (num_files == 0)
{
Breakpoint *breakpoint = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
if (breakpoint != NULL)
{
- int num_locations = breakpoint->GetNumLocations();
+ const size_t num_locations = breakpoint->GetNumLocations();
if (cur_bp_id.GetLocationID() > num_locations)
{
StreamString id_str;
return "";
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
bool
DoExecute(Args& command, CommandReturnObject &result)
{
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc == 1)
{
const char *filename = command.GetArgumentAtIndex(0);
{
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
const char *error_cstr = result_valobj_sp->GetError().AsCString();
if (error_cstr && error_cstr[0])
{
- int error_cstr_len = strlen (error_cstr);
+ const size_t error_cstr_len = strlen (error_cstr);
const bool ends_with_newline = error_cstr[error_cstr_len - 1] == '\n';
if (strstr(error_cstr, "error:") != error_cstr)
error_stream->PutCString ("error: ");
{
if (m_option_variable.use_regex)
{
- const uint32_t regex_start_index = regex_var_list.GetSize();
+ const size_t regex_start_index = regex_var_list.GetSize();
RegularExpression regex (name_cstr);
if (regex.Compile(name_cstr))
{
num_matches);
if (num_new_regex_vars > 0)
{
- for (uint32_t regex_idx = regex_start_index, end_index = regex_var_list.GetSize();
+ for (size_t regex_idx = regex_start_index, end_index = regex_var_list.GetSize();
regex_idx < end_index;
++regex_idx)
{
}
else // No command arg specified. Use variable_list, instead.
{
- const uint32_t num_variables = variable_list->GetSize();
+ const size_t num_variables = variable_list->GetSize();
if (num_variables > 0)
{
- for (uint32_t i=0; i<num_variables; i++)
+ for (size_t i=0; i<num_variables; i++)
{
var_sp = variable_list->GetVariableAtIndex(i);
bool dump_variable = true;
{
CommandObject::CommandMap::iterator pos;
CommandObject *cmd_obj;
- const int argc = command.GetArgumentCount ();
+ const size_t argc = command.GetArgumentCount ();
// 'help' doesn't take any arguments, other than command names. If argc is 0, we show the user
// all commands (aliases and user commands if asked for). Otherwise every argument must be the name of a command or a sub-command.
{
Stream &output_strm = result.GetOutputStream();
output_strm.Printf("Help requested with ambiguous command name, possible completions:\n");
- const uint32_t match_count = matches.GetSize();
- for (uint32_t i = 0; i < match_count; i++)
+ const size_t match_count = matches.GetSize();
+ for (size_t i = 0; i < match_count; i++)
{
output_strm.Printf("\t%s\n", matches.GetStringAtIndex(i));
}
{
if (m_memory_options.m_output_as_binary)
{
- int bytes_written = outfile_stream.Write (data_sp->GetBytes(), bytes_read);
+ const size_t bytes_written = outfile_stream.Write (data_sp->GetBytes(), bytes_read);
if (bytes_written > 0)
{
- result.GetOutputStream().Printf ("%i bytes %s to '%s'\n",
+ result.GetOutputStream().Printf ("%zi bytes %s to '%s'\n",
bytes_written,
append ? "appended" : "written",
path);
assert (output_stream);
- uint32_t bytes_dumped = data.Dump (output_stream,
- 0,
- m_format_options.GetFormat(),
- item_byte_size,
- item_count,
- num_per_line,
- addr,
- 0,
- 0,
- exe_scope);
+ size_t bytes_dumped = data.Dump (output_stream,
+ 0,
+ m_format_options.GetFormat(),
+ item_byte_size,
+ item_count,
+ num_per_line,
+ addr,
+ 0,
+ 0,
+ exe_scope);
m_next_addr = addr + bytes_dumped;
output_stream->EOL();
return true;
uint64_t uval64;
int64_t sval64;
bool success = false;
- const uint32_t num_value_args = command.GetArgumentCount();
- uint32_t i;
- for (i=0; i<num_value_args; ++i)
+ const size_t num_value_args = command.GetArgumentCount();
+ for (size_t i=0; i<num_value_args; ++i)
{
const char *value_str = command.GetArgumentAtIndex(i);
else
{
std::string error_msg;
- int num_subcmd_matches = matches.GetSize();
+ const size_t num_subcmd_matches = matches.GetSize();
if (num_subcmd_matches > 0)
error_msg.assign ("ambiguous command ");
else
if (num_subcmd_matches > 0)
{
error_msg.append (" Possible completions:");
- for (int i = 0; i < num_subcmd_matches; i++)
+ for (size_t i = 0; i < num_subcmd_matches; i++)
{
error_msg.append ("\n\t");
error_msg.append (matches.GetStringAtIndex (i));
}
}
error_msg.append ("\n");
- result.AppendRawError (error_msg.c_str(), error_msg.size());
+ result.AppendRawError (error_msg.c_str());
result.SetStatus (eReturnStatusFailed);
}
}
if (platform_sp)
{
Error error;
- const uint32_t argc = args.GetArgumentCount();
+ const size_t argc = args.GetArgumentCount();
Target *target = m_exe_ctx.GetTargetPtr();
Module *exe_module = target->GetExecutableModulePointer();
if (exe_module)
{
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
match_info.SetNameMatchType(eNameMatchStartsWith);
}
platform_sp->FindProcesses (match_info, process_infos);
- const uint32_t num_matches = process_infos.GetSize();
+ const size_t num_matches = process_infos.GetSize();
if (num_matches > 0)
{
- for (uint32_t i=0; i<num_matches; ++i)
+ for (size_t i=0; i<num_matches; ++i)
{
matches.AppendString (process_infos.GetProcessNameAtIndex(i),
process_infos.GetProcessNameLengthAtIndex(i));
StopInfoSP stop_info_sp = sel_thread_sp->GetStopInfo();
if (stop_info_sp && stop_info_sp->GetStopReason() == eStopReasonBreakpoint)
{
- uint64_t bp_site_id = stop_info_sp->GetValue();
+ lldb::break_id_t bp_site_id = (lldb::break_id_t)stop_info_sp->GetValue();
BreakpointSiteSP bp_site_sp(process->GetBreakpointSiteList().FindByID(bp_site_id));
if (bp_site_sp)
{
- uint32_t num_owners = bp_site_sp->GetNumberOfOwners();
- for (uint32_t i = 0; i < num_owners; i++)
+ const size_t num_owners = bp_site_sp->GetNumberOfOwners();
+ for (size_t i = 0; i < num_owners; i++)
{
Breakpoint &bp_ref = bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint();
if (!bp_ref.IsInternal())
{
Process *process = m_exe_ctx.GetProcessPtr();
- const uint32_t argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
for (uint32_t i=0; i<argc; ++i)
{
{
Process *process = m_exe_ctx.GetProcessPtr();
- const uint32_t argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
for (uint32_t i=0; i<argc; ++i)
{
DumpRegisterSet (const ExecutionContext &exe_ctx,
Stream &strm,
RegisterContext *reg_ctx,
- uint32_t set_idx,
+ size_t set_idx,
bool primitive_only=false)
{
uint32_t unavailable_count = 0;
{
strm.Printf ("%s:\n", reg_set->name);
strm.IndentMore ();
- const uint32_t num_registers = reg_set->num_registers;
- for (uint32_t reg_idx = 0; reg_idx < num_registers; ++reg_idx)
+ const size_t num_registers = reg_set->num_registers;
+ for (size_t reg_idx = 0; reg_idx < num_registers; ++reg_idx)
{
const uint32_t reg = reg_set->registers[reg_idx];
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg);
const RegisterInfo *reg_info = NULL;
if (command.GetArgumentCount() == 0)
{
- uint32_t set_idx;
+ size_t set_idx;
- uint32_t num_register_sets = 1;
- const uint32_t set_array_size = m_command_options.set_indexes.GetSize();
+ size_t num_register_sets = 1;
+ const size_t set_array_size = m_command_options.set_indexes.GetSize();
if (set_array_size > 0)
{
- for (uint32_t i=0; i<set_array_size; ++i)
+ for (size_t i=0; i<set_array_size; ++i)
{
set_idx = m_command_options.set_indexes[i]->GetUInt64Value (UINT32_MAX, NULL);
if (set_idx != UINT32_MAX)
{
if (!DumpRegisterSet (m_exe_ctx, strm, reg_ctx, set_idx))
{
- result.AppendErrorWithFormat ("invalid register set index: %u\n", set_idx);
+ result.AppendErrorWithFormat ("invalid register set index: %zu\n", set_idx);
result.SetStatus (eReturnStatusFailed);
break;
}
bool
DoExecute (Args& command, CommandReturnObject &result)
{
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc != 0)
{
bool append = true;
size_t num_matches = 0;
- if (m_options.modules.size() > 0)
+ const size_t num_modules = m_options.modules.size();
+ if (num_modules > 0)
{
ModuleList matching_modules;
- for (unsigned i = 0, e = m_options.modules.size(); i != e; i++)
+ for (size_t i = 0; i < num_modules; ++i)
{
FileSpec module_file_spec(m_options.modules[i].c_str(), false);
if (module_file_spec)
// This is a little hacky, but the first line table entry for a function points to the "{" that
// starts the function block. It would be nice to actually get the function
// declaration in there too. So back up a bit, but not further than what you're going to display.
- size_t lines_to_back_up = m_options.num_lines >= 10 ? 5 : m_options.num_lines/2;
+ uint32_t lines_to_back_up = m_options.num_lines >= 10 ? 5 : m_options.num_lines/2;
uint32_t line_no;
if (start_line <= lines_to_back_up)
line_no = 1;
// The target isn't loaded yet, we need to lookup the file address
// in all modules
const ModuleList &module_list = target->GetImages();
- const uint32_t num_modules = module_list.GetSize();
- for (uint32_t i=0; i<num_modules; ++i)
+ const size_t num_modules = module_list.GetSize();
+ for (size_t i=0; i<num_modules; ++i)
{
ModuleSP module_sp (module_list.GetModuleAtIndex(i));
if (module_sp && module_sp->ResolveFileAddress(m_options.address, so_addr))
if (m_options.modules.size() > 0)
{
ModuleList matching_modules;
- for (unsigned i = 0, e = m_options.modules.size(); i != e; i++)
+ for (size_t i = 0, e = m_options.modules.size(); i < e; ++i)
{
FileSpec module_file_spec(m_options.modules[i].c_str(), false);
if (module_file_spec)
{
CommandObject::CommandMap::iterator pos;
CommandObject *cmd_obj;
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc > 0)
{
return &m_option_group;
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
bool
DoExecute (Args& command, CommandReturnObject &result)
{
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
FileSpec core_file (m_core_file.GetOptionValue().GetCurrentValue());
if (argc == 1 || core_file)
}
- static uint32_t GetVariableCallback (void *baton,
- const char *name,
- VariableList &variable_list)
+ static size_t GetVariableCallback (void *baton,
+ const char *name,
+ VariableList &variable_list)
{
Target *target = static_cast<Target *>(baton);
if (target)
ValueObjectList valobj_list;
const char *arg = args.GetArgumentAtIndex(idx);
- uint32_t matches = 0;
+ size_t matches = 0;
bool use_var_name = false;
if (m_option_variable.use_regex)
{
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
if (target)
{
- uint32_t argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc & 1)
{
result.AppendError ("add requires an even number of arguments\n");
}
else
{
- for (uint32_t i=0; i<argc; i+=2)
+ for (size_t i=0; i<argc; i+=2)
{
const char *from = command.GetArgumentAtIndex(i);
const char *to = command.GetArgumentAtIndex(i+1);
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
if (target)
{
- uint32_t argc = command.GetArgumentCount();
+ size_t argc = command.GetArgumentCount();
// check for at least 3 arguments and an odd nubmer of parameters
if (argc >= 3 && argc & 1)
{
strm.IndentLess ();
}
-static uint32_t
+static size_t
LookupFunctionInModule (CommandInterpreter &interpreter,
Stream &strm,
Module *module,
{
SymbolContextList sc_list;
const bool append = true;
- uint32_t num_matches = 0;
+ size_t num_matches = 0;
if (name_is_regex)
{
RegularExpression function_name_regex (name);
if (num_matches)
{
strm.Indent ();
- strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : "");
+ strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
DumpSymbolContextList (interpreter.GetExecutionContext().GetBestExecutionContextScope(), strm, sc_list, verbose);
return 0;
}
-static uint32_t
+static size_t
LookupTypeInModule (CommandInterpreter &interpreter,
Stream &strm,
Module *module,
{
TypeList type_list;
const uint32_t max_num_matches = UINT32_MAX;
- uint32_t num_matches = 0;
+ size_t num_matches = 0;
bool name_is_fully_qualified = false;
SymbolContext sc;
if (num_matches)
{
strm.Indent ();
- strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : "");
+ strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
const uint32_t num_types = type_list.GetSize();
return 0;
}
-static uint32_t
+static size_t
LookupTypeHere (CommandInterpreter &interpreter,
Stream &strm,
const SymbolContext &sym_ctx,
TypeList type_list;
const uint32_t max_num_matches = UINT32_MAX;
- uint32_t num_matches = 1;
+ size_t num_matches = 1;
bool name_is_fully_qualified = false;
ConstString name(name_cstr);
{
// Check the global list
Mutex::Locker locker(Module::GetAllocationModuleCollectionMutex());
- const uint32_t num_modules = Module::GetNumberAllocatedModules();
+ const size_t num_modules = Module::GetNumberAllocatedModules();
ModuleSP module_sp;
- for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
+ for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
Module *module = Module::GetAllocatedModuleAtIndex(image_idx);
{
// Dump all sections for all modules images
Mutex::Locker modules_locker(target->GetImages().GetMutex());
- const uint32_t num_modules = target->GetImages().GetSize();
+ const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping symbol table for %u modules.\n", num_modules);
- for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
+ result.GetOutputStream().Printf("Dumping symbol table for %zu modules.\n", num_modules);
+ for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (num_dumped > 0)
{
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
- const uint32_t num_modules = target->GetImages().GetSize();
+ const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping sections for %u modules.\n", num_modules);
- for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
+ result.GetOutputStream().Printf("Dumping sections for %zu modules.\n", num_modules);
+ for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
num_dumped++;
DumpModuleSections (m_interpreter, result.GetOutputStream(), target->GetImages().GetModulePointerAtIndex(image_idx));
// Dump all sections for all modules images
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker (target_modules.GetMutex());
- const uint32_t num_modules = target_modules.GetSize();
+ const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping debug symbols for %u modules.\n", num_modules);
+ result.GetOutputStream().Printf("Dumping debug symbols for %zu modules.\n", num_modules);
for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (DumpModuleSymbolVendor (result.GetOutputStream(), target_modules.GetModulePointerAtIndexUnlocked(image_idx)))
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker(target_modules.GetMutex());
- const uint32_t num_modules = target_modules.GetSize();
+ const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
uint32_t num_dumped = 0;
return &m_option_group;
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
}
else
{
- uint32_t width = 0;
+ unsigned long width = 0;
if (option_arg)
width = strtoul (option_arg, NULL, 0);
m_format_array.push_back(std::make_pair(short_option, width));
ModuleSP module_sp (module_address.GetModule());
if (module_sp)
{
- PrintModule (target, module_sp.get(), UINT32_MAX, 0, strm);
+ PrintModule (target, module_sp.get(), 0, strm);
result.SetStatus (eReturnStatusSuccessFinishResult);
}
else
return result.Succeeded();
}
- uint32_t num_modules = 0;
+ size_t num_modules = 0;
Mutex::Locker locker; // This locker will be locked on the mutex in module_list_ptr if it is non-NULL.
// Otherwise it will lock the AllocationModuleCollectionMutex when accessing
// the global module list directly.
module_sp = module->shared_from_this();
}
- int indent = strm.Printf("[%3u] ", image_idx);
- PrintModule (target, module, image_idx, indent, strm);
+ const size_t indent = strm.Printf("[%3u] ", image_idx);
+ PrintModule (target, module, indent, strm);
}
result.SetStatus (eReturnStatusSuccessFinishResult);
}
void
- PrintModule (Target *target, Module *module, uint32_t idx, int indent, Stream &strm)
+ PrintModule (Target *target, Module *module, int indent, Stream &strm)
{
if (module == NULL)
break;
case 'r':
{
- uint32_t ref_count = 0;
+ size_t ref_count = 0;
ModuleSP module_sp (module->shared_from_this());
if (module_sp)
{
ref_count = module_sp.use_count() - 1;
}
if (width)
- strm.Printf("{%*u}", width, ref_count);
+ strm.Printf("{%*zu}", width, ref_count);
else
- strm.Printf("{%u}", ref_count);
+ strm.Printf("{%zu}", ref_count);
}
break;
if (m_options.m_type == eLookupTypeFunctionOrSymbol)
{
SymbolContextList sc_list;
- uint32_t num_matches;
+ size_t num_matches;
ConstString function_name (m_options.m_str.c_str());
num_matches = target->GetImages().FindFunctions (function_name, eFunctionNameTypeAuto, true, false, true, sc_list);
for (uint32_t idx = 0; idx < num_matches; idx++)
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker(target_modules.GetMutex());
- const uint32_t num_modules = target_modules.GetSize();
+ const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
for (i = 0; i<num_modules && syntax_error == false; ++i)
{
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
}
else
{
- uint32_t num_args = command.GetArgumentCount();
+ const size_t num_args = command.GetArgumentCount();
Process *process = m_exe_ctx.GetProcessPtr();
Mutex::Locker locker (process->GetThreadList().GetMutex());
std::vector<ThreadSP> thread_sps;
- for (uint32_t i = 0; i < num_args; i++)
+ for (size_t i = 0; i < num_args; i++)
{
bool success;
}
protected:
- static uint32_t GetVariableCallback (void *baton,
- const char *name,
- VariableList &variable_list)
+ static size_t GetVariableCallback (void *baton,
+ const char *name,
+ VariableList &variable_list)
{
Target *target = static_cast<Target *>(baton);
if (target)
if (GetByteOrderAndAddressSize (exe_scope, address, byte_order, addr_size))
{
DataExtractor data (&buf, sizeof(buf), byte_order, addr_size);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uval64 = data.GetU64(&offset);
}
else
stop_if_block_is_inlined_function,
&variable_list);
- uint32_t num_variables = variable_list.GetSize();
- for (uint32_t var_idx = 0; var_idx < num_variables; ++var_idx)
+ const size_t num_variables = variable_list.GetSize();
+ for (size_t var_idx = 0; var_idx < num_variables; ++var_idx)
{
Variable *var = variable_list.GetVariableAtIndex (var_idx).get();
if (var && var->LocationIsValidForAddress (*this))
};
-uint32_t
+size_t
ArchSpec::AutoComplete (const char *name, StringList &matches)
{
uint32_t i;
{
char *end = NULL;
errno = 0;
- uint32_t cpu = ::strtoul (triple_cstr, &end, 0);
+ uint32_t cpu = (uint32_t)::strtoul (triple_cstr, &end, 0);
if (errno == 0 && cpu != 0 && end && ((*end == '-') || (*end == '.')))
{
errno = 0;
- uint32_t sub = ::strtoul (end + 1, &end, 0);
+ uint32_t sub = (uint32_t)::strtoul (end + 1, &end, 0);
if (errno == 0 && end && ((*end == '-') || (*end == '.') || (*end == '\0')))
{
if (arch.SetArchitecture (eArchTypeMachO, cpu, sub))
llvm::StringRef vendor_str(vendor_os.substr(0, dash_pos));
arch.GetTriple().setVendorName(vendor_str);
const size_t vendor_start_pos = dash_pos+1;
- dash_pos = vendor_os.find(vendor_start_pos, '-');
+ dash_pos = vendor_os.find('-', vendor_start_pos);
if (dash_pos == llvm::StringRef::npos)
{
if (vendor_start_pos < vendor_os.size())
}
}
-uint32_t
+size_t
lldb_private::formatters::NSArrayMSyntheticFrontEnd::CalculateNumChildren ()
{
if (m_data_32)
}
lldb::ValueObjectSP
-lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
if (!m_data_32 && !m_data_64)
return lldb::ValueObjectSP();
lldb::addr_t object_at_idx = (m_data_32 ? m_data_32->_data : m_data_64->_data);
object_at_idx += (idx * m_ptr_size);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromAddress(idx_name.GetData(),
object_at_idx,
m_exe_ctx_ref,
return idx;
}
-uint32_t
+size_t
lldb_private::formatters::NSArrayISyntheticFrontEnd::CalculateNumChildren ()
{
return m_items;
}
lldb::ValueObjectSP
-lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
if (idx >= CalculateNumChildren())
return lldb::ValueObjectSP();
StreamString expr;
expr.Printf("(id)%" PRIu64,object_at_idx);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
m_children.push_back(retval_sp);
return retval_sp;
SyntheticChildrenFrontEnd(*valobj_sp.get())
{}
-uint32_t
+size_t
lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::CalculateNumChildren ()
{
uint64_t count = 0;
}
lldb::ValueObjectSP
-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
lldb::ValueObjectSP valobj_sp = CallSelectorOnObject(m_backend,"id","objectAtIndex:",idx);
if (valobj_sp)
valobj_sp->SetName(ConstString(idx_name.GetData()));
SyntheticChildrenFrontEnd(*valobj_sp.get())
{}
-uint32_t
+size_t
lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::CalculateNumChildren ()
{
uint64_t count = 0;
}
lldb::ValueObjectSP
-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
StreamString valobj_expr_path;
m_backend.GetExpressionPath(valobj_expr_path, false);
StreamString key_fetcher_expr;
- key_fetcher_expr.Printf("(id)[(NSArray*)[%s allKeys] objectAtIndex:%d]",valobj_expr_path.GetData(),idx);
+ key_fetcher_expr.Printf("(id)[(NSArray*)[%s allKeys] objectAtIndex:%zu]",valobj_expr_path.GetData(),idx);
StreamString value_fetcher_expr;
value_fetcher_expr.Printf("(id)[%s objectForKey:%s]",valobj_expr_path.GetData(),key_fetcher_expr.GetData());
StreamString object_fetcher_expr;
return idx;
}
-uint32_t
+size_t
lldb_private::formatters::NSDictionaryISyntheticFrontEnd::CalculateNumChildren ()
{
if (!m_data_32 && !m_data_64)
}
lldb::ValueObjectSP
-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
uint32_t num_children = CalculateNumChildren();
StreamString expr;
expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
}
return dict_item.valobj_sp;
return idx;
}
-uint32_t
+size_t
lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::CalculateNumChildren ()
{
if (!m_data_32 && !m_data_64)
}
lldb::ValueObjectSP
-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
lldb::addr_t m_keys_ptr = (m_data_32 ? m_data_32->_keys_addr : m_data_64->_keys_addr);
lldb::addr_t m_values_ptr = (m_data_32 ? m_data_32->_objs_addr : m_data_64->_objs_addr);
StreamString expr;
expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
}
return dict_item.valobj_sp;
}
const char *
- GetConstCStringWithLength (const char *cstr, int cstr_len)
+ GetConstCStringWithLength (const char *cstr, size_t cstr_len)
{
if (cstr)
{
}
const char *
- GetConstTrimmedCStringWithLength (const char *cstr, int cstr_len)
+ GetConstTrimmedCStringWithLength (const char *cstr, size_t cstr_len)
{
if (cstr)
{
- int trimmed_len = std::min<int> (strlen (cstr), cstr_len);
+ const size_t trimmed_len = std::min<size_t> (strlen (cstr), cstr_len);
return GetConstCStringWithLength (cstr, trimmed_len);
}
return NULL;
if (error.Success())
{
const bool fd_is_file = true;
- MemoryMapFromFileDescriptor (file.GetDescriptor(), offset, length, writeable, fd_is_file);
- return GetByteSize();
+ return MemoryMapFromFileDescriptor (file.GetDescriptor(), offset, length, writeable, fd_is_file);
}
}
}
using namespace lldb_private;
static inline uint16_t
-ReadInt16(const unsigned char* ptr, unsigned offset)
+ReadInt16(const unsigned char* ptr, offset_t offset)
{
return *(uint16_t *)(ptr + offset);
}
static inline uint32_t
-ReadInt32 (const unsigned char* ptr, unsigned offset)
+ReadInt32 (const unsigned char* ptr, offset_t offset)
{
return *(uint32_t *)(ptr + offset);
}
static inline uint64_t
-ReadInt64(const unsigned char* ptr, unsigned offset)
+ReadInt64(const unsigned char* ptr, offset_t offset)
{
return *(uint64_t *)(ptr + offset);
}
static inline uint16_t
-ReadSwapInt16(const unsigned char* ptr, unsigned offset)
+ReadSwapInt16(const unsigned char* ptr, offset_t offset)
{
return llvm::ByteSwap_16(*(uint16_t *)(ptr + offset));
}
static inline uint32_t
-ReadSwapInt32 (const unsigned char* ptr, unsigned offset)
+ReadSwapInt32 (const unsigned char* ptr, offset_t offset)
{
return llvm::ByteSwap_32(*(uint32_t *)(ptr + offset));
}
static inline uint64_t
-ReadSwapInt64(const unsigned char* ptr, unsigned offset)
+ReadSwapInt64(const unsigned char* ptr, offset_t offset)
{
return llvm::ByteSwap_64(*(uint64_t *)(ptr + offset));
}
// This constructor allows us to use data that is owned by someone else.
// The data must stay around as long as this object is valid.
//----------------------------------------------------------------------
-DataExtractor::DataExtractor (const void* data, uint32_t length, ByteOrder endian, uint8_t addr_size) :
+DataExtractor::DataExtractor (const void* data, offset_t length, ByteOrder endian, uint32_t addr_size) :
m_start ((uint8_t*)data),
m_end ((uint8_t*)data + length),
m_byte_order(endian),
// as long as any DataExtractor objects exist that have a reference to
// this data.
//----------------------------------------------------------------------
-DataExtractor::DataExtractor (const DataBufferSP& data_sp, ByteOrder endian, uint8_t addr_size) :
+DataExtractor::DataExtractor (const DataBufferSP& data_sp, ByteOrder endian, uint32_t addr_size) :
m_start (NULL),
m_end (NULL),
m_byte_order(endian),
// as any object contains a reference to that data. The endian
// swap and address size settings are copied from "data".
//----------------------------------------------------------------------
-DataExtractor::DataExtractor (const DataExtractor& data, uint32_t offset, uint32_t length) :
+DataExtractor::DataExtractor (const DataExtractor& data, offset_t offset, offset_t length) :
m_start(NULL),
m_end(NULL),
m_byte_order(data.m_byte_order),
{
if (data.ValidOffset(offset))
{
- uint32_t bytes_available = data.GetByteSize() - offset;
+ offset_t bytes_available = data.GetByteSize() - offset;
if (length > bytes_available)
length = bytes_available;
SetData(data, offset, length);
// into the data that is in this object.
//------------------------------------------------------------------
bool
-DataExtractor::ValidOffsetForDataOfSize (uint32_t offset, uint32_t length) const
+DataExtractor::ValidOffsetForDataOfSize (offset_t offset, offset_t length) const
{
- size_t size = GetByteSize();
+ offset_t size = GetByteSize();
if (offset >= size)
return false; // offset isn't valid
// reference to that data will be released. Is SWAP is set to true,
// any data extracted will be endian swapped.
//----------------------------------------------------------------------
-uint32_t
-DataExtractor::SetData (const void *bytes, uint32_t length, ByteOrder endian)
+lldb::offset_t
+DataExtractor::SetData (const void *bytes, offset_t length, ByteOrder endian)
{
m_byte_order = endian;
m_data_sp.reset();
// refers to those bytes. The address size and endian swap settings
// are copied from the current values in "data".
//----------------------------------------------------------------------
-uint32_t
-DataExtractor::SetData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
+lldb::offset_t
+DataExtractor::SetData (const DataExtractor& data, offset_t data_offset, offset_t data_length)
{
m_addr_size = data.m_addr_size;
// If "data" contains shared pointer to data, then we can use that
// around as long as it is needed. The address size and endian swap
// settings will remain unchanged from their current settings.
//----------------------------------------------------------------------
-uint32_t
-DataExtractor::SetData (const DataBufferSP& data_sp, uint32_t data_offset, uint32_t data_length)
+lldb::offset_t
+DataExtractor::SetData (const DataBufferSP& data_sp, offset_t data_offset, offset_t data_length)
{
m_start = m_end = NULL;
}
}
- uint32_t new_size = GetByteSize();
+ size_t new_size = GetByteSize();
// Don't hold a shared pointer to the data buffer if we don't share
// any valid bytes in the shared buffer.
// RETURNS the byte that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint8_t
-DataExtractor::GetU8 (uint32_t *offset_ptr) const
+DataExtractor::GetU8 (offset_t *offset_ptr) const
{
uint8_t val = 0;
if ( m_start < m_end )
// the buffer due to being out of bounds, or unsufficient data.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU8 (uint32_t *offset_ptr, void *dst, uint32_t count) const
+DataExtractor::GetU8 (offset_t *offset_ptr, void *dst, uint32_t count) const
{
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, count) )
{
// RETURNS the uint16_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint16_t
-DataExtractor::GetU16 (uint32_t *offset_ptr) const
+DataExtractor::GetU16 (offset_t *offset_ptr) const
{
uint16_t val = 0;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( ValidOffsetForDataOfSize(offset, sizeof(val)) )
{
if (m_byte_order != lldb::endian::InlHostByteOrder())
}
uint16_t
-DataExtractor::GetU16_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetU16_unchecked (offset_t *offset_ptr) const
{
uint16_t val = (m_byte_order == lldb::endian::InlHostByteOrder()) ?
ReadInt16 (m_start, *offset_ptr) :
}
uint32_t
-DataExtractor::GetU32_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetU32_unchecked (offset_t *offset_ptr) const
{
uint32_t val = (m_byte_order == lldb::endian::InlHostByteOrder()) ?
ReadInt32 (m_start, *offset_ptr) :
}
uint64_t
-DataExtractor::GetU64_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetU64_unchecked (offset_t *offset_ptr) const
{
uint64_t val = (m_byte_order == lldb::endian::InlHostByteOrder()) ?
ReadInt64 (m_start, *offset_ptr) :
// in the buffer due to being out of bounds, or unsufficient data.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU16 (uint32_t *offset_ptr, void *void_dst, uint32_t count) const
+DataExtractor::GetU16 (offset_t *offset_ptr, void *void_dst, uint32_t count) const
{
uint16_t *dst = (uint16_t *)void_dst;
const size_t value_size = sizeof(*dst);
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, value_size * count) )
{
// RETURNS the uint32_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint32_t
-DataExtractor::GetU32 (uint32_t *offset_ptr) const
+DataExtractor::GetU32 (offset_t *offset_ptr) const
{
uint32_t val = 0;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( ValidOffsetForDataOfSize(offset, sizeof(val)) )
{
// in the buffer due to being out of bounds, or unsufficient data.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU32 (uint32_t *offset_ptr, void *void_dst, uint32_t count) const
+DataExtractor::GetU32 (offset_t *offset_ptr, void *void_dst, uint32_t count) const
{
uint32_t *dst = (uint32_t *)void_dst;
const size_t value_size = sizeof(*dst);
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, value_size * count))
{
// RETURNS the uint64_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetU64 (uint32_t *offset_ptr) const
+DataExtractor::GetU64 (offset_t *offset_ptr) const
{
uint64_t val = 0;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( ValidOffsetForDataOfSize(offset, sizeof(val)) )
{
if (m_byte_order != lldb::endian::InlHostByteOrder())
// return false and leave the offset pointed to by offset_ptr unchanged.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU64 (uint32_t *offset_ptr, void *void_dst, uint32_t count) const
+DataExtractor::GetU64 (offset_t *offset_ptr, void *void_dst, uint32_t count) const
{
uint64_t *dst = (uint64_t *)void_dst;
const size_t value_size = sizeof(uint64_t);
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, value_size * count))
{
// RETURNS the integer value that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint32_t
-DataExtractor::GetMaxU32 (uint32_t *offset_ptr, uint32_t byte_size) const
+DataExtractor::GetMaxU32 (offset_t *offset_ptr, size_t byte_size) const
{
switch (byte_size)
{
case 2: return GetU16(offset_ptr); break;
case 4: return GetU32(offset_ptr); break;
default:
- assert(!"GetMaxU32 unhandled case!");
+ assert("GetMaxU32 unhandled case!" == NULL);
break;
}
return 0;
// RETURNS the integer value that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetMaxU64 (uint32_t *offset_ptr, uint32_t size) const
+DataExtractor::GetMaxU64 (offset_t *offset_ptr, size_t size) const
{
switch (size)
{
case 4: return GetU32(offset_ptr); break;
case 8: return GetU64(offset_ptr); break;
default:
- assert(!"GetMax64 unhandled case!");
+ assert("GetMax64 unhandled case!" == NULL);
break;
}
return 0;
}
uint64_t
-DataExtractor::GetMaxU64_unchecked (uint32_t *offset_ptr, uint32_t size) const
+DataExtractor::GetMaxU64_unchecked (offset_t *offset_ptr, size_t size) const
{
switch (size)
{
case 4: return GetU32_unchecked (offset_ptr); break;
case 8: return GetU64_unchecked (offset_ptr); break;
default:
- assert(!"GetMax64 unhandled case!");
+ assert("GetMax64 unhandled case!" == NULL);
break;
}
return 0;
}
int64_t
-DataExtractor::GetMaxS64 (uint32_t *offset_ptr, uint32_t size) const
+DataExtractor::GetMaxS64 (offset_t *offset_ptr, size_t size) const
{
switch (size)
{
case 4: return (int32_t)GetU32(offset_ptr); break;
case 8: return (int64_t)GetU64(offset_ptr); break;
default:
- assert(!"GetMax64 unhandled case!");
+ assert("GetMax64 unhandled case!" == NULL);
break;
}
return 0;
}
uint64_t
-DataExtractor::GetMaxU64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
+DataExtractor::GetMaxU64Bitfield (offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
{
uint64_t uval64 = GetMaxU64 (offset_ptr, size);
if (bitfield_bit_size > 0)
}
int64_t
-DataExtractor::GetMaxS64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
+DataExtractor::GetMaxS64Bitfield (offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
{
int64_t sval64 = GetMaxS64 (offset_ptr, size);
if (bitfield_bit_size > 0)
float
-DataExtractor::GetFloat (uint32_t *offset_ptr) const
+DataExtractor::GetFloat (offset_t *offset_ptr) const
{
typedef float float_type;
float_type val = 0.0;
}
double
-DataExtractor::GetDouble (uint32_t *offset_ptr) const
+DataExtractor::GetDouble (offset_t *offset_ptr) const
{
typedef double float_type;
float_type val = 0.0;
long double
-DataExtractor::GetLongDouble (uint32_t *offset_ptr) const
+DataExtractor::GetLongDouble (offset_t *offset_ptr) const
{
typedef long double float_type;
float_type val = 0.0;
// RETURNS the address that was extracted, or zero on failure.
//------------------------------------------------------------------
uint64_t
-DataExtractor::GetAddress (uint32_t *offset_ptr) const
+DataExtractor::GetAddress (offset_t *offset_ptr) const
{
return GetMaxU64 (offset_ptr, m_addr_size);
}
uint64_t
-DataExtractor::GetAddress_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetAddress_unchecked (offset_t *offset_ptr) const
{
return GetMaxU64_unchecked (offset_ptr, m_addr_size);
}
// RETURNS the pointer that was extracted, or zero on failure.
//------------------------------------------------------------------
uint64_t
-DataExtractor::GetPointer (uint32_t *offset_ptr) const
+DataExtractor::GetPointer (offset_t *offset_ptr) const
{
return GetMaxU64 (offset_ptr, m_addr_size);
}
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetGNUEHPointer (uint32_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr)//, BSDRelocs *data_relocs) const
+DataExtractor::GetGNUEHPointer (offset_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr)//, BSDRelocs *data_relocs) const
{
if (eh_ptr_enc == DW_EH_PE_omit)
return ULLONG_MAX; // Value isn't in the buffer...
}
size_t
-DataExtractor::ExtractBytes (uint32_t offset, uint32_t length, ByteOrder dst_byte_order, void *dst) const
+DataExtractor::ExtractBytes (offset_t offset, offset_t length, ByteOrder dst_byte_order, void *dst) const
{
const uint8_t *src = PeekData (offset, length);
if (src)
// and there are "length" bytes available, else NULL is returned.
//----------------------------------------------------------------------
const uint8_t*
-DataExtractor::PeekData (uint32_t offset, uint32_t length) const
+DataExtractor::PeekData (offset_t offset, offset_t length) const
{
if ( length > 0 && ValidOffsetForDataOfSize(offset, length) )
return m_start + offset;
// or NULL otherwise.
//----------------------------------------------------------------------
const void*
-DataExtractor::GetData (uint32_t *offset_ptr, uint32_t length) const
+DataExtractor::GetData (offset_t *offset_ptr, offset_t length) const
{
const uint8_t* bytes = NULL;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( length > 0 && ValidOffsetForDataOfSize(offset, length) )
{
bytes = m_start + offset;
}
// Extract data and swap if needed when doing the copy
-uint32_t
-DataExtractor::CopyByteOrderedData (uint32_t src_offset,
- uint32_t src_len,
+lldb::offset_t
+DataExtractor::CopyByteOrderedData (offset_t src_offset,
+ offset_t src_len,
void *dst_void_ptr,
- uint32_t dst_len,
+ offset_t dst_len,
ByteOrder dst_byte_order) const
{
// Validate the source info
- assert (ValidOffsetForDataOfSize(src_offset, src_len));
+ if (!ValidOffsetForDataOfSize(src_offset, src_len))
+ assert (ValidOffsetForDataOfSize(src_offset, src_len));
assert (src_len > 0);
assert (m_byte_order == eByteOrderBig || m_byte_order == eByteOrderLittle);
// We are copying the entire value from src into dst.
// Calculate how many, if any, zeroes we need for the most
// significant bytes if "dst_len" is greater than "src_len"...
- const uint32_t num_zeroes = dst_len - src_len;
+ const size_t num_zeroes = dst_len - src_len;
if (dst_byte_order == eByteOrderBig)
{
// Big endian, so we lead with zeroes...
// updated.
//----------------------------------------------------------------------
const char*
-DataExtractor::GetCStr (uint32_t *offset_ptr) const
+DataExtractor::GetCStr (offset_t *offset_ptr) const
{
const char *s = NULL;
if ( m_start < m_end )
// this object's data, else NULL is returned.
//------------------------------------------------------------------
const char *
-DataExtractor::PeekCStr (uint32_t offset) const
+DataExtractor::PeekCStr (offset_t offset) const
{
if (ValidOffset (offset))
return (const char*)m_start + offset;
// Returned the extracted integer value.
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetULEB128 (uint32_t *offset_ptr) const
+DataExtractor::GetULEB128 (offset_t *offset_ptr) const
{
const uint8_t *src = m_start + *offset_ptr;
const uint8_t *end = m_end;
// Returned the extracted integer value.
//----------------------------------------------------------------------
int64_t
-DataExtractor::GetSLEB128 (uint32_t *offset_ptr) const
+DataExtractor::GetSLEB128 (offset_t *offset_ptr) const
{
int64_t result = 0;
// Returns the number of bytes consumed during the extraction.
//----------------------------------------------------------------------
uint32_t
-DataExtractor::Skip_LEB128 (uint32_t *offset_ptr) const
+DataExtractor::Skip_LEB128 (offset_t *offset_ptr) const
{
uint32_t bytes_consumed = 0;
if ( m_start < m_end )
return bytes_consumed;
}
-static uint32_t
-DumpAPInt (Stream *s, const DataExtractor &data, uint32_t offset, uint32_t byte_size, bool is_signed, unsigned radix)
+static lldb::offset_t
+DumpAPInt (Stream *s, const DataExtractor &data, lldb::offset_t offset, lldb::offset_t byte_size, bool is_signed, unsigned radix)
{
llvm::SmallVector<uint64_t, 2> uint64_array;
- uint32_t bytes_left = byte_size;
+ lldb::offset_t bytes_left = byte_size;
uint64_t u64;
const lldb::ByteOrder byte_order = data.GetByteOrder();
if (byte_order == lldb::eByteOrderLittle)
}
else
{
- u64 = data.GetMaxU64(&offset, bytes_left);
+ u64 = data.GetMaxU64(&offset, (uint32_t)bytes_left);
bytes_left = 0;
}
uint64_array.push_back(u64);
}
else if (byte_order == lldb::eByteOrderBig)
{
- uint32_t be_offset = offset + byte_size;
- uint32_t temp_offset;
+ lldb::offset_t be_offset = offset + byte_size;
+ lldb::offset_t temp_offset;
while (bytes_left > 0)
{
if (bytes_left >= 8)
{
be_offset -= bytes_left;
temp_offset = be_offset;
- u64 = data.GetMaxU64(&temp_offset, bytes_left);
+ u64 = data.GetMaxU64(&temp_offset, (uint32_t)bytes_left);
bytes_left = 0;
}
uint64_array.push_back(u64);
return offset;
}
-uint32_t
+lldb::offset_t
DataExtractor::Dump (Stream *s,
- uint32_t start_offset,
+ offset_t start_offset,
lldb::Format item_format,
- uint32_t item_byte_size,
- uint32_t item_count,
- uint32_t num_per_line,
+ size_t item_byte_size,
+ size_t item_count,
+ size_t num_per_line,
uint64_t base_addr,
uint32_t item_bit_size, // If zero, this is not a bitfield value, if non-zero, the value is a bitfield
uint32_t item_bit_offset, // If "item_bit_size" is non-zero, this is the shift amount to apply to a bitfield
item_byte_size = s->GetAddressByteSize();
}
- uint32_t offset = start_offset;
+ offset_t offset = start_offset;
if (item_format == eFormatInstruction)
{
if ((item_format == eFormatOSType || item_format == eFormatAddressInfo) && item_byte_size > 8)
item_format = eFormatHex;
- uint32_t line_start_offset = start_offset;
+ lldb::offset_t line_start_offset = start_offset;
for (uint32_t count = 0; ValidOffset(offset) && count < item_count; ++count)
{
if ((count % num_per_line) == 0)
{
if (item_format == eFormatBytesWithASCII && offset > line_start_offset)
{
- s->Printf("%*s", (num_per_line - (offset - line_start_offset)) * 3 + 2, "");
- Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0);
+ s->Printf("%*s", static_cast<int>((num_per_line - (offset - line_start_offset)) * 3 + 2), "");
+ Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, LLDB_INVALID_OFFSET, LLDB_INVALID_ADDRESS, 0, 0);
}
s->EOL();
}
s->Printf ("%s", GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset) ? "true" : "false");
else
{
- s->Printf("error: unsupported byte size (%u) for boolean format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for boolean format", item_byte_size);
return offset;
}
break;
if (!cstr)
{
s->Printf("NULL");
- offset = UINT32_MAX;
+ offset = LLDB_INVALID_OFFSET;
}
else
{
case eFormatComplexInteger:
{
- uint32_t complex_int_byte_size = item_byte_size / 2;
+ size_t complex_int_byte_size = item_byte_size / 2;
if (complex_int_byte_size <= 8)
{
}
else
{
- s->Printf("error: unsupported byte size (%u) for complex integer format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for complex integer format", item_byte_size);
return offset;
}
}
}
else
{
- s->Printf("error: unsupported byte size (%u) for complex float format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for complex float format", item_byte_size);
return offset;
}
break;
bool wantsuppercase = (item_format == eFormatHexUppercase);
if (item_byte_size <= 8)
{
- s->Printf(wantsuppercase ? "0x%*.*" PRIX64 : "0x%*.*" PRIx64, 2 * item_byte_size, 2 * item_byte_size, GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
+ s->Printf(wantsuppercase ? "0x%*.*" PRIX64 : "0x%*.*" PRIx64, (int)(2 * item_byte_size), (int)(2 * item_byte_size), GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
}
else
{
}
else
{
- s->Printf("error: unsupported byte size (%u) for float format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for float format", item_byte_size);
return offset;
}
ss.flush();
case eFormatAddressInfo:
{
addr_t addr = GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset);
- s->Printf("0x%*.*" PRIx64, 2 * item_byte_size, 2 * item_byte_size, addr);
+ s->Printf("0x%*.*" PRIx64, (int)(2 * item_byte_size), (int)(2 * item_byte_size), addr);
if (exe_scope)
{
TargetSP target_sp (exe_scope->CalculateTarget());
}
else
{
- s->Printf("error: unsupported byte size (%u) for hex float format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for hex float format", item_byte_size);
return offset;
}
break;
if (item_format == eFormatBytesWithASCII && offset > line_start_offset)
{
- s->Printf("%*s", (num_per_line - (offset - line_start_offset)) * 3 + 2, "");
- Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0);
+ s->Printf("%*s", static_cast<int>((num_per_line - (offset - line_start_offset)) * 3 + 2), "");
+ Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, LLDB_INVALID_OFFSET, LLDB_INVALID_ADDRESS, 0, 0);
}
return offset; // Return the offset at which we ended up
}
// string will be used for the supplied "type". If the stream "s"
// is NULL, then the output will be send to Log().
//----------------------------------------------------------------------
-uint32_t
+lldb::offset_t
DataExtractor::PutToLog
(
Log *log,
- uint32_t start_offset,
- uint32_t length,
+ offset_t start_offset,
+ offset_t length,
uint64_t base_addr,
uint32_t num_per_line,
DataExtractor::Type type,
if (log == NULL)
return start_offset;
- uint32_t offset;
- uint32_t end_offset;
+ offset_t offset;
+ offset_t end_offset;
uint32_t count;
StreamString sstr;
for (offset = start_offset, end_offset = offset + length, count = 0; ValidOffset(offset) && offset < end_offset; ++count)
// Dump out a UUID starting at 'offset' bytes into the buffer
//----------------------------------------------------------------------
void
-DataExtractor::DumpUUID (Stream *s, uint32_t offset) const
+DataExtractor::DumpUUID (Stream *s, offset_t offset) const
{
if (s)
{
}
else
{
- s->Printf("<not enough data for UUID at offset 0x%8.8x>", offset);
+ s->Printf("<not enough data for UUID at offset 0x%8.8" PRIx64 ">", offset);
}
}
}
}
bool
-DataExtractor::Append(void* buf, uint32_t length)
+DataExtractor::Append(void* buf, offset_t length)
{
if (buf == NULL)
return false;
CommandInterpreter::eBroadcastBitAsynchronousErrorData));
}
-uint32_t
+size_t
Debugger::GetNumDebuggers()
{
if (g_shared_debugger_refcount > 0)
}
lldb::DebuggerSP
-Debugger::GetDebuggerAtIndex (uint32_t index)
+Debugger::GetDebuggerAtIndex (size_t index)
{
DebuggerSP debugger_sp;
{
if (log)
log->Printf("[ScanBracketedRange] swapping indices");
- int temp = *index_lower;
+ int64_t temp = *index_lower;
*index_lower = *index_higher;
*index_higher = temp;
}
static ValueObjectSP
ExpandIndexedExpression (ValueObject* valobj,
- uint32_t index,
+ size_t index,
StackFrame* frame,
bool deref_pointer)
{
unsigned long octal_value = ::strtoul (oct_str, NULL, 8);
if (octal_value <= UINT8_MAX)
{
- char octal_char = octal_value;
- s.Write (&octal_char, 1);
+ s.PutChar((char)octal_value);
}
}
break;
unsigned long hex_value = strtoul (hex_str, NULL, 16);
if (hex_value <= UINT8_MAX)
- s.PutChar (hex_value);
+ s.PutChar ((char)hex_value);
}
else
{
std::string line (buffer);
- int len = line.size();
+ size_t len = line.size();
if (line[len-1] == '\n')
{
line[len-1] = '\0';
// Check to see if the line contains the end-of-dictionary marker ("}")
std::string line (buffer);
- int len = line.size();
+ size_t len = line.size();
if (line[len-1] == '\n')
{
line[len-1] = '\0';
}
else
{
- int len = value.size();
+ size_t len = value.size();
if ((value[0] == '"') && (value[len-1] == '"'))
value = value.substr (1, len-2);
value_sp.reset (new OptionValueString (value.c_str(), ""));
InstructionSP
-InstructionList::GetInstructionAtIndex (uint32_t idx) const
+InstructionList::GetInstructionAtIndex (size_t idx) const
{
InstructionSP inst_sp;
if (idx < m_instructions.size())
{
Address address;
address.SetLoadAddress(load_addr, &target);
- uint32_t num_instructions = m_instructions.size();
+ size_t num_instructions = m_instructions.size();
uint32_t index = UINT32_MAX;
- for (int i = 0; i < num_instructions; i++)
+ for (size_t i = 0; i < num_instructions; i++)
{
if (m_instructions[i]->GetAddress() == address)
{
size_t
PseudoInstruction::Decode (const lldb_private::Disassembler &disassembler,
const lldb_private::DataExtractor &data,
- uint32_t data_offset)
+ lldb::offset_t data_offset)
{
return m_opcode.GetByteSize();
}
size_t bytes_read = m_read_mem_callback (this, m_baton, context, addr, buf, byte_size);
if (bytes_read == byte_size)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
DataExtractor data (buf, byte_size, GetByteOrder(), GetAddressByteSize());
uval64 = data.GetMaxU64 (&offset, byte_size);
success = true;
// allocated buffer above
va_list copy_args;
va_copy (copy_args, args);
- size_t length = ::vsnprintf (buf.data(), buf.size(), format, args);
+ unsigned length = ::vsnprintf (buf.data(), buf.size(), format, args);
if (length >= buf.size())
{
// The error formatted string didn't fit into our buffer, resize it
// Returns the valid index of the file that matches "file_spec" if
// it is found, else UINT32_MAX is returned.
//------------------------------------------------------------------
-uint32_t
-FileSpecList::FindFileIndex (uint32_t start_idx, const FileSpec &file_spec, bool full) const
+size_t
+FileSpecList::FindFileIndex (size_t start_idx, const FileSpec &file_spec, bool full) const
{
- const uint32_t num_files = m_files.size();
- uint32_t idx;
+ const size_t num_files = m_files.size();
// When looking for files, we will compare only the filename if the
// FILE_SPEC argument is empty
bool compare_filename_only = file_spec.GetDirectory().IsEmpty();
- for (idx = start_idx; idx < num_files; ++idx)
+ for (size_t idx = start_idx; idx < num_files; ++idx)
{
if (compare_filename_only)
{
// range, then an empty FileSpec object will be returned.
//------------------------------------------------------------------
const FileSpec &
-FileSpecList::GetFileSpecAtIndex(uint32_t idx) const
+FileSpecList::GetFileSpecAtIndex(size_t idx) const
{
if (idx < m_files.size())
}
const FileSpec *
-FileSpecList::GetFileSpecPointerAtIndex(uint32_t idx) const
+FileSpecList::GetFileSpecPointerAtIndex(size_t idx) const
{
if (idx < m_files.size())
return &m_files[idx];
//------------------------------------------------------------------
// Return the number of files in the file spec list.
//------------------------------------------------------------------
-uint32_t
+size_t
FileSpecList::GetSize() const
{
return m_files.size();
}
lldb::ValueObjectSP
-TypeSyntheticImpl::FrontEnd::GetChildAtIndex (uint32_t idx)
+TypeSyntheticImpl::FrontEnd::GetChildAtIndex (size_t idx)
{
if (!m_wrapper_sp || !m_interpreter)
return lldb::ValueObjectSP();
#endif // #ifndef LLDB_DISABLE_PYTHON
int
-SyntheticArrayView::GetRealIndexForIndex(int i)
+SyntheticArrayView::GetRealIndexForIndex(size_t i)
{
if (i >= GetCount())
return -1;
}
TypeCategoryImplSP
-CategoryMap::GetAtIndex (uint32_t index)
+CategoryMap::GetAtIndex (size_t index)
{
Mutex::Locker locker(m_map_mutex);
Module::ParseAllDebugSymbols()
{
Mutex::Locker locker (m_mutex);
- uint32_t num_comp_units = GetNumCompileUnits();
+ size_t num_comp_units = GetNumCompileUnits();
if (num_comp_units == 0)
return;
SymbolContext sc;
sc.module_sp = shared_from_this();
- uint32_t cu_idx;
SymbolVendor *symbols = GetSymbolVendor ();
- for (cu_idx = 0; cu_idx < num_comp_units; cu_idx++)
+ for (size_t cu_idx = 0; cu_idx < num_comp_units; cu_idx++)
{
sc.comp_unit = symbols->GetCompileUnitAtIndex(cu_idx).get();
if (sc.comp_unit)
symbols->ParseCompileUnitFunctions(sc);
- uint32_t func_idx;
- for (func_idx = 0; (sc.function = sc.comp_unit->GetFunctionAtIndex(func_idx).get()) != NULL; ++func_idx)
+ for (size_t func_idx = 0; (sc.function = sc.comp_unit->GetFunctionAtIndex(func_idx).get()) != NULL; ++func_idx)
{
symbols->ParseFunctionBlocks(sc);
s->Printf(", Module{%p}", this);
}
-uint32_t
+size_t
Module::GetNumCompileUnits()
{
Mutex::Locker locker (m_mutex);
}
CompUnitSP
-Module::GetCompileUnitAtIndex (uint32_t index)
+Module::GetCompileUnitAtIndex (size_t index)
{
Mutex::Locker locker (m_mutex);
- uint32_t num_comp_units = GetNumCompileUnits ();
+ size_t num_comp_units = GetNumCompileUnits ();
CompUnitSP cu_sp;
if (index < num_comp_units)
}
-uint32_t
-Module::FindGlobalVariables(const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
+size_t
+Module::FindGlobalVariables (const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
+ bool append,
+ size_t max_matches,
+ VariableList& variables)
{
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
return symbols->FindGlobalVariables(name, namespace_decl, append, max_matches, variables);
return 0;
}
-uint32_t
-Module::FindGlobalVariables(const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables)
+
+size_t
+Module::FindGlobalVariables (const RegularExpression& regex,
+ bool append,
+ size_t max_matches,
+ VariableList& variables)
{
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
return 0;
}
-uint32_t
+size_t
Module::FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list)
if (!append)
sc_list.Clear();
- const uint32_t start_size = sc_list.GetSize();
- const uint32_t num_compile_units = GetNumCompileUnits();
+ const size_t start_size = sc_list.GetSize();
+ const size_t num_compile_units = GetNumCompileUnits();
SymbolContext sc;
sc.module_sp = shared_from_this();
const bool compare_directory = path.GetDirectory();
- for (uint32_t i=0; i<num_compile_units; ++i)
+ for (size_t i=0; i<num_compile_units; ++i)
{
sc.comp_unit = GetCompileUnitAtIndex(i).get();
if (sc.comp_unit)
return sc_list.GetSize() - start_size;
}
-uint32_t
+size_t
Module::FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
- uint32_t name_type_mask,
+ uint32_t name_type_mask,
bool include_symbols,
bool include_inlines,
bool append,
if (!append)
sc_list.Clear();
- const uint32_t start_size = sc_list.GetSize();
+ const size_t start_size = sc_list.GetSize();
// Find all the functions (not symbols, but debug information functions...
SymbolVendor *symbols = GetSymbolVendor ();
{
std::vector<uint32_t> symbol_indexes;
symtab->FindAllSymbolsWithNameAndType (name, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
- const uint32_t num_matches = symbol_indexes.size();
+ const size_t num_matches = symbol_indexes.size();
if (num_matches)
{
const bool merge_symbol_into_function = true;
SymbolContext sc(this);
- for (uint32_t i=0; i<num_matches; i++)
+ for (size_t i=0; i<num_matches; i++)
{
sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
sc_list.AppendIfUnique (sc, merge_symbol_into_function);
return sc_list.GetSize() - start_size;
}
-uint32_t
+size_t
Module::FindFunctions (const RegularExpression& regex,
bool include_symbols,
bool include_inlines,
if (!append)
sc_list.Clear();
- const uint32_t start_size = sc_list.GetSize();
+ const size_t start_size = sc_list.GetSize();
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
{
std::vector<uint32_t> symbol_indexes;
symtab->AppendSymbolIndexesMatchingRegExAndType (regex, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
- const uint32_t num_matches = symbol_indexes.size();
+ const size_t num_matches = symbol_indexes.size();
if (num_matches)
{
const bool merge_symbol_into_function = true;
SymbolContext sc(this);
- for (uint32_t i=0; i<num_matches; i++)
+ for (size_t i=0; i<num_matches; i++)
{
sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
sc_list.AppendIfUnique (sc, merge_symbol_into_function);
return sc_list.GetSize() - start_size;
}
-uint32_t
+size_t
Module::FindTypes_Impl (const SymbolContext& sc,
const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types)
{
Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
return 0;
}
-uint32_t
+size_t
Module::FindTypesInNamespace (const SymbolContext& sc,
const ConstString &type_name,
const ClangNamespaceDecl *namespace_decl,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& type_list)
{
const bool append = true;
bool exact_match)
{
TypeList type_list;
- const uint32_t num_matches = FindTypes (sc, name, exact_match, 1, type_list);
+ const size_t num_matches = FindTypes (sc, name, exact_match, 1, type_list);
if (num_matches)
return type_list.GetTypeAtIndex(0);
return TypeSP();
}
-uint32_t
+size_t
Module::FindTypes (const SymbolContext& sc,
const ConstString &name,
bool exact_match,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types)
{
- uint32_t num_matches = 0;
+ size_t num_matches = 0;
const char *type_name_cstr = name.GetCString();
std::string type_scope;
std::string type_basename;
}
-//uint32_t
-//Module::FindTypes(const SymbolContext& sc, const RegularExpression& regex, bool append, uint32_t max_matches, Type::Encoding encoding, const char *udt_name, TypeList& types)
-//{
-// Timer scoped_timer(__PRETTY_FUNCTION__);
-// SymbolVendor *symbols = GetSymbolVendor ();
-// if (symbols)
-// return symbols->FindTypes(sc, regex, append, max_matches, encoding, udt_name, types);
-// return 0;
-//
-//}
-
SymbolVendor*
Module::GetSymbolVendor (bool can_create, lldb_private::Stream *feedback_strm)
{
}
Module*
-ModuleList::GetModulePointerAtIndex (uint32_t idx) const
+ModuleList::GetModulePointerAtIndex (size_t idx) const
{
Mutex::Locker locker(m_modules_mutex);
return GetModulePointerAtIndexUnlocked(idx);
}
Module*
-ModuleList::GetModulePointerAtIndexUnlocked (uint32_t idx) const
+ModuleList::GetModulePointerAtIndexUnlocked (size_t idx) const
{
if (idx < m_modules.size())
return m_modules[idx].get();
}
ModuleSP
-ModuleList::GetModuleAtIndex(uint32_t idx) const
+ModuleList::GetModuleAtIndex(size_t idx) const
{
Mutex::Locker locker(m_modules_mutex);
return GetModuleAtIndexUnlocked(idx);
}
ModuleSP
-ModuleList::GetModuleAtIndexUnlocked(uint32_t idx) const
+ModuleList::GetModuleAtIndexUnlocked(size_t idx) const
{
ModuleSP module_sp;
if (idx < m_modules.size())
return module_sp;
}
-uint32_t
+size_t
ModuleList::FindFunctions (const ConstString &name,
uint32_t name_type_mask,
bool include_symbols,
return sc_list.GetSize();
}
-uint32_t
+size_t
ModuleList::FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list) const
return sc_list.GetSize();
}
-uint32_t
+size_t
ModuleList::FindGlobalVariables (const ConstString &name,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const
{
size_t initial_size = variable_list.GetSize();
}
-uint32_t
+size_t
ModuleList::FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const
{
size_t initial_size = variable_list.GetSize();
}
-uint32_t
-ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, uint32_t max_matches, TypeList& types) const
+size_t
+ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, size_t max_matches, TypeList& types) const
{
Mutex::Locker locker(m_modules_mutex);
- uint32_t total_matches = 0;
+ size_t total_matches = 0;
collection::const_iterator pos, end = m_modules.end();
if (sc.module_sp)
{
return sc_list.GetSize();
}
-uint32_t
+size_t
ModuleList::GetIndexForModule (const Module *module) const
{
if (module)
return GetSharedModuleList ().FindModules (module_spec, matching_module_list);
}
-uint32_t
+size_t
ModuleList::RemoveOrphanSharedModules (bool mandatory)
{
return GetSharedModuleList ().RemoveOrphans(mandatory);
const size_t num_matching_modules = shared_module_list.FindModules (module_spec, matching_module_list);
if (num_matching_modules > 0)
{
- for (uint32_t module_idx = 0; module_idx < num_matching_modules; ++module_idx)
+ for (size_t module_idx = 0; module_idx < num_matching_modules; ++module_idx)
{
module_sp = matching_module_list.GetModuleAtIndex(module_idx);
return NULL;
}
-uint32_t
+size_t
PluginManager::AutoCompletePlatformName (const char *name, StringList &matches)
{
if (name && name[0])
}
Error
-RegisterValue::SetValueFromData (const RegisterInfo *reg_info, DataExtractor &src, uint32_t src_offset, bool partial_data_ok)
+RegisterValue::SetValueFromData (const RegisterInfo *reg_info, DataExtractor &src, lldb::offset_t src_offset, bool partial_data_ok)
{
Error error;
Scalar::Type
Scalar::GetValueTypeForSignedIntegerWithByteSize (size_t byte_size)
{
- if (byte_size <= sizeof(int))
+ if (byte_size <= sizeof(sint_t))
return e_sint;
- if (byte_size <= sizeof(long))
+ if (byte_size <= sizeof(slong_t))
return e_slong;
- if (byte_size <= sizeof(long long))
+ if (byte_size <= sizeof(slonglong_t))
return e_slonglong;
return e_void;
}
Scalar::Type
Scalar::GetValueTypeForUnsignedIntegerWithByteSize (size_t byte_size)
{
- if (byte_size <= sizeof(unsigned int))
+ if (byte_size <= sizeof(uint_t))
return e_uint;
- if (byte_size <= sizeof(unsigned long))
+ if (byte_size <= sizeof(ulong_t))
return e_ulong;
- if (byte_size <= sizeof(unsigned long long))
+ if (byte_size <= sizeof(ulonglong_t))
return e_ulonglong;
return e_void;
}
Scalar::Type
Scalar::GetValueTypeForFloatWithByteSize (size_t byte_size)
{
- if (byte_size == sizeof(float))
+ if (byte_size == sizeof(float_t))
return e_float;
- if (byte_size == sizeof(double))
+ if (byte_size == sizeof(double_t))
return e_double;
- if (byte_size == sizeof(long double))
+ if (byte_size == sizeof(long_double_t))
return e_long_double;
return e_void;
}
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.slong; success = true; break;
- case e_uint: m_data.uint = m_data.slong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.slong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.slong; success = true; break;
case e_slong: success = true; break;
case e_ulong: m_data.ulong = m_data.slong; success = true; break;
case e_slonglong: m_data.slonglong = m_data.slong; success = true; break;
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.ulong; success = true; break;
- case e_uint: m_data.uint = m_data.ulong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.ulong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.ulong; success = true; break;
case e_slong: m_data.slong = m_data.ulong; success = true; break;
case e_ulong: success = true; break;
case e_slonglong: m_data.slonglong = m_data.ulong; success = true; break;
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.slonglong; success = true; break;
- case e_uint: m_data.uint = m_data.slonglong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.slonglong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.slonglong; success = true; break;
case e_slong: m_data.slong = m_data.slonglong; success = true; break;
case e_ulong: m_data.ulong = m_data.slonglong; success = true; break;
case e_slonglong: success = true; break;
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.ulonglong; success = true; break;
- case e_uint: m_data.uint = m_data.ulonglong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.ulonglong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.ulonglong; success = true; break;
case e_slong: m_data.slong = m_data.ulonglong; success = true; break;
case e_ulong: m_data.ulong = m_data.ulonglong; success = true; break;
case e_slonglong: m_data.slonglong = m_data.ulonglong; success = true; break;
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.flt; success = true; break;
- case e_uint: m_data.uint = m_data.flt; success = true; break;
- case e_slong: m_data.slong = m_data.flt; success = true; break;
- case e_ulong: m_data.ulong = m_data.flt; success = true; break;
- case e_slonglong: m_data.slonglong = m_data.flt; success = true; break;
- case e_ulonglong: m_data.ulonglong = m_data.flt; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.flt; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.flt; success = true; break;
+ case e_slong: m_data.slong = (slong_t)m_data.flt; success = true; break;
+ case e_ulong: m_data.ulong = (ulong_t)m_data.flt; success = true; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)m_data.flt; success = true; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)m_data.flt; success = true; break;
case e_float: success = true; break;
- case e_double: m_data.dbl = m_data.flt; success = true; break;
- case e_long_double: m_data.ldbl = m_data.flt; success = true; break;
+ case e_double: m_data.dbl = m_data.flt; success = true; break;
+ case e_long_double: m_data.ldbl = m_data.flt; success = true; break;
}
break;
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.dbl; success = true; break;
- case e_uint: m_data.uint = m_data.dbl; success = true; break;
- case e_slong: m_data.slong = m_data.dbl; success = true; break;
- case e_ulong: m_data.ulong = m_data.dbl; success = true; break;
- case e_slonglong: m_data.slonglong = m_data.dbl; success = true; break;
- case e_ulonglong: m_data.ulonglong = m_data.dbl; success = true; break;
- case e_float: m_data.flt = m_data.dbl; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.dbl; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.dbl; success = true; break;
+ case e_slong: m_data.slong = (slong_t)m_data.dbl; success = true; break;
+ case e_ulong: m_data.ulong = (ulong_t)m_data.dbl; success = true; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)m_data.dbl; success = true; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)m_data.dbl; success = true; break;
+ case e_float: m_data.flt = (float_t)m_data.dbl; success = true; break;
case e_double: success = true; break;
- case e_long_double: m_data.ldbl = m_data.dbl; success = true; break;
+ case e_long_double: m_data.ldbl = m_data.dbl; success = true; break;
}
break;
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.ldbl; success = true; break;
- case e_uint: m_data.uint = m_data.ldbl; success = true; break;
- case e_slong: m_data.slong = m_data.ldbl; success = true; break;
- case e_ulong: m_data.ulong = m_data.ldbl; success = true; break;
- case e_slonglong: m_data.slonglong = m_data.ldbl; success = true; break;
- case e_ulonglong: m_data.ulonglong = m_data.ldbl; success = true; break;
- case e_float: m_data.flt = m_data.ldbl; success = true; break;
- case e_double: m_data.dbl = m_data.ldbl; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.ldbl; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.ldbl; success = true; break;
+ case e_slong: m_data.slong = (slong_t)m_data.ldbl; success = true; break;
+ case e_ulong: m_data.ulong = (ulong_t)m_data.ldbl; success = true; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)m_data.ldbl; success = true; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)m_data.ldbl; success = true; break;
+ case e_float: m_data.flt = (float_t)m_data.ldbl; success = true; break;
+ case e_double: m_data.dbl = (double_t)m_data.ldbl; success = true; break;
case e_long_double: success = true; break;
}
break;
return m_data.ulonglong;
case e_float:
- if (sizeof(m_data.flt) == sizeof(int))
+ if (sizeof(m_data.flt) == sizeof(m_data.uint))
return m_data.uint;
- else if (sizeof(m_data.flt) == sizeof(unsigned long))
+ else if (sizeof(m_data.flt) == sizeof(m_data.ulong))
return m_data.ulong;
- else if (sizeof(m_data.flt) == sizeof(unsigned long long))
+ else if (sizeof(m_data.flt) == sizeof(m_data.ulonglong))
return m_data.ulonglong;
break;
case e_double:
- if (sizeof(m_data.dbl) == sizeof(int))
+ if (sizeof(m_data.dbl) == sizeof(m_data.uint))
return m_data.uint;
- else if (sizeof(m_data.dbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.dbl) == sizeof(m_data.ulong))
return m_data.ulong;
- else if (sizeof(m_data.dbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.dbl) == sizeof(m_data.ulonglong))
return m_data.ulonglong;
break;
case e_long_double:
- if (sizeof(m_data.ldbl) == sizeof(int))
+ if (sizeof(m_data.ldbl) == sizeof(m_data.uint))
return m_data.uint;
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.ldbl) == sizeof(m_data.ulong))
return m_data.ulong;
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.ldbl) == sizeof(m_data.ulonglong))
return m_data.ulonglong;
break;
}
Error
-Scalar::SetValueFromCString (const char *value_str, Encoding encoding, uint32_t byte_size)
+Scalar::SetValueFromCString (const char *value_str, Encoding encoding, size_t byte_size)
{
Error error;
if (value_str == NULL || value_str[0] == '\0')
if (!success)
error.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string value", value_str);
else if (!UIntValueIsValidForSize (uval64, byte_size))
- error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte unsigned integer value", uval64, byte_size);
+ error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %zu byte unsigned integer value", uval64, byte_size);
else
{
m_type = Scalar::GetValueTypeForUnsignedIntegerWithByteSize (byte_size);
switch (m_type)
{
- case e_uint: m_data.uint = uval64; break;
- case e_ulong: m_data.ulong = uval64; break;
- case e_ulonglong: m_data.ulonglong = uval64; break;
+ case e_uint: m_data.uint = (uint_t)uval64; break;
+ case e_ulong: m_data.ulong = (ulong_t)uval64; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)uval64; break;
default:
- error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %zu", byte_size);
break;
}
}
}
else
{
- error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %zu", byte_size);
return error;
}
break;
if (!success)
error.SetErrorStringWithFormat ("'%s' is not a valid signed integer string value", value_str);
else if (!SIntValueIsValidForSize (sval64, byte_size))
- error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte signed integer value", sval64, byte_size);
+ error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %zu byte signed integer value", sval64, byte_size);
else
{
m_type = Scalar::GetValueTypeForSignedIntegerWithByteSize (byte_size);
switch (m_type)
{
- case e_sint: m_data.sint = sval64; break;
- case e_slong: m_data.slong = sval64; break;
- case e_slonglong: m_data.slonglong = sval64; break;
+ case e_sint: m_data.sint = (sint_t)sval64; break;
+ case e_slong: m_data.slong = (slong_t)sval64; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)sval64; break;
default:
- error.SetErrorStringWithFormat ("unsupported signed integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported signed integer byte size: %zu", byte_size);
break;
}
}
}
else
{
- error.SetErrorStringWithFormat ("unsupported signed integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported signed integer byte size: %zu", byte_size);
return error;
}
break;
}
else
{
- error.SetErrorStringWithFormat ("unsupported float byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported float byte size: %zu", byte_size);
return error;
}
break;
return false;
}
-uint32_t
+size_t
Scalar::GetAsMemoryData (void *dst,
- uint32_t dst_len,
+ size_t dst_len,
lldb::ByteOrder dst_byte_order,
Error &error) const
{
const size_t src_len = data.GetByteSize();
// Prepare a memory buffer that contains some or all of the register value
- const uint32_t bytes_copied = data.CopyByteOrderedData (0, // src offset
+ const size_t bytes_copied = data.CopyByteOrderedData (0, // src offset
src_len, // src length
dst, // dst buffer
dst_len, // dst length
break;
case e_float:
- if (sizeof(m_data.flt) == sizeof(int))
- m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
- else if (sizeof(m_data.flt) == sizeof(unsigned long))
- m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
- else if (sizeof(m_data.flt) == sizeof(unsigned long long))
- m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
+ if (sizeof(m_data.flt) == sizeof(sint_t))
+ m_data.sint = (sint_t)SignedBits (m_data.sint, msbit, lsbit);
+ else if (sizeof(m_data.flt) == sizeof(ulong_t))
+ m_data.slong = (slong_t)SignedBits (m_data.slong, msbit, lsbit);
+ else if (sizeof(m_data.flt) == sizeof(ulonglong_t))
+ m_data.slonglong = (slonglong_t)SignedBits (m_data.slonglong, msbit, lsbit);
else
return false;
return true;
case e_double:
- if (sizeof(m_data.dbl) == sizeof(int))
+ if (sizeof(m_data.dbl) == sizeof(sint_t))
m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
- else if (sizeof(m_data.dbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.dbl) == sizeof(ulong_t))
m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
- else if (sizeof(m_data.dbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.dbl) == sizeof(ulonglong_t))
m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
else
return false;
return true;
case e_long_double:
- if (sizeof(m_data.ldbl) == sizeof(int))
+ if (sizeof(m_data.ldbl) == sizeof(sint_t))
m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.ldbl) == sizeof(ulong_t))
m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.ldbl) == sizeof(ulonglong_t))
m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
else
return false;
return true;
case Scalar::e_sint:
- m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
+ m_data.sint = (sint_t)SignedBits (m_data.sint, msbit, lsbit);
return true;
case Scalar::e_uint:
- m_data.uint = UnsignedBits (m_data.uint, msbit, lsbit);
+ m_data.uint = (uint_t)UnsignedBits (m_data.uint, msbit, lsbit);
return true;
case Scalar::e_slong:
- m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
+ m_data.slong = (slong_t)SignedBits (m_data.slong, msbit, lsbit);
return true;
case Scalar::e_ulong:
- m_data.ulong = UnsignedBits (m_data.ulong, msbit, lsbit);
+ m_data.ulong = (ulong_t)UnsignedBits (m_data.ulong, msbit, lsbit);
return true;
case Scalar::e_slonglong:
- m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
+ m_data.slonglong = (slonglong_t)SignedBits (m_data.slonglong, msbit, lsbit);
return true;
case Scalar::e_ulonglong:
- m_data.ulonglong = UnsignedBits (m_data.ulonglong, msbit, lsbit);
+ m_data.ulonglong = (ulonglong_t)UnsignedBits (m_data.ulonglong, msbit, lsbit);
return true;
}
return false;
Searcher::CallbackReturn shouldContinue;
if (context.comp_unit == NULL)
{
- uint32_t num_comp_units = module_sp->GetNumCompileUnits();
- for (uint32_t i = 0; i < num_comp_units; i++)
+ const size_t num_comp_units = module_sp->GetNumCompileUnits();
+ for (size_t i = 0; i < num_comp_units; i++)
{
CompUnitSP cu_sp (module_sp->GetCompileUnitAtIndex (i));
if (cu_sp)
void
SearchFilterByModuleList::GetDescription (Stream *s)
{
- uint32_t num_modules = m_module_spec_list.GetSize();
+ size_t num_modules = m_module_spec_list.GetSize();
if (num_modules == 1)
{
s->Printf (", module = ");
}
else
{
- s->Printf (", modules(%u) = ", num_modules);
- for (uint32_t i = 0; i < num_modules; i++)
+ s->Printf (", modules(%zu) = ", num_modules);
+ for (size_t i = 0; i < num_modules; i++)
{
if (s->GetVerbose())
{
void
SearchFilterByModuleListAndCU::GetDescription (Stream *s)
{
- uint32_t num_modules = m_module_spec_list.GetSize();
+ size_t num_modules = m_module_spec_list.GetSize();
if (num_modules == 1)
{
s->Printf (", module = ");
}
else if (num_modules > 0)
{
- s->Printf (", modules(%d) = ", num_modules);
- for (uint32_t i = 0; i < num_modules; i++)
+ s->Printf (", modules(%zd) = ", num_modules);
+ for (size_t i = 0; i < num_modules; i++)
{
if (s->GetVerbose())
{
bool
Section::ResolveContainedAddress (addr_t offset, Address &so_addr) const
{
- const uint32_t num_children = m_children.GetSize();
+ const size_t num_children = m_children.GetSize();
if (num_children > 0)
{
- for (uint32_t i=0; i<num_children; i++)
+ for (size_t i=0; i<num_children; i++)
{
Section* child_section = m_children.GetSectionAtIndex (i).get();
{
}
-uint32_t
+size_t
SectionList::AddSection (const lldb::SectionSP& section_sp)
{
assert (section_sp.get());
- uint32_t section_index = m_sections.size();
+ size_t section_index = m_sections.size();
m_sections.push_back(section_sp);
InvalidateRangeCache();
return section_index;
}
-uint32_t
+size_t
SectionList::FindSectionIndex (const Section* sect)
{
iterator sect_iter;
return UINT32_MAX;
}
-uint32_t
+size_t
SectionList::AddUniqueSection (const lldb::SectionSP& sect_sp)
{
- uint32_t sect_idx = FindSectionIndex (sect_sp.get());
+ size_t sect_idx = FindSectionIndex (sect_sp.get());
if (sect_idx == UINT32_MAX)
sect_idx = AddSection (sect_sp);
return sect_idx;
}
SectionSP
-SectionList::GetSectionAtIndex (uint32_t idx) const
+SectionList::GetSectionAtIndex (size_t idx) const
{
SectionSP sect_sp;
if (idx < m_sections.size())
SectionSP
-SectionList::FindSectionByType (SectionType sect_type, bool check_children, uint32_t start_idx) const
+SectionList::FindSectionByType (SectionType sect_type, bool check_children, size_t start_idx) const
{
SectionSP sect_sp;
- uint32_t num_sections = m_sections.size();
- for (uint32_t idx = start_idx; idx < num_sections; ++idx)
+ size_t num_sections = m_sections.size();
+ for (size_t idx = start_idx; idx < num_sections; ++idx)
{
if (m_sections[idx]->GetType() == sect_type)
{
if (executable_ptr)
{
SymbolContextList sc_list;
- uint32_t num_matches;
ConstString main_name("main");
bool symbols_okay = false; // Force it to be a debug symbol.
bool inlines_okay = true;
bool append = false;
- num_matches = executable_ptr->FindFunctions (main_name, NULL, lldb::eFunctionNameTypeBase, inlines_okay, symbols_okay, append, sc_list);
- for (uint32_t idx = 0; idx < num_matches; idx++)
+ size_t num_matches = executable_ptr->FindFunctions (main_name,
+ NULL,
+ lldb::eFunctionNameTypeBase,
+ inlines_okay,
+ symbols_okay,
+ append,
+ sc_list);
+ for (size_t idx = 0; idx < num_matches; idx++)
{
SymbolContext sc;
sc_list.GetContextAtIndex(idx, sc);
else
{
// Some lines have been populated, start where we last left off
- assert(!"Not implemented yet");
+ assert("Not implemented yet" == NULL);
}
}
else
{
// Calculate all line offsets up to "line"
- assert(!"Not implemented yet");
+ assert("Not implemented yet" == NULL);
}
return false;
}
if (!LineIsValid(line_no))
return false;
- uint32_t start_offset = GetLineOffset (line_no);
- uint32_t end_offset = GetLineOffset (line_no + 1);
+ size_t start_offset = GetLineOffset (line_no);
+ size_t end_offset = GetLineOffset (line_no + 1);
if (end_offset == UINT32_MAX)
{
end_offset = m_data_sp->GetByteSize();
// Put an SLEB128 "uval" out to the stream using the printf format
// in "format".
//------------------------------------------------------------------
-int
+size_t
Stream::PutSLEB128 (int64_t sval)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (m_flags.Test(eBinary))
{
bool more = true;
// Put an ULEB128 "uval" out to the stream using the printf format
// in "format".
//------------------------------------------------------------------
-int
+size_t
Stream::PutULEB128 (uint64_t uval)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (m_flags.Test(eBinary))
{
do
//------------------------------------------------------------------
// Print a raw NULL terminated C string to the stream.
//------------------------------------------------------------------
-int
+size_t
Stream::PutCString (const char *cstr)
{
- int cstr_len = strlen(cstr);
+ size_t cstr_len = strlen(cstr);
// when in binary mode, emit the NULL terminator
if (m_flags.Test(eBinary))
++cstr_len;
// and suffix strings.
//------------------------------------------------------------------
void
-Stream::Address (uint64_t addr, int addr_size, const char *prefix, const char *suffix)
+Stream::Address (uint64_t addr, uint32_t addr_size, const char *prefix, const char *suffix)
{
if (prefix == NULL)
prefix = "";
// and suffix strings.
//------------------------------------------------------------------
void
-Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, int addr_size, const char *prefix, const char *suffix)
+Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, const char *prefix, const char *suffix)
{
if (prefix && prefix[0])
PutCString (prefix);
}
-int
+size_t
Stream::PutChar (char ch)
{
return Write (&ch, 1);
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
Stream::Printf (const char *format, ...)
{
va_list args;
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
Stream::PrintfVarArg (const char *format, va_list args)
{
char str[1024];
va_copy (args_copy, args);
- int bytes_written = 0;
+ size_t bytes_written = 0;
// Try and format our string into a fixed buffer first and see if it fits
size_t length = ::vsnprintf (str, sizeof(str), format, args);
if (length < sizeof(str))
//------------------------------------------------------------------
// Print and End of Line character to the stream
//------------------------------------------------------------------
-int
+size_t
Stream::EOL()
{
return PutChar ('\n');
// Indent the current line using the current indentation level and
// print an optional string following the idenatation spaces.
//------------------------------------------------------------------
-int
+size_t
Stream::Indent(const char *s)
{
return Printf ("%*.*s%s", m_indent_level, m_indent_level, "", s ? s : "");
//------------------------------------------------------------------
// Get the address size in bytes
//------------------------------------------------------------------
-uint8_t
+uint32_t
Stream::GetAddressByteSize() const
{
return m_addr_size;
// Set the address size in bytes
//------------------------------------------------------------------
void
-Stream::SetAddressByteSize(uint8_t addr_size)
+Stream::SetAddressByteSize(uint32_t addr_size)
{
m_addr_size = addr_size;
}
return m_byte_order;
}
-int
+size_t
Stream::PrintfAsRawHex8 (const char *format, ...)
{
va_list args;
va_copy (args, args_copy); // Copy this so we
char str[1024];
- int bytes_written = 0;
+ size_t bytes_written = 0;
// Try and format our string into a fixed buffer first and see if it fits
size_t length = ::vsnprintf (str, sizeof(str), format, args);
if (length < sizeof(str))
return bytes_written;
}
-int
+size_t
Stream::PutNHex8 (size_t n, uint8_t uvalue)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
for (size_t i=0; i<n; ++i)
bytes_written += _PutHex8 (uvalue, m_flags.Test(eAddPrefix));
return bytes_written;
}
-int
+size_t
Stream::_PutHex8 (uint8_t uvalue, bool add_prefix)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (m_flags.Test(eBinary))
{
bytes_written = Write (&uvalue, 1);
return bytes_written;
}
-int
+size_t
Stream::PutHex8 (uint8_t uvalue)
{
return _PutHex8 (uvalue, m_flags.Test(eAddPrefix));
}
-int
+size_t
Stream::PutHex16 (uint16_t uvalue, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
byte_order = m_byte_order;
bool add_prefix = m_flags.Test(eAddPrefix);
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (byte_order == eByteOrderLittle)
{
for (size_t byte = 0; byte < sizeof(uvalue); ++byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
else
{
for (size_t byte = sizeof(uvalue)-1; byte < sizeof(uvalue); --byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
return bytes_written;
}
-int
+size_t
Stream::PutHex32(uint32_t uvalue, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
byte_order = m_byte_order;
bool add_prefix = m_flags.Test(eAddPrefix);
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (byte_order == eByteOrderLittle)
{
for (size_t byte = 0; byte < sizeof(uvalue); ++byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
else
{
for (size_t byte = sizeof(uvalue)-1; byte < sizeof(uvalue); --byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
return bytes_written;
}
-int
+size_t
Stream::PutHex64(uint64_t uvalue, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
byte_order = m_byte_order;
bool add_prefix = m_flags.Test(eAddPrefix);
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (byte_order == eByteOrderLittle)
{
for (size_t byte = 0; byte < sizeof(uvalue); ++byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
else
{
for (size_t byte = sizeof(uvalue)-1; byte < sizeof(uvalue); --byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
return bytes_written;
}
-int
+size_t
Stream::PutMaxHex64
(
uint64_t uvalue,
{
switch (byte_size)
{
- case 1: return PutHex8 (uvalue);
- case 2: return PutHex16 (uvalue);
- case 4: return PutHex32 (uvalue);
+ case 1: return PutHex8 ((uint8_t)uvalue);
+ case 2: return PutHex16 ((uint16_t)uvalue);
+ case 4: return PutHex32 ((uint32_t)uvalue);
case 8: return PutHex64 (uvalue);
}
return 0;
}
-int
+size_t
Stream::PutPointer (void *ptr)
{
return PutRawBytes (&ptr, sizeof(ptr), lldb::endian::InlHostByteOrder(), lldb::endian::InlHostByteOrder());
}
-int
+size_t
Stream::PutFloat(float f, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
return PutRawBytes (&f, sizeof(f), lldb::endian::InlHostByteOrder(), byte_order);
}
-int
+size_t
Stream::PutDouble(double d, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
return PutRawBytes (&d, sizeof(d), lldb::endian::InlHostByteOrder(), byte_order);
}
-int
+size_t
Stream::PutLongDouble(long double ld, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
return PutRawBytes (&ld, sizeof(ld), lldb::endian::InlHostByteOrder(), byte_order);
}
-int
+size_t
Stream::PutRawBytes (const void *s, size_t src_len, ByteOrder src_byte_order, ByteOrder dst_byte_order)
{
if (src_byte_order == eByteOrderInvalid)
if (dst_byte_order == eByteOrderInvalid)
dst_byte_order = m_byte_order;
- int bytes_written = 0;
+ size_t bytes_written = 0;
const uint8_t *src = (const uint8_t *)s;
bool binary_was_set = m_flags.Test (eBinary);
if (!binary_was_set)
return bytes_written;
}
-int
+size_t
Stream::PutBytesAsRawHex8 (const void *s, size_t src_len, ByteOrder src_byte_order, ByteOrder dst_byte_order)
{
if (src_byte_order == eByteOrderInvalid)
if (dst_byte_order == eByteOrderInvalid)
dst_byte_order = m_byte_order;
- int bytes_written = 0;
+ size_t bytes_written = 0;
const uint8_t *src = (const uint8_t *)s;
bool binary_is_set = m_flags.Test(eBinary);
m_flags.Clear(eBinary);
return bytes_written;
}
-int
+size_t
Stream::PutCStringAsRawHex8 (const char *s)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
bool binary_is_set = m_flags.Test(eBinary);
m_flags.Clear(eBinary);
do
}
}
-int
+size_t
StreamAsynchronousIO::Write (const void *s, size_t length)
{
m_accumulated_data.Write (s, length);
out_stream.Clear();
}
-int
+size_t
StreamCallback::Write (const void *s, size_t length)
{
lldb::tid_t cur_tid = Host::GetCurrentThreadID();
m_file.Flush();
}
-int
+size_t
StreamFile::Write (const void *s, size_t length)
{
m_file.Write (s, length);
// Nothing to do when flushing a buffer based stream...
}
-int
+size_t
StreamString::Write (const void *s, size_t length)
{
m_packet.append ((char *)s, length);
void
StringList::AppendList (StringList strings)
{
- uint32_t len = strings.GetSize();
+ size_t len = strings.GetSize();
- for (uint32_t i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
m_strings.push_back (strings.GetStringAtIndex(i));
}
return input_file.ReadFileLines (m_strings);
}
-uint32_t
+size_t
StringList::GetSize () const
{
return m_strings.size();
void
StringList::Join (const char *separator, Stream &strm)
{
- uint32_t size = GetSize();
+ size_t size = GetSize();
if (size == 0)
return;
StringList::LongestCommonPrefix (std::string &common_prefix)
{
//arg_sstr_collection::iterator pos, end = m_args.end();
- int pos = 0;
- int end = m_strings.size();
+ size_t pos = 0;
+ size_t end = m_strings.size();
if (pos == end)
common_prefix.clear();
while (isspace(*p))
++p;
- const uint32_t uuid_byte_idx = UUID::DecodeUUIDBytesFromCString (p, m_uuid, &p);
+ const size_t uuid_byte_idx = UUID::DecodeUUIDBytesFromCString (p, m_uuid, &p);
// If we successfully decoded a UUID, return the amount of characters that
// were consumed
return false;
}
-uint32_t
+size_t
VMRange::FindRangeIndexThatContainsValue (const VMRange::collection& coll, lldb::addr_t value)
{
ValueInRangeUnaryPredicate in_range_predicate(value);
}
void
-Value::ResizeData(int len)
+Value::ResizeData(size_t len)
{
m_value_type = eValueTypeHostAddress;
m_data_buffer.SetByteSize(len);
}
// If we got here, we need to read the value from memory
- uint32_t byte_size = GetValueByteSize (ast_context, &error);
+ size_t byte_size = GetValueByteSize (ast_context, &error);
// Bail if we encountered any errors getting the byte size
if (error.Fail())
}
ValueObjectSP
-ValueObject::GetChildAtIndex (uint32_t idx, bool can_create)
+ValueObject::GetChildAtIndex (size_t idx, bool can_create)
{
ValueObjectSP child_sp;
// We may need to update our value if we are dynamic
}
ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::initializer_list<uint32_t>& idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::initializer_list<size_t>& idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (uint32_t idx : idxs)
+ for (size_t idx : idxs)
{
root = root->GetChildAtIndex(idx, true);
if (!root)
}
ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::initializer_list< std::pair<uint32_t, bool> >& idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::initializer_list< std::pair<size_t, bool> >& idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (std::pair<uint32_t, bool> idx : idxs)
+ for (std::pair<size_t, bool> idx : idxs)
{
root = root->GetChildAtIndex(idx.first, idx.second);
if (!root)
}
lldb::ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::vector<uint32_t> &idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::vector<size_t> &idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (uint32_t idx : idxs)
+ for (size_t idx : idxs)
{
root = root->GetChildAtIndex(idx, true);
if (!root)
}
lldb::ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::vector< std::pair<uint32_t, bool> > &idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::vector< std::pair<size_t, bool> > &idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (std::pair<uint32_t, bool> idx : idxs)
+ for (std::pair<size_t, bool> idx : idxs)
{
root = root->GetChildAtIndex(idx.first, idx.second);
if (!root)
return root;
}
-uint32_t
+size_t
ValueObject::GetIndexOfChildWithName (const ConstString &name)
{
bool omit_empty_base_classes = true;
}
-uint32_t
+size_t
ValueObject::GetNumChildren ()
{
UpdateValueIfNeeded();
// Should only be called by ValueObject::GetNumChildren()
void
-ValueObject::SetNumChildren (uint32_t num_children)
+ValueObject::SetNumChildren (size_t num_children)
{
m_children_count_valid = true;
m_children.SetChildrenCount(num_children);
}
ValueObject *
-ValueObject::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObject::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
ValueObject *valobj = NULL;
if ((custom_format == eFormatBytes) ||
(custom_format == eFormatBytesWithASCII))
{
- uint32_t count = GetNumChildren();
+ const size_t count = GetNumChildren();
s << '[';
- for (uint32_t low = 0; low < count; low++)
+ for (size_t low = 0; low < count; low++)
{
if (low)
(custom_format == eFormatVectorOfUInt64) ||
(custom_format == eFormatVectorOfUInt8)) // arrays of bytes, bytes with ASCII or any vector format should be printed directly
{
- uint32_t count = GetNumChildren();
+ const size_t count = GetNumChildren();
Format format = FormatManager::GetSingleItemFormat(custom_format);
s << '[';
- for (uint32_t low = 0; low < count; low++)
+ for (size_t low = 0; low < count; low++)
{
if (low)
bool var_success = false;
{
- const char * return_value;
- std::string alloc_mem;
+ const char *cstr = NULL;
+ StreamString strm;
if (custom_format != eFormatInvalid)
SetFormat(custom_format);
switch(val_obj_display)
{
case eValueObjectRepresentationStyleValue:
- return_value = GetValueAsCString();
+ cstr = GetValueAsCString();
break;
case eValueObjectRepresentationStyleSummary:
- return_value = GetSummaryAsCString();
+ cstr = GetSummaryAsCString();
break;
case eValueObjectRepresentationStyleLanguageSpecific:
- return_value = GetObjectDescription();
+ cstr = GetObjectDescription();
break;
case eValueObjectRepresentationStyleLocation:
- return_value = GetLocationAsCString();
+ cstr = GetLocationAsCString();
break;
case eValueObjectRepresentationStyleChildrenCount:
- {
- alloc_mem.resize(512);
- return_value = &alloc_mem[0];
- int count = GetNumChildren();
- snprintf((char*)return_value, 512, "%d", count);
- }
+ strm.Printf("%zu", GetNumChildren());
+ cstr = strm.GetString().c_str();
break;
case eValueObjectRepresentationStyleType:
- return_value = GetTypeName().AsCString();
+ cstr = GetTypeName().AsCString();
break;
}
- if (!return_value)
+ if (!cstr)
{
if (val_obj_display == eValueObjectRepresentationStyleValue)
- return_value = GetSummaryAsCString();
+ cstr = GetSummaryAsCString();
else if (val_obj_display == eValueObjectRepresentationStyleSummary)
{
if (ClangASTContext::IsAggregateType (GetClangType()) == true)
{
- // this thing has no value, and it seems to have no summary
- // some combination of unitialized data and other factors can also
- // raise this condition, so let's print a nice generic description
- {
- alloc_mem.resize(684);
- return_value = &alloc_mem[0];
- snprintf((char*)return_value, 684, "%s @ %s", GetTypeName().AsCString(), GetLocationAsCString());
- }
+ strm.Printf("%s @ %s", GetTypeName().AsCString(), GetLocationAsCString());
+ cstr = strm.GetString().c_str();
}
else
- return_value = GetValueAsCString();
+ cstr = GetValueAsCString();
}
}
- if (return_value)
- s.PutCString(return_value);
+ if (cstr)
+ s.PutCString(cstr);
else
{
if (m_error.Fail())
case Value::eValueTypeLoadAddress:
case Value::eValueTypeFileAddress:
{
- uint32_t data_offset = 0;
+ lldb::offset_t data_offset = 0;
address = m_data.GetPointer(&data_offset);
}
break;
}
ValueObjectSP
-ValueObject::GetSyntheticArrayMember (int32_t index, bool can_create)
+ValueObject::GetSyntheticArrayMember (size_t index, bool can_create)
{
if (IsArrayType())
return GetSyntheticArrayMemberFromArray(index, can_create);
}
ValueObjectSP
-ValueObject::GetSyntheticArrayMemberFromPointer (int32_t index, bool can_create)
+ValueObject::GetSyntheticArrayMemberFromPointer (size_t index, bool can_create)
{
ValueObjectSP synthetic_child_sp;
if (IsPointerType ())
{
char index_str[64];
- snprintf(index_str, sizeof(index_str), "[%i]", index);
+ snprintf(index_str, sizeof(index_str), "[%zu]", index);
ConstString index_const_str(index_str);
// Check if we have already created a synthetic array member in this
// valid object. If we have we will re-use it.
// there are more items in "item_array".
ValueObjectSP
-ValueObject::GetSyntheticArrayMemberFromArray (int32_t index, bool can_create)
+ValueObject::GetSyntheticArrayMemberFromArray (size_t index, bool can_create)
{
ValueObjectSP synthetic_child_sp;
if (IsArrayType ())
{
char index_str[64];
- snprintf(index_str, sizeof(index_str), "[%i]", index);
+ snprintf(index_str, sizeof(index_str), "[%zu]", index);
ConstString index_const_str(index_str);
// Check if we have already created a synthetic array member in this
// valid object. If we have we will re-use it.
}
else // expand this into list
{
- int max_index = root->GetNumChildren() - 1;
- for (int index = 0; index < max_index; index++)
+ const size_t max_index = root->GetNumChildren() - 1;
+ for (size_t index = 0; index < max_index; index++)
{
ValueObjectSP child =
root->GetChildAtIndex(index, true);
{
if (root_clang_type_info.Test(ClangASTContext::eTypeIsArray))
{
- int max_index = root->GetNumChildren() - 1;
- for (int index = 0; index < max_index; index++)
+ const size_t max_index = root->GetNumChildren() - 1;
+ for (size_t index = 0; index < max_index; index++)
{
ValueObjectSP child =
root->GetChildAtIndex(index, true);
ValueObjectSP synth_valobj_sp = valobj->GetSyntheticValue (options.m_use_synthetic);
synth_valobj = (synth_valobj_sp ? synth_valobj_sp.get() : valobj);
- uint32_t num_children = synth_valobj->GetNumChildren();
+ size_t num_children = synth_valobj->GetNumChildren();
bool print_dotdotdot = false;
if (num_children)
{
s.IndentMore();
}
- uint32_t max_num_children = valobj->GetTargetSP()->GetMaximumNumberOfChildrenToDisplay();
+ const size_t max_num_children = valobj->GetTargetSP()->GetMaximumNumberOfChildrenToDisplay();
if (num_children > max_num_children && !options.m_ignore_cap)
{
child_options.SetFormat(options.m_format).SetSummary().SetRootValueObjectName();
child_options.SetScopeChecked(true)
.SetOmitSummaryDepth(child_options.m_omit_summary_depth > 1 ? child_options.m_omit_summary_depth - 1 : 0);
- for (uint32_t idx=0; idx<num_children; ++idx)
+ for (size_t idx=0; idx<num_children; ++idx)
{
ValueObjectSP child_sp(synth_valobj->GetChildAtIndex(idx, true));
if (child_sp.get())
return m_cast_type.GetOpaqueQualType();
}
-uint32_t
+size_t
ValueObjectCast::CalculateNumChildren()
{
return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
return m_parent->GetValueType();
}
-uint32_t
+size_t
ValueObjectChild::CalculateNumChildren()
{
return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
const ConstString &name,
const lldb::DataBufferSP &data_sp,
lldb::ByteOrder data_byte_order,
- uint8_t data_addr_size,
+ uint32_t data_addr_size,
lldb::addr_t address
)
{
const ConstString &name,
const lldb::DataBufferSP &data_sp,
lldb::ByteOrder data_byte_order,
- uint8_t data_addr_size,
+ uint32_t data_addr_size,
lldb::addr_t address
) :
ValueObject (exe_scope),
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size
+ uint32_t addr_byte_size
)
{
return (new ValueObjectConstResult (exe_scope,
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size
+ uint32_t addr_byte_size
) :
ValueObject (exe_scope),
m_clang_ast (clang_ast),
m_byte_size = size;
}
-uint32_t
+size_t
ValueObjectConstResult::CalculateNumChildren()
{
return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
}
ValueObject *
-ValueObjectConstResult::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectConstResult::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
return m_impl.CreateChildAtIndex(idx, synthetic_array_member, synthetic_index);
}
}
ValueObject *
-ValueObjectConstResultChild::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectConstResultChild::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
return m_impl.CreateChildAtIndex(idx, synthetic_array_member, synthetic_index);
}
}
ValueObject *
-ValueObjectConstResultImpl::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectConstResultImpl::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
if (m_impl_backend == NULL)
return NULL;
return m_parent->GetTypeName();
}
-uint32_t
+size_t
ValueObjectDynamicValue::CalculateNumChildren()
{
const bool success = UpdateValueIfNeeded(false);
}
-uint32_t
+size_t
ValueObjectList::GetSize() const
{
return m_value_objects.size();
}
void
-ValueObjectList::Resize (uint32_t size)
+ValueObjectList::Resize (size_t size)
{
m_value_objects.resize (size);
}
lldb::ValueObjectSP
-ValueObjectList::GetValueObjectAtIndex (uint32_t idx)
+ValueObjectList::GetValueObjectAtIndex (size_t idx)
{
lldb::ValueObjectSP valobj_sp;
if (idx < m_value_objects.size())
}
lldb::ValueObjectSP
-ValueObjectList::RemoveValueObjectAtIndex (uint32_t idx)
+ValueObjectList::RemoveValueObjectAtIndex (size_t idx)
{
lldb::ValueObjectSP valobj_sp;
if (idx < m_value_objects.size())
}
void
-ValueObjectList::SetValueObjectAtIndex (uint32_t idx, const ValueObjectSP &valobj_sp)
+ValueObjectList::SetValueObjectAtIndex (size_t idx, const ValueObjectSP &valobj_sp)
{
if (idx >= m_value_objects.size())
m_value_objects.resize (idx + 1);
return ClangASTType::GetConstTypeName (GetClangAST(), m_clang_type.GetOpaqueQualType());
}
-uint32_t
+size_t
ValueObjectMemory::CalculateNumChildren()
{
if (m_type_sp)
return ConstString();
}
-uint32_t
+size_t
ValueObjectRegisterContext::CalculateNumChildren()
{
return m_reg_ctx_sp->GetRegisterSetCount();
}
ValueObject *
-ValueObjectRegisterContext::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectRegisterContext::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
ValueObject *new_valobj = NULL;
- const uint32_t num_children = GetNumChildren();
+ const size_t num_children = GetNumChildren();
if (idx < num_children)
{
ExecutionContext exe_ctx(GetExecutionContextRef());
return ConstString();
}
-uint32_t
+size_t
ValueObjectRegisterSet::CalculateNumChildren()
{
const RegisterSet *reg_set = m_reg_ctx_sp->GetRegisterSet(m_reg_set_idx);
ValueObject *
-ValueObjectRegisterSet::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectRegisterSet::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
ValueObject *valobj = NULL;
if (m_reg_ctx_sp && m_reg_set)
{
- const uint32_t num_children = GetNumChildren();
+ const size_t num_children = GetNumChildren();
if (idx < num_children)
valobj = new ValueObjectRegister(*this, m_reg_ctx_sp, m_reg_set->registers[idx]);
}
return ValueObjectSP();
}
-uint32_t
+size_t
ValueObjectRegisterSet::GetIndexOfChildWithName (const ConstString &name)
{
if (m_reg_ctx_sp && m_reg_set)
return m_type_name;
}
-uint32_t
+size_t
ValueObjectRegister::CalculateNumChildren()
{
return 0;
SyntheticChildrenFrontEnd(backend)
{}
- uint32_t
+ size_t
CalculateNumChildren()
{
return 0;
}
lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
return lldb::ValueObjectSP();
}
return m_parent->GetTypeName();
}
-uint32_t
+size_t
ValueObjectSynthetic::CalculateNumChildren()
{
UpdateValueIfNeeded();
}
lldb::ValueObjectSP
-ValueObjectSynthetic::GetChildAtIndex (uint32_t idx, bool can_create)
+ValueObjectSynthetic::GetChildAtIndex (size_t idx, bool can_create)
{
UpdateValueIfNeeded();
return GetChildAtIndex(index, can_create);
}
-uint32_t
+size_t
ValueObjectSynthetic::GetIndexOfChildWithName (const ConstString &name)
{
UpdateValueIfNeeded();
return ConstString();
}
-uint32_t
+size_t
ValueObjectVariable::CalculateNumChildren()
{
ClangASTType type(GetClangAST(),
const ModuleList &target_images = m_target->GetImages();
Mutex::Locker modules_locker (target_images.GetMutex());
- for (uint32_t i = 0, e = target_images.GetSize();
- i != e;
- ++i)
+ for (size_t i = 0, e = target_images.GetSize(); i < e; ++i)
{
lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
ClangNamespaceDecl null_namespace_decl;
- for (uint32_t i = 0, e = target_images.GetSize();
- i != e;
- ++i)
+ for (size_t i = 0, e = target_images.GetSize(); i < e; ++i)
{
lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
InstructionList &instruction_list = disassembler->GetInstructionList();
const uint32_t max_opcode_byte_size = instruction_list.GetMaxOpcocdeByteSize();
- for (uint32_t instruction_index = 0, num_instructions = instruction_list.GetSize();
+ for (size_t instruction_index = 0, num_instructions = instruction_list.GetSize();
instruction_index < num_instructions;
++instruction_index)
{
// to pull the defined arguments out of the function, then add the types from the
// arguments list for the variable arguments.
- uint32_t num_args = UINT32_MAX;
+ size_t num_args = UINT32_MAX;
bool trust_function = false;
// GetArgumentCount returns -1 for an unprototyped function.
if (m_function_ptr)
// TODO: verify fun_addr needs to be a callable address
Scalar fun_addr (function_address.GetCallableLoadAddress(exe_ctx.GetTargetPtr()));
- int first_offset = m_member_offsets[0];
+ uint64_t first_offset = m_member_offsets[0];
process->WriteScalarToMemory(args_addr_ref + first_offset, fun_addr, process->GetAddressByteSize(), error);
// FIXME: We will need to extend this for Variadic functions.
{
// FIXME: We should sanity check sizes.
- int offset = m_member_offsets[i+1]; // Clang sizes are in bytes.
+ uint64_t offset = m_member_offsets[i+1]; // Clang sizes are in bytes.
Value *arg_value = arg_values.GetValueAtIndex(i);
// FIXME: For now just do scalars:
}
-DWARFExpression::DWARFExpression(const DataExtractor& data, uint32_t data_offset, uint32_t data_length) :
+DWARFExpression::DWARFExpression(const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length) :
m_data(data, data_offset, data_length),
m_reg_kind (eRegisterKindDWARF),
m_loclist_slide(LLDB_INVALID_ADDRESS)
}
void
-DWARFExpression::CopyOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
+DWARFExpression::CopyOpcodeData (const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length)
{
const uint8_t *bytes = data.PeekData(data_offset, data_length);
if (bytes)
}
void
-DWARFExpression::SetOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
+DWARFExpression::SetOpcodeData (const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length)
{
m_data.SetData(data, data_offset, data_length);
}
void
-DWARFExpression::DumpLocation (Stream *s, uint32_t offset, uint32_t length, lldb::DescriptionLevel level, ABI *abi) const
+DWARFExpression::DumpLocation (Stream *s, lldb::offset_t offset, lldb::offset_t length, lldb::DescriptionLevel level, ABI *abi) const
{
if (!m_data.ValidOffsetForDataOfSize(offset, length))
return;
- const uint32_t start_offset = offset;
- const uint32_t end_offset = offset + length;
+ const lldb::offset_t start_offset = offset;
+ const lldb::offset_t end_offset = offset + length;
while (m_data.ValidOffset(offset) && offset < end_offset)
{
- const uint32_t op_offset = offset;
+ const lldb::offset_t op_offset = offset;
const uint8_t op = m_data.GetU8(&offset);
switch (level)
if (level == lldb::eDescriptionLevelFull)
break;
// Fall through for verbose and print offset and DW_OP prefix..
- s->Printf("0x%8.8x: %s", op_offset, op >= DW_OP_APPLE_uninit ? "DW_OP_APPLE_" : "DW_OP_");
+ s->Printf("0x%8.8" PRIx64 ": %s", op_offset, op >= DW_OP_APPLE_uninit ? "DW_OP_APPLE_" : "DW_OP_");
break;
}
case DW_OP_regx: // 0x90 1 ULEB128 register
{
- uint64_t reg_num = m_data.GetULEB128(&offset);
+ uint32_t reg_num = m_data.GetULEB128(&offset);
if (abi)
{
RegisterInfo reg_info;
}
}
}
- s->Printf("DW_OP_regx(%" PRIu64 ")", reg_num); break;
+ s->Printf("DW_OP_regx(%" PRIu32 ")", reg_num); break;
}
break;
case DW_OP_fbreg: // 0x91 1 SLEB128 offset
}
}
}
- s->Printf("DW_OP_bregx(reg=%u,offset=%" PRIi64 ")", reg_num, reg_offset);
+ s->Printf("DW_OP_bregx(reg=%" PRIu32 ",offset=%" PRIi64 ")", reg_num, reg_offset);
}
break;
case DW_OP_piece: // 0x93 1 ULEB128 size of piece addressed
if (IsLocationList())
{
// We have a location list
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t count = 0;
addr_t curr_base_addr = location_list_base_addr;
while (m_data.ValidOffset(offset))
VMRange addr_range(curr_base_addr + begin_addr_offset, curr_base_addr + end_addr_offset);
addr_range.Dump(s, 0, 8);
s->PutChar('{');
- uint32_t location_length = m_data.GetU16(&offset);
+ lldb::offset_t location_length = m_data.GetU16(&offset);
DumpLocation (s, offset, location_length, level, abi);
s->PutChar('}');
offset += location_length;
//
// if (IsLocationList())
// {
-// uint32_t offset = 0;
+// lldb::offset_t offset = 0;
//
// addr_t loc_list_base_addr = m_loclist_slide.GetLoadAddress(process);
//
// return false;
//}
-static uint32_t
-GetOpcodeDataSize (const DataExtractor &data, const uint32_t data_offset, const uint8_t op)
+static offset_t
+GetOpcodeDataSize (const DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op)
{
- uint32_t offset = data_offset;
+ lldb::offset_t offset = data_offset;
switch (op)
{
case DW_OP_addr:
default:
break;
}
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
bool
error = false;
if (IsLocationList())
return false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (m_data.ValidOffset(offset))
{
const uint8_t op = m_data.GetU8(&offset);
}
else
{
- const uint32_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
- if (op_arg_size == UINT32_MAX)
+ const offset_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
+ if (op_arg_size == LLDB_INVALID_OFFSET)
{
error = true;
break;
{
if (IsLocationList())
return false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (m_data.ValidOffset(offset))
{
const uint8_t op = m_data.GetU8(&offset);
if (op == DW_OP_addr)
{
- const uint8_t addr_byte_size = m_data.GetAddressByteSize();
+ const uint32_t addr_byte_size = m_data.GetAddressByteSize();
// We have to make a copy of the data as we don't know if this
// data is from a read only memory mapped buffer, so we duplicate
// all of the data first, then modify it, and if all goes well,
}
else
{
- const uint32_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
- if (op_arg_size == UINT32_MAX)
+ const offset_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
+ if (op_arg_size == LLDB_INVALID_OFFSET)
break;
offset += op_arg_size;
}
if (IsLocationList())
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (loclist_base_addr == LLDB_INVALID_ADDRESS)
return false;
}
bool
-DWARFExpression::GetLocation (addr_t base_addr, addr_t pc, uint32_t &offset, uint32_t &length)
+DWARFExpression::GetLocation (addr_t base_addr, addr_t pc, lldb::offset_t &offset, lldb::offset_t &length)
{
offset = 0;
if (!IsLocationList())
}
}
}
- offset = UINT32_MAX;
+ offset = LLDB_INVALID_OFFSET;
length = 0;
return false;
}
addr_t address,
ABI *abi)
{
- uint32_t offset = 0;
- uint32_t length = 0;
+ lldb::offset_t offset = 0;
+ lldb::offset_t length = 0;
if (GetLocation (base_addr, address, offset, length))
{
{
if (IsLocationList())
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
addr_t pc;
StackFrame *frame = NULL;
if (reg_ctx)
ClangExpressionDeclMap *decl_map,
RegisterContext *reg_ctx,
const DataExtractor& opcodes,
- const uint32_t opcodes_offset,
- const uint32_t opcodes_length,
+ const lldb::offset_t opcodes_offset,
+ const lldb::offset_t opcodes_length,
const uint32_t reg_kind,
const Value* initial_value_ptr,
Value& result,
if (initial_value_ptr)
stack.push_back(*initial_value_ptr);
- uint32_t offset = opcodes_offset;
- const uint32_t end_offset = opcodes_offset + opcodes_length;
+ lldb::offset_t offset = opcodes_offset;
+ const lldb::offset_t end_offset = opcodes_offset + opcodes_length;
Value tmp;
uint32_t reg_num;
while (opcodes.ValidOffset(offset) && offset < end_offset)
{
- const uint32_t op_offset = offset;
+ const lldb::offset_t op_offset = offset;
const uint8_t op = opcodes.GetU8(&offset);
if (log && log->GetVerbose())
stack[i].Dump(&new_value);
log->Printf(" %s", new_value.GetData());
}
- log->Printf("0x%8.8x: %s", op_offset, DW_OP_value_to_name(op));
+ log->Printf("0x%8.8" PRIx64 ": %s", op_offset, DW_OP_value_to_name(op));
}
switch (op)
{
if (process->ReadMemory(pointer_addr, &addr_bytes, addr_size, error) == addr_size)
{
DataExtractor addr_data(addr_bytes, sizeof(addr_bytes), process->GetByteOrder(), addr_size);
- uint32_t addr_data_offset = 0;
+ lldb::offset_t addr_data_offset = 0;
stack.back().GetScalar() = addr_data.GetPointer(&addr_data_offset);
stack.back().ClearContext();
}
if (process->ReadMemory(pointer_addr, &addr_bytes, size, error) == size)
{
DataExtractor addr_data(addr_bytes, sizeof(addr_bytes), process->GetByteOrder(), size);
- uint32_t addr_data_offset = 0;
+ lldb::offset_t addr_data_offset = 0;
switch (size)
{
case 1: stack.back().GetScalar() = addr_data.GetU8(&addr_data_offset); break;
}
else
{
- uint32_t uconst_value = opcodes.GetULEB128(&offset);
+ const uint64_t uconst_value = opcodes.GetULEB128(&offset);
// Implicit conversion from a UINT to a Scalar...
stack.back().ResolveValue(exe_ctx, ast_context) += uconst_value;
if (!stack.back().ResolveValue(exe_ctx, ast_context).IsValid())
case DW_OP_skip:
{
int16_t skip_offset = (int16_t)opcodes.GetU16(&offset);
- uint32_t new_offset = offset + skip_offset;
+ lldb::offset_t new_offset = offset + skip_offset;
if (new_offset >= opcodes_offset && new_offset < end_offset)
offset = new_offset;
else
Scalar zero(0);
if (tmp.ResolveValue(exe_ctx, ast_context) != zero)
{
- uint32_t new_offset = offset + bra_offset;
+ lldb::offset_t new_offset = offset + bra_offset;
if (new_offset >= opcodes_offset && new_offset < end_offset)
offset = new_offset;
else
size_t value_size = m_target_data.getTypeStoreSize(value->getType());
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint64_t u64value = value_extractor->GetMaxU64(&offset, value_size);
return AssignToMatchType(scalar, u64value, value->getType());
return false;
Type *R_ty = pointer_ptr_ty->getElementType();
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
lldb::addr_t pointer = P_extractor->GetAddress(&offset);
Memory::Region R = m_memory.Lookup(pointer, R_ty);
DataExtractorSP P_extractor(memory.GetExtractor(P));
DataEncoderSP D_encoder(memory.GetEncoder(D));
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
lldb::addr_t pointer = P_extractor->GetAddress(&offset);
Memory::Region R = memory.Lookup(pointer, target_ty);
if (!P_extractor || !D_extractor)
return false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
lldb::addr_t pointer = P_extractor->GetAddress(&offset);
Memory::Region R = memory.Lookup(pointer, target_ty);
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
File::Printf (const char *format, ...)
{
va_list args;
va_start (args, format);
- int result = PrintfVarArg (format, args);
+ size_t result = PrintfVarArg (format, args);
va_end (args);
return result;
}
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
File::PrintfVarArg (const char *format, va_list args)
{
- int result = 0;
+ size_t result = 0;
if (DescriptorIsValid())
{
char *s = NULL;
}
else
{
- int user_name_len = first_slash - src_path - 1;
+ size_t user_name_len = first_slash - src_path - 1;
::memcpy (user_home, src_path + 1, user_name_len);
user_home[user_name_len] = '\0';
user_name = user_home;
if (::sysctl (proc_args_mib, 3, arg_data, &arg_data_size , NULL, 0) == 0)
{
DataExtractor data (arg_data, arg_data_size, lldb::endian::InlHostByteOrder(), sizeof(void *));
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t argc = data.GetU32 (&offset);
const char *cstr;
const lldb_private::UUID *uuid, // the UUID we are looking for
off_t file_offset,
DataExtractor& data,
- uint32_t data_offset,
+ lldb::offset_t data_offset,
const uint32_t magic
)
{
for (i=0; i<ncmds; i++)
{
- const uint32_t cmd_offset = data_offset; // Save this data_offset in case parsing of the segment goes awry!
+ const lldb::offset_t cmd_offset = data_offset; // Save this data_offset in case parsing of the segment goes awry!
uint32_t cmd = data.GetU32(&data_offset);
uint32_t cmd_size = data.GetU32(&data_offset);
if (cmd == LoadCommandUUID)
const lldb_private::UUID *uuid,
off_t file_offset,
DataExtractor& data,
- uint32_t data_offset,
+ lldb::offset_t data_offset,
const uint32_t magic
)
{
DataExtractor arch_data;
DataBufferSP data_buffer_sp (file_spec.ReadFileContents (file_offset + arch_offset, 0x1000));
arch_data.SetData(data_buffer_sp);
- uint32_t arch_data_offset = 0;
+ lldb::offset_t arch_data_offset = 0;
uint32_t arch_magic = arch_data.GetU32(&arch_data_offset);
switch (arch_magic)
{
data.SetData(data_buffer_sp);
- uint32_t data_offset = 0;
+ lldb::offset_t data_offset = 0;
uint32_t magic = data.GetU32(&data_offset);
switch (magic)
g_dsym_for_uuid_exe_exists = dsym_for_uuid_exe_spec.Exists();
if (!g_dsym_for_uuid_exe_exists)
{
- int bufsize;
+ long bufsize;
if ((bufsize = sysconf(_SC_GETPW_R_SIZE_MAX)) != -1)
{
char buffer[bufsize];
void
Args::Dump (Stream *s)
{
- const int argc = m_argv.size();
- for (int i=0; i<argc; ++i)
+ const size_t argc = m_argv.size();
+ for (size_t i=0; i<argc; ++i)
{
s->Indent();
const char *arg_cstr = m_argv[i];
if (arg_cstr)
- s->Printf("argv[%i]=\"%s\"\n", i, arg_cstr);
+ s->Printf("argv[%zi]=\"%s\"\n", i, arg_cstr);
else
- s->Printf("argv[%i]=NULL\n", i);
+ s->Printf("argv[%zi]=NULL\n", i);
}
s->EOL();
}
Args::GetCommandString (std::string &command) const
{
command.clear();
- int argc = GetArgumentCount();
- for (int i=0; i<argc; ++i)
+ const size_t argc = GetArgumentCount();
+ for (size_t i=0; i<argc; ++i)
{
if (i > 0)
command += ' ';
Args::GetQuotedCommandString (std::string &command) const
{
command.clear ();
- size_t argc = GetArgumentCount ();
+ const size_t argc = GetArgumentCount();
for (size_t i = 0; i < argc; ++i)
{
if (i > 0)
}
void
-Args::SetArguments (int argc, const char **argv)
+Args::SetArguments (size_t argc, const char **argv)
{
// m_argv will be rebuilt in UpdateArgvFromArgs() below, so there is
// no need to clear it here.
if (s && s[0])
{
char *end = NULL;
- int32_t uval = ::strtol (s, &end, base);
+ const long sval = ::strtol (s, &end, base);
if (*end == '\0')
{
- if (success_ptr) *success_ptr = true;
- return uval; // All characters were used, return the result
+ if (success_ptr)
+ *success_ptr = ((sval <= INT32_MAX) && (sval >= INT32_MIN));
+ return (int32_t)sval; // All characters were used, return the result
}
}
if (success_ptr) *success_ptr = false;
if (s && s[0])
{
char *end = NULL;
- uint32_t uval = ::strtoul (s, &end, base);
+ const unsigned long uval = ::strtoul (s, &end, base);
if (*end == '\0')
{
- if (success_ptr) *success_ptr = true;
- return uval; // All characters were used, return the result
+ if (success_ptr)
+ *success_ptr = (uval <= UINT32_MAX);
+ return (uint32_t)uval; // All characters were used, return the result
}
}
if (success_ptr) *success_ptr = false;
if (s && s[0])
{
char *pos = NULL;
- uint32_t uval32;
- uval32 = ::strtoul (s, &pos, 0);
+ unsigned long uval32 = ::strtoul (s, &pos, 0);
if (pos == s)
return s;
major = uval32;
}
-int32_t
+int64_t
Args::StringToOptionEnum (const char *s, OptionEnumValueElement *enum_values, int32_t fail_value, Error &error)
{
if (enum_values)
(
const char *s,
lldb::Format &format,
- uint32_t *byte_size_ptr
+ size_t *byte_size_ptr
)
{
format = eFormatInvalid;
unsigned long octal_value = ::strtoul (oct_str, NULL, 8);
if (octal_value <= UINT8_MAX)
{
- const char octal_char = octal_value;
- dst.append(1, octal_char);
+ dst.append(1, (char)octal_value);
}
}
break;
CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bool exact, StringList *matches)
{
CommandObject::CommandMap::iterator pos;
- CommandObjectSP ret_val;
+ CommandObjectSP command_sp;
std::string cmd(cmd_cstr);
{
pos = m_command_dict.find(cmd);
if (pos != m_command_dict.end())
- ret_val = pos->second;
+ command_sp = pos->second;
}
if (include_aliases && HasAliases())
{
pos = m_alias_dict.find(cmd);
if (pos != m_alias_dict.end())
- ret_val = pos->second;
+ command_sp = pos->second;
}
if (HasUserCommands())
{
pos = m_user_dict.find(cmd);
if (pos != m_user_dict.end())
- ret_val = pos->second;
+ command_sp = pos->second;
}
- if (!exact && !ret_val)
+ if (!exact && !command_sp)
{
// We will only get into here if we didn't find any exact matches.
return user_match_sp;
}
}
- else if (matches && ret_val)
+ else if (matches && command_sp)
{
matches->AppendString (cmd_cstr);
}
- return ret_val;
+ return command_sp;
}
bool
options_string)));
else
{
- int argc = args.GetArgumentCount();
+ const size_t argc = args.GetArgumentCount();
for (size_t i = 0; i < argc; ++i)
if (strcmp (args.GetArgumentAtIndex (i), "") != 0)
option_arg_vector->push_back
uint32_t cmd_types)
{
CommandObject::CommandMap::const_iterator pos;
- uint32_t max_len = FindLongestCommandWord (m_command_dict);
+ size_t max_len = FindLongestCommandWord (m_command_dict);
if ( (cmd_types & eCommandTypesBuiltin) == eCommandTypesBuiltin )
{
if (cmd_obj == NULL)
{
- uint32_t num_matches = matches.GetSize();
+ const size_t num_matches = matches.GetSize();
if (matches.GetSize() > 1) {
- std::string error_msg;
- error_msg.assign ("Ambiguous command '");
- error_msg.append(next_word.c_str());
- error_msg.append ("'.");
-
- error_msg.append (" Possible matches:");
+ StreamString error_msg;
+ error_msg.Printf ("Ambiguous command '%s'. Possible matches:\n", next_word.c_str());
for (uint32_t i = 0; i < num_matches; ++i) {
- error_msg.append ("\n\t");
- error_msg.append (matches.GetStringAtIndex(i));
+ error_msg.Printf ("\t%s\n", matches.GetStringAtIndex(i));
}
- error_msg.append ("\n");
- result.AppendRawError (error_msg.c_str(), error_msg.size());
+ result.AppendRawError (error_msg.GetString().c_str());
} else {
// We didn't have only one match, otherwise we wouldn't get here.
assert(num_matches == 0);
error_msg.append (matches.GetStringAtIndex (i));
}
error_msg.append ("\n");
- result.AppendRawError (error_msg.c_str(), error_msg.size());
+ result.AppendRawError (error_msg.c_str());
}
else
result.AppendErrorWithFormat ("Unrecognized command '%s'.\n", command_args.GetArgumentAtIndex (0));
std::string common_prefix;
matches.LongestCommonPrefix (common_prefix);
- int partial_name_len = command_partial_str.size();
+ const size_t partial_name_len = command_partial_str.size();
// If we matched a unique single command, add a space...
// Only do this if the completer told us this was a complete word, however...
}
OptionArgVector *option_arg_vector = option_arg_vector_sp.get();
- int old_size = cmd_args.GetArgumentCount();
+ const size_t old_size = cmd_args.GetArgumentCount();
std::vector<bool> used (old_size + 1, false);
used[0] = true;
const char *word_text,
const char *separator,
const char *help_text,
- uint32_t max_word_len)
+ size_t max_word_len)
{
const uint32_t max_columns = m_debugger.GetTerminalWidth();
strm.IndentMore (indent_size);
StreamString text_strm;
- text_strm.Printf ("%-*s %s %s", max_word_len, word_text, separator, help_text);
+ text_strm.Printf ("%-*s %s %s", (int)max_word_len, word_text, separator, help_text);
size_t len = text_strm.GetSize();
const char *text = text_strm.GetData();
// We need to break it up into multiple lines.
bool first_line = true;
int text_width;
- int start = 0;
- int end = start;
- int final_end = strlen (text);
- int sub_len;
+ size_t start = 0;
+ size_t end = start;
+ const size_t final_end = strlen (text);
while (end < final_end)
{
assert (end > 0);
}
- sub_len = end - start;
+ const size_t sub_len = end - start;
if (start != 0)
strm.EOL();
if (!first_line)
if (input_str[1] == '-')
{
bool success;
- uint32_t idx = Args::StringToUInt32 (input_str+2, 0, 0, &success);
+ size_t idx = Args::StringToUInt32 (input_str+2, 0, 0, &success);
if (!success)
return NULL;
if (idx > m_command_history.size())
{
// A NULL or empty string matches everything.
if (m_match_str == NULL || *m_match_str == '\0')
- return 1;
+ return true;
- size_t found = map_element.first.find (m_match_str, 0);
- if (found == std::string::npos)
- return 0;
- else
- return found == 0;
+ return map_element.first.find (m_match_str, 0) == 0;
}
private:
// don't append "\n" to the end of it.
void
-CommandReturnObject::AppendRawWarning (const char *in_string, int len)
+CommandReturnObject::AppendRawWarning (const char *in_string)
{
- if (!in_string)
- return;
- if (len < 0)
- len = ::strlen (in_string);
- GetErrorStream().Printf("%*.*s", len, len, in_string);
+ if (in_string && in_string[0])
+ GetErrorStream().PutCString(in_string);
}
void
// don't append "\n" to the end of it.
void
-CommandReturnObject::AppendRawError (const char *in_string, int len)
+CommandReturnObject::AppendRawError (const char *in_string)
{
- if (!in_string)
- return;
- if (len < 0)
- len = ::strlen (in_string);
- GetErrorStream().Printf ("%*.*s", len, len, in_string);
+ if (in_string && in_string[0])
+ GetErrorStream().PutCString(in_string);
}
void
if (m_py_obj && key)
{
PyObject *py_obj = PyDict_GetItem(m_py_obj, key.GetPythonObject());
- if (py_obj && PyInt_Check(py_obj))
- return PyInt_AsLong(py_obj);
+ if (py_obj)
+ {
+ if (PyInt_Check(py_obj))
+ return PyInt_AsLong(py_obj);
+
+ if (PyLong_Check(py_obj))
+ return PyLong_AsLong(py_obj);
+ }
}
return fail_value;
}
return NULL;
}
-uint32_t
+size_t
ScriptInterpreterPython::CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor_sp)
{
if (!implementor_sp)
{
DataExtractor data;
size_t num_bytes = new_value_sp->GetData(data);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (num_bytes <= 8)
{
const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("r0", 0);
{
DataExtractor data;
size_t num_bytes = new_value_sp->GetData(data);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (num_bytes <= 8)
{
const RegisterInfo *eax_info = reg_ctx->GetRegisterInfoByName("eax", 0);
DataExtractor data;
size_t num_bytes = new_value_sp->GetData(data);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (num_bytes <= 8)
{
uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
DataExtractor data;
if (xmm0_value.GetData(data))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
switch (bit_width)
{
default:
virtual size_t
Decode (const lldb_private::Disassembler &disassembler,
const lldb_private::DataExtractor &data,
- uint32_t data_offset)
+ lldb::offset_t data_offset)
{
// All we have to do is read the opcode which can be easy for some
// architetures
m_comment.assign ("unknown opcode");
inst_size = m_opcode.GetByteSize();
StreamString mnemonic_strm;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
switch (inst_size)
{
case 1:
size_t
DisassemblerLLVMC::DecodeInstructions (const Address &base_addr,
const DataExtractor& data,
- uint32_t data_offset,
- uint32_t num_instructions,
+ lldb::offset_t data_offset,
+ size_t num_instructions,
bool append)
{
if (!append)
size_t
DecodeInstructions (const lldb_private::Address &base_addr,
const lldb_private::DataExtractor& data,
- uint32_t data_offset,
- uint32_t num_instructions,
+ lldb::offset_t data_offset,
+ size_t num_instructions,
bool append);
//------------------------------------------------------------------
const size_t bytes_read = m_process->GetTarget().ReadMemory (m_kext_summary_header_addr, prefer_file_cache, buf, count, error);
if (bytes_read == count)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
m_kext_summary_header.version = data.GetU32(&offset);
if (m_kext_summary_header.version >= 2)
{
i < image_infos.size() && extractor.ValidOffsetForDataOfSize(kext_summary_offset, m_kext_summary_header.entry_size);
++i, kext_summary_offset += m_kext_summary_header.entry_size)
{
- uint32_t offset = kext_summary_offset;
+ lldb::offset_t offset = kext_summary_offset;
const void *name_data = extractor.GetData(&offset, KERNEL_MODULE_MAX_NAME);
if (name_data == NULL)
break;
Error error;
if (m_process->ReadMemory (shlib_addr, buf, 4, error) == 4)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t magic = data.GetU32 (&offset);
switch (magic)
{
SectionList *section_list = image_object_file->GetSectionList ();
if (section_list)
{
- uint32_t num_sections = section_list->GetSize();
- for (uint32_t i=0; i<num_sections; ++i)
+ const size_t num_sections = section_list->GetSize();
+ for (size_t i=0; i<num_sections; ++i)
{
SectionSP section_sp (section_list->GetSectionAtIndex (i));
if (section_sp)
std::vector<uint32_t> inaccessible_segment_indexes;
// We now know the slide amount, so go through all sections
// and update the load addresses with the correct values.
- uint32_t num_segments = info.segments.size();
- for (uint32_t i=0; i<num_segments; ++i)
+ const size_t num_segments = info.segments.size();
+ for (size_t i=0; i<num_segments; ++i)
{
// Only load a segment if it has protections. Things like
// __PAGEZERO don't have any protections, and they shouldn't
SectionList *section_list = image_object_file->GetSectionList ();
if (section_list)
{
- uint32_t num_segments = info.segments.size();
- for (uint32_t i=0; i<num_segments; ++i)
+ const size_t num_segments = info.segments.size();
+ for (size_t i=0; i<num_segments; ++i)
{
SectionSP section_sp(section_list->FindSectionByName(info.segments[i].name));
if (section_sp)
uint8_t buf[256];
DataExtractor data (buf, sizeof(buf), byte_order, addr_size);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const size_t count_v2 = sizeof (uint32_t) + // version
sizeof (uint32_t) + // infoArrayCount
addr_size; // errorSymbol
assert (sizeof (buf) >= count_v11);
- int count;
Error error;
if (m_process->ReadMemory (m_dyld_all_image_infos_addr, buf, 4, error) == 4)
{
return false;
}
- if (m_dyld_all_image_infos.version >= 11)
- count = count_v11;
- else
- count = count_v2;
+ const size_t count = (m_dyld_all_image_infos.version >= 11) ? count_v11 : count_v2;
const size_t bytes_read = m_process->ReadMemory (m_dyld_all_image_infos_addr, buf, count, error);
if (bytes_read == count)
error);
if (bytes_read == count)
{
- uint32_t info_data_offset = 0;
+ lldb::offset_t info_data_offset = 0;
DataExtractor info_data_ref(info_data.GetBytes(), info_data.GetByteSize(), endian, addr_size);
for (int i = 0; i < image_infos.size() && info_data_ref.ValidOffset(info_data_offset); i++)
{
error);
if (bytes_read == sizeof(llvm::MachO::mach_header))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
::memset (header, 0, sizeof(llvm::MachO::mach_header));
// Get the magic byte unswapped so we can figure out what we are dealing with
uint32_t
DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, DYLDImageInfo& dylib_info, FileSpec *lc_id_dylinker)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t cmd_idx;
Segment segment;
dylib_info.Clear (true);
if (data.ValidOffsetForDataOfSize (offset, sizeof(llvm::MachO::load_command)))
{
llvm::MachO::load_command load_cmd;
- uint32_t load_cmd_offset = offset;
+ lldb::offset_t load_cmd_offset = offset;
load_cmd.cmd = data.GetU32 (&offset);
load_cmd.cmdsize = data.GetU32 (&offset);
switch (load_cmd.cmd)
case llvm::MachO::LoadCommandDynamicLinkerIdent:
if (lc_id_dylinker)
{
- uint32_t name_offset = load_cmd_offset + data.GetU32 (&offset);
+ const lldb::offset_t name_offset = load_cmd_offset + data.GetU32 (&offset);
const char *path = data.PeekCStr (name_offset);
lc_id_dylinker->SetFile (path, true);
}
static bool
GetMaxU64(DataExtractor &data,
- uint32_t *offset, uint64_t *value, unsigned int byte_size)
+ lldb::offset_t *offset_ptr,
+ uint64_t *value,
+ unsigned int byte_size)
{
- uint32_t saved_offset = *offset;
- *value = data.GetMaxU64(offset, byte_size);
- return *offset != saved_offset;
+ lldb::offset_t saved_offset = *offset_ptr;
+ *value = data.GetMaxU64(offset_ptr, byte_size);
+ return *offset_ptr != saved_offset;
}
static bool
-ParseAuxvEntry(DataExtractor &data, AuxVector::Entry &entry,
- uint32_t *offset, unsigned int byte_size)
+ParseAuxvEntry(DataExtractor &data,
+ AuxVector::Entry &entry,
+ lldb::offset_t *offset_ptr,
+ unsigned int byte_size)
{
- if (!GetMaxU64(data, offset, &entry.type, byte_size))
+ if (!GetMaxU64(data, offset_ptr, &entry.type, byte_size))
return false;
- if (!GetMaxU64(data, offset, &entry.value, byte_size))
+ if (!GetMaxU64(data, offset_ptr, &entry.value, byte_size))
return false;
return true;
AuxVector::ParseAuxv(DataExtractor &data)
{
const unsigned int byte_size = m_process->GetAddressByteSize();
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
for (;;)
{
log->PutCString("DYLDRendezvous:");
log->Printf(" Address: %" PRIx64, GetRendezvousAddress());
- log->Printf(" Version: %d", GetVersion());
+ log->Printf(" Version: %" PRIu64, GetVersion());
log->Printf(" Link : %" PRIx64, GetLinkMapAddress());
log->Printf(" Break : %" PRIx64, GetBreakAddress());
log->Printf(" LDBase : %" PRIx64, GetLDBase());
GetRendezvousAddress() const { return m_rendezvous_addr; }
/// @returns the version of the rendezvous protocol being used.
- int
+ uint64_t
GetVersion() const { return m_current.version; }
/// @returns address in the inferiors address space containing the linked
GetBreakAddress() const { return m_current.brk; }
/// Returns the current state of the rendezvous structure.
- int
+ uint64_t
GetState() const { return m_current.state; }
/// @returns the base address of the runtime linker in the inferiors address
return false;
}
- uint32_t offset_ptr = 0;
- lldb::addr_t vtable_address_point = data.GetAddress (&offset_ptr);
+ lldb::offset_t offset = 0;
+ lldb::addr_t vtable_address_point = data.GetAddress (&offset);
- if (offset_ptr == 0)
+ if (offset == 0)
return false;
// Now find the symbol that contains this address:
return false;
}
- offset_ptr = 0;
- int64_t offset_to_top = data.GetMaxS64(&offset_ptr, process->GetAddressByteSize());
+ offset = 0;
+ int64_t offset_to_top = data.GetMaxS64(&offset, process->GetAddressByteSize());
// So the dynamic type is a value that starts at offset_to_top
// above the original address.
const uint32_t addr_size = m_process->GetAddressByteSize();
const ByteOrder byte_order = m_process->GetByteOrder();
DataExtractor data (buffer.GetBytes(), buffer.GetByteSize(), byte_order, addr_size);
- uint32_t offset = addr_size; // Skip prototype
+ lldb::offset_t offset = addr_size; // Skip prototype
const uint32_t count = data.GetU32(&offset);
const uint32_t num_buckets = data.GetU32(&offset);
const addr_t buckets_ptr = data.GetPointer(&offset);
DataExtractor extractor(objc_class_buf.GetBytes(), objc_class_size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_isa = extractor.GetAddress_unchecked(&cursor); // uintptr_t isa;
m_superclass = extractor.GetAddress_unchecked(&cursor); // Class superclass;
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_flags = extractor.GetU32_unchecked(&cursor);
m_instanceStart = extractor.GetU32_unchecked(&cursor);
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_flags = extractor.GetU32_unchecked(&cursor);
m_version = extractor.GetU32_unchecked(&cursor);
- m_ro_ptr = extractor.GetAddress_unchecked(&cursor);
- m_method_list_ptr = extractor.GetAddress_unchecked(&cursor);
- m_properties_ptr = extractor.GetAddress_unchecked(&cursor);
+ m_ro_ptr = extractor.GetAddress_unchecked(&cursor);
+ m_method_list_ptr = extractor.GetAddress_unchecked(&cursor);
+ m_properties_ptr = extractor.GetAddress_unchecked(&cursor);
m_firstSubclass = extractor.GetAddress_unchecked(&cursor);
m_nextSiblingClass = extractor.GetAddress_unchecked(&cursor);
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_entsize = extractor.GetU32_unchecked(&cursor) & ~(uint32_t)3;
m_count = extractor.GetU32_unchecked(&cursor);
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_name_ptr = extractor.GetAddress_unchecked(&cursor);
m_types_ptr = extractor.GetAddress_unchecked(&cursor);
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_entsize = extractor.GetU32_unchecked(&cursor);
m_count = extractor.GetU32_unchecked(&cursor);
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_offset_ptr = extractor.GetAddress_unchecked(&cursor);
m_name_ptr = extractor.GetAddress_unchecked(&cursor);
DataExtractor isa_extractor(isas_buffer.GetBytes(), isas_allocation_size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t offset_ptr = 0;
+ lldb::offset_t offset = 0;
for (size_t index = 0; index < num_isas; ++index)
{
- uint64_t isa = isa_extractor.GetPointer(&offset_ptr);
+ uint64_t isa = isa_extractor.GetPointer(&offset);
const char *name = (const char*)(names_buffer.GetBytes() + (name_size * index));
return;
}
- uint32_t offset_ptr = 0;
- const uint16_t header_size = data.GetU16(&offset_ptr);
- const uint16_t descriptor_size = data.GetU16(&offset_ptr);
- const size_t num_descriptors = data.GetU32(&offset_ptr);
+ lldb::offset_t offset = 0;
+ const uint16_t header_size = data.GetU16(&offset);
+ const uint16_t descriptor_size = data.GetU16(&offset);
+ const size_t num_descriptors = data.GetU32(&offset);
- m_next_region = data.GetPointer(&offset_ptr);
+ m_next_region = data.GetPointer(&offset);
// If the header size is 0, that means we've come in too early before this data is set up.
// Set ourselves as not valid, and continue.
// The actual code for the vtables will be laid out consecutively, so I also
// compute the start and end of the whole code block.
- offset_ptr = 0;
+ offset = 0;
m_code_start_addr = 0;
m_code_end_addr = 0;
for (int i = 0; i < num_descriptors; i++)
{
- lldb::addr_t start_offset = offset_ptr;
- uint32_t offset = desc_extractor.GetU32 (&offset_ptr);
- uint32_t flags = desc_extractor.GetU32 (&offset_ptr);
- lldb::addr_t code_addr = desc_ptr + start_offset + offset;
+ lldb::addr_t start_offset = offset;
+ uint32_t voffset = desc_extractor.GetU32 (&offset);
+ uint32_t flags = desc_extractor.GetU32 (&offset);
+ lldb::addr_t code_addr = desc_ptr + start_offset + voffset;
m_descriptors.push_back (VTableDescriptor(flags, code_addr));
if (m_code_start_addr == 0 || code_addr < m_code_start_addr)
if (code_addr > m_code_end_addr)
m_code_end_addr = code_addr;
- offset_ptr = start_offset + descriptor_size;
+ offset = start_offset + descriptor_size;
}
// Finally, a little bird told me that all the vtable code blocks are the same size.
// Let's compute the blocks and if they are all the same add the size to the code end address:
data,
0,
NULL);
- uint32_t offset_ptr = 0;
- lldb::addr_t region_addr = data.GetPointer(&offset_ptr);
+ lldb::offset_t offset = 0;
+ lldb::addr_t region_addr = data.GetPointer(&offset);
if (region_addr != 0)
vtable_handler->ReadRegions(region_addr);
ar_file_size = 0;
}
-uint32_t
-ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, uint32_t offset)
+lldb::offset_t
+ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, lldb::offset_t offset)
{
size_t ar_name_len = 0;
std::string str;
ar_file_size = ar_size - ar_name_len;
return offset;
}
- return LLDB_INVALID_INDEX32;
+ return LLDB_INVALID_OFFSET;
}
ObjectContainerBSDArchive::Archive::Archive
ObjectContainerBSDArchive::Archive::ParseObjects (DataExtractor &data)
{
std::string str;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
str.assign((const char *)data.GetData(&offset, SARMAG), SARMAG);
if (str == ARMAG)
{
do
{
offset = obj.Extract (data, offset);
- if (offset == LLDB_INVALID_INDEX32)
+ if (offset == LLDB_INVALID_OFFSET)
break;
- uint32_t obj_idx = m_objects.size();
+ size_t obj_idx = m_objects.size();
m_objects.push_back(obj);
// Insert all of the C strings out of order for now...
m_object_name_to_index_map.Append (obj.ar_name.GetCString(), obj_idx);
ObjectContainerBSDArchive::Object *
ObjectContainerBSDArchive::Archive::FindObject (const ConstString &object_name)
{
- const UniqueCStringMap<uint32_t>::Entry *match = m_object_name_to_index_map.FindFirstValueForName (object_name.GetCString());
+ const ObjectNameToIndexMap::Entry *match = m_object_name_to_index_map.FindFirstValueForName (object_name.GetCString());
if (match)
return &m_objects[match->value];
return NULL;
void
Clear();
- uint32_t
- Extract (const lldb_private::DataExtractor& data, uint32_t offset);
+ lldb::offset_t
+ Extract (const lldb_private::DataExtractor& data, lldb::offset_t offset);
lldb_private::ConstString ar_name; // name
uint32_t ar_date; // modification time
uint16_t ar_gid; // group id
uint16_t ar_mode; // octal file permissions
uint32_t ar_size; // size in bytes
- uint32_t ar_file_offset; // file offset in bytes from the beginning of the file of the object data
- uint32_t ar_file_size; // length of the object data
+ lldb::offset_t ar_file_offset; // file offset in bytes from the beginning of the file of the object data
+ lldb::offset_t ar_file_size; // length of the object data
typedef std::vector<Object> collection;
typedef collection::iterator iterator;
HasNoExternalReferences() const;
protected:
-
+ typedef lldb_private::UniqueCStringMap<uint32_t> ObjectNameToIndexMap;
//----------------------------------------------------------------------
// Member Variables
//----------------------------------------------------------------------
lldb_private::ArchSpec m_arch;
lldb_private::TimeValue m_time;
Object::collection m_objects;
- lldb_private::UniqueCStringMap<uint32_t> m_object_name_to_index_map;
+ ObjectNameToIndexMap m_object_name_to_index_map;
};
void
bool
ObjectContainerUniversalMachO::MagicBytesMatch (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t magic = data.GetU32(&offset);
return magic == UniversalMagic || magic == UniversalMagicSwapped;
}
{
// Store the file offset for this universal file as we could have a universal .o file
// in a BSD archive, or be contained in another kind of object.
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
// Universal mach-o files always have their headers in big endian.
m_data.SetByteOrder (eByteOrderBig);
m_header.magic = m_data.GetU32(&offset);
// GetMaxU64 and GetMaxS64 wrap the similarly named methods from DataExtractor
// with error handling code and provide for parsing a sequence of values.
static bool
-GetMaxU64(const lldb_private::DataExtractor &data,
- uint32_t *offset, uint64_t *value, uint32_t byte_size)
+GetMaxU64(const lldb_private::DataExtractor &data,
+ lldb::offset_t *offset,
+ uint64_t *value,
+ uint32_t byte_size)
{
- const uint32_t saved_offset = *offset;
+ const lldb::offset_t saved_offset = *offset;
*value = data.GetMaxU64(offset, byte_size);
return *offset != saved_offset;
}
static bool
GetMaxU64(const lldb_private::DataExtractor &data,
- uint32_t *offset, uint64_t *value, uint32_t byte_size,
+ lldb::offset_t *offset,
+ uint64_t *value,
+ uint32_t byte_size,
uint32_t count)
{
- uint32_t saved_offset = *offset;
+ lldb::offset_t saved_offset = *offset;
for (uint32_t i = 0; i < count; ++i, ++value)
{
static bool
GetMaxS64(const lldb_private::DataExtractor &data,
- uint32_t *offset, int64_t *value, uint32_t byte_size)
+ lldb::offset_t *offset,
+ int64_t *value,
+ uint32_t byte_size)
{
- const uint32_t saved_offset = *offset;
+ const lldb::offset_t saved_offset = *offset;
*value = data.GetMaxS64(offset, byte_size);
return *offset != saved_offset;
}
static bool
GetMaxS64(const lldb_private::DataExtractor &data,
- uint32_t *offset, int64_t *value, uint32_t byte_size,
+ lldb::offset_t *offset,
+ int64_t *value,
+ uint32_t byte_size,
uint32_t count)
{
- uint32_t saved_offset = *offset;
+ lldb::offset_t saved_offset = *offset;
for (uint32_t i = 0; i < count; ++i, ++value)
{
}
bool
-ELFHeader::Parse(lldb_private::DataExtractor &data, uint32_t *offset)
+ELFHeader::Parse(lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
// Read e_ident. This provides byte order and address size info.
if (data.GetU8(offset, &e_ident, EI_NIDENT) == NULL)
bool
ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,
- uint32_t *offset)
+ lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
}
bool
-ELFSymbol::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFSymbol::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
const bool parsing_32 = byte_size == 4;
bool
ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
- uint32_t *offset)
+ lldb::offset_t *offset)
{
const uint32_t byte_size = data.GetAddressByteSize();
const bool parsing_32 = byte_size == 4;
}
bool
-ELFDynamic::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFDynamic::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
return GetMaxS64(data, offset, &d_tag, byte_size, 2);
}
bool
-ELFRel::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFRel::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
}
bool
-ELFRela::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFRela::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
/// True if the ELFSectionHeader was successfully read and false
/// otherwise.
bool
- Parse(lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(lldb_private::DataExtractor &data, lldb::offset_t *offset);
//--------------------------------------------------------------------------
/// Examines at most EI_NIDENT bytes starting from the given pointer and
/// True if the ELFSectionHeader was successfully read and false
/// otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
/// True if the ELFProgramHeader was successfully read and false
/// otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
/// @return
/// True if the ELFSymbol was successfully read and false otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
/// True if the ELFDynamic entry was successfully read and false
/// otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
/// @return
/// True if the ELFRel entry was successfully read and false otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
/// Returns the type when the given entry represents a 32-bit relocation.
static unsigned
/// @return
/// True if the ELFRela entry was successfully read and false otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
/// Returns the type when the given entry represents a 32-bit relocation.
static unsigned
~ELFRelocation();
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
static unsigned
RelocType32(const ELFRelocation &rel);
}
bool
-ELFRelocation::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFRelocation::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
if (reloc.is<ELFRel*>())
return reloc.get<ELFRel*>()->Parse(data, offset);
return eByteOrderInvalid;
}
-size_t
+uint32_t
ObjectFileELF::GetAddressByteSize() const
{
return m_data.GetAddressByteSize();
}
-unsigned
+size_t
ObjectFileELF::SectionIndex(const SectionHeaderCollIter &I)
{
- return std::distance(m_section_headers.begin(), I) + 1;
+ return std::distance(m_section_headers.begin(), I) + 1u;
}
-unsigned
+size_t
ObjectFileELF::SectionIndex(const SectionHeaderCollConstIter &I) const
{
- return std::distance(m_section_headers.begin(), I) + 1;
+ return std::distance(m_section_headers.begin(), I) + 1u;
}
bool
ObjectFileELF::ParseHeader()
{
- uint32_t offset = GetOffset();
+ lldb::offset_t offset = GetOffset();
return m_header.Parse(m_data, &offset);
}
ReadSectionData(dynstr, dynstr_data))
{
ELFDynamic symbol;
- const unsigned section_size = dynsym_data.GetByteSize();
- unsigned offset = 0;
+ const lldb::offset_t section_size = dynsym_data.GetByteSize();
+ lldb::offset_t offset = 0;
// The only type of entries we are concerned with are tagged DT_NEEDED,
// yielding the name of a required library.
return 0;
uint32_t idx;
- uint32_t offset;
+ lldb::offset_t offset;
for (idx = 0, offset = 0; idx < m_header.e_phnum; ++idx)
{
if (m_program_headers[idx].Parse(data, &offset) == false)
return 0;
uint32_t idx;
- uint32_t offset;
+ lldb::offset_t offset;
for (idx = 0, offset = 0; idx < m_header.e_shnum; ++idx)
{
if (m_section_headers[idx].Parse(data, &offset) == false)
const DataExtractor &strtab_data)
{
ELFSymbol symbol;
- uint32_t offset = 0;
- const unsigned num_symbols =
- symtab_data.GetByteSize() / symtab_shdr->sh_entsize;
+ lldb::offset_t offset = 0;
+ const size_t num_symbols = symtab_data.GetByteSize() / symtab_shdr->sh_entsize;
static ConstString text_section_name(".text");
static ConstString init_section_name(".init");
DataExtractor dynsym_data;
if (ReadSectionData(dynsym, dynsym_data))
{
- const unsigned section_size = dynsym_data.GetByteSize();
- unsigned cursor = 0;
+ const lldb::offset_t section_size = dynsym_data.GetByteSize();
+ lldb::offset_t cursor = 0;
while (cursor < section_size)
{
{
ELFRelocation rel(rel_type);
ELFSymbol symbol;
- uint32_t offset = 0;
- const unsigned plt_entsize = plt_hdr->sh_entsize;
- const unsigned num_relocations = rel_hdr->sh_size / rel_hdr->sh_entsize;
+ lldb::offset_t offset = 0;
+ const elf_xword plt_entsize = plt_hdr->sh_entsize;
+ const elf_xword num_relocations = rel_hdr->sh_size / rel_hdr->sh_entsize;
typedef unsigned (*reloc_info_fn)(const ELFRelocation &rel);
reloc_info_fn reloc_type;
if (reloc_type(rel) != slot_type)
continue;
- unsigned symbol_offset = reloc_symbol(rel) * sym_hdr->sh_entsize;
+ lldb::offset_t symbol_offset = reloc_symbol(rel) * sym_hdr->sh_entsize;
uint64_t plt_index = (i + 1) * plt_entsize;
if (!symbol.Parse(symtab_data, &symbol_offset))
// Dump an token value for the ELF section header member sh_flags
//----------------------------------------------------------------------
void
-ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, elf_word sh_flags)
+ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, elf_xword sh_flags)
{
*s << ((sh_flags & SHF_WRITE) ? "WRITE" : " ")
<< (((sh_flags & SHF_WRITE) && (sh_flags & SHF_ALLOC)) ? '+' : ' ')
virtual bool
IsExecutable () const;
- virtual size_t
+ virtual uint32_t
GetAddressByteSize() const;
virtual lldb_private::Symtab *
lldb_private::Address m_entry_point_address;
/// Returns a 1 based index of the given section header.
- unsigned
+ size_t
SectionIndex(const SectionHeaderCollIter &I);
/// Returns a 1 based index of the given section header.
- unsigned
+ size_t
SectionIndex(const SectionHeaderCollConstIter &I) const;
/// Parses all section headers present in this object file and populates
static void
DumpELFSectionHeader_sh_flags(lldb_private::Stream *s,
- elf::elf_word sh_flags);
+ elf::elf_xword sh_flags);
//@}
/// ELF dependent module dump routine.
void
SetRegisterDataFrom_LC_THREAD (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
SetError (GPRRegSet, Read, -1);
SetError (FPURegSet, Read, -1);
SetError (EXCRegSet, Read, -1);
void
SetRegisterDataFrom_LC_THREAD (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
SetError (GPRRegSet, Read, -1);
SetError (FPURegSet, Read, -1);
SetError (EXCRegSet, Read, -1);
void
SetRegisterDataFrom_LC_THREAD (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
SetError (GPRRegSet, Read, -1);
SetError (FPURegSet, Read, -1);
SetError (EXCRegSet, Read, -1);
{
DataExtractor data;
data.SetData (data_sp, data_offset, data_length);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t magic = data.GetU32(&offset);
return MachHeaderSizeFromMagic(magic) != 0;
}
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
bool can_parse = false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
m_data.SetByteOrder (lldb::endian::InlHostByteOrder());
// Leave magic in the original byte order
m_header.magic = m_data.GetU32(&offset);
return m_header.filetype == HeaderFileTypeExecutable;
}
-size_t
+uint32_t
ObjectFileMachO::GetAddressByteSize () const
{
return m_data.GetAddressByteSize ();
{
lldb::user_id_t segID = 0;
lldb::user_id_t sectID = 0;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
const bool is_core = GetType() == eTypeCoreFile;
//bool dump_sections = false;
encryption_info_command encryption_cmd;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t load_cmd_offset = offset;
+ const lldb::offset_t load_cmd_offset = offset;
if (m_data.GetU32(&offset, &encryption_cmd, 2) == NULL)
break;
struct segment_command_64 load_cmd;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t load_cmd_offset = offset;
+ const lldb::offset_t load_cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
// get at data that isn't stored in the abstracted Sections.
m_mach_segments.push_back (load_cmd);
- ConstString segment_name (load_cmd.segname, std::min<int>(strlen(load_cmd.segname), sizeof(load_cmd.segname)));
+ ConstString segment_name (load_cmd.segname, std::min<size_t>(strlen(load_cmd.segname), sizeof(load_cmd.segname)));
// Use a segment ID of the segment index shifted left by 8 so they
// never conflict with any of the sections.
SectionSP segment_sp;
struct linkedit_data_command function_starts_load_command = { 0, 0, 0, 0 };
typedef AddressDataArray<lldb::addr_t, bool, 100> FunctionStarts;
FunctionStarts function_starts;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SYMBOLS));
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
// Read in the load command and load command size
struct load_command lc;
if (m_data.GetU32(&offset, &lc, 2) == NULL)
ProcessSP process_sp (m_process_wp.lock());
Process *process = process_sp.get();
- const size_t addr_byte_size = m_data.GetAddressByteSize();
+ const uint32_t addr_byte_size = m_data.GetAddressByteSize();
+ const ByteOrder byte_order = m_data.GetByteOrder();
bool bit_width_32 = addr_byte_size == 4;
const size_t nlist_byte_size = bit_width_32 ? sizeof(struct nlist) : sizeof(struct nlist_64);
- DataExtractor nlist_data (NULL, 0, m_data.GetByteOrder(), m_data.GetAddressByteSize());
- DataExtractor strtab_data (NULL, 0, m_data.GetByteOrder(), m_data.GetAddressByteSize());
- DataExtractor function_starts_data (NULL, 0, m_data.GetByteOrder(), m_data.GetAddressByteSize());
+ DataExtractor nlist_data (NULL, 0, byte_order, addr_byte_size);
+ DataExtractor strtab_data (NULL, 0, byte_order, addr_byte_size);
+ DataExtractor function_starts_data (NULL, 0, byte_order, addr_byte_size);
const addr_t nlist_data_byte_size = symtab_load_command.nsyms * nlist_byte_size;
const addr_t strtab_data_byte_size = symtab_load_command.strsize;
{
FunctionStarts::Entry function_start_entry;
function_start_entry.data = false;
- uint32_t function_start_offset = 0;
+ lldb::offset_t function_start_offset = 0;
function_start_entry.addr = text_section_sp->GetFileAddress();
uint64_t delta;
while ((delta = function_starts_data.GetULEB128(&function_start_offset)) > 0)
}
}
- const uint32_t function_starts_count = function_starts.GetSize();
+ const size_t function_starts_count = function_starts.GetSize();
- uint8_t TEXT_eh_frame_sectID = eh_frame_section_sp.get() ? eh_frame_section_sp->GetID() : NListSectionNoSection;
+ const user_id_t TEXT_eh_frame_sectID = eh_frame_section_sp.get() ? eh_frame_section_sp->GetID() : NListSectionNoSection;
- uint32_t nlist_data_offset = 0;
+ lldb::offset_t nlist_data_offset = 0;
uint32_t N_SO_index = UINT32_MAX;
uint32_t sym_idx = 0;
Symbol *sym = NULL;
- uint32_t num_syms = 0;
+ size_t num_syms = 0;
std::string memory_symbol_name;
uint32_t unmapped_local_symbols_found = 0;
if (DataBufferSP dsc_data_sp = dsc_filespec.MemoryMapFileContents(0, sizeof(struct lldb_copy_dyld_cache_header)))
{
- DataExtractor dsc_header_data(dsc_data_sp, m_data.GetByteOrder(), m_data.GetAddressByteSize());
+ DataExtractor dsc_header_data(dsc_data_sp, byte_order, addr_byte_size);
uint32_t offset = offsetof (struct lldb_copy_dyld_cache_header, mappingOffset);
uint32_t mappingOffset = dsc_header_data.GetU32(&offset);
// Map the local symbols
if (DataBufferSP dsc_local_symbols_data_sp = dsc_filespec.MemoryMapFileContents(localSymbolsOffset, localSymbolsSize))
{
- DataExtractor dsc_local_symbols_data(dsc_local_symbols_data_sp, m_data.GetByteOrder(), m_data.GetAddressByteSize());
+ DataExtractor dsc_local_symbols_data(dsc_local_symbols_data_sp, byte_order, addr_byte_size);
offset = 0;
const char *symbol_name_non_abi_mangled = NULL;
SectionSP symbol_section;
- uint32_t symbol_byte_size = 0;
+ lldb::addr_t symbol_byte_size = 0;
bool add_nlist = true;
bool is_debug = ((nlist.n_type & NlistMaskStab) != 0);
bool demangled_is_synthesized = false;
{
const uint32_t symbol_stub_index = symbol_stub_index_offset + stub_idx;
const lldb::addr_t symbol_stub_addr = m_mach_sections[sect_idx].addr + (stub_idx * symbol_stub_byte_size);
- uint32_t symbol_stub_offset = symbol_stub_index * 4;
+ lldb::offset_t symbol_stub_offset = symbol_stub_index * 4;
if (indirect_symbol_index_data.ValidOffsetForDataOfSize(symbol_stub_offset, 4))
{
const uint32_t stub_sym_id = indirect_symbol_index_data.GetU32 (&symbol_stub_offset);
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct uuid_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct load_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
const bool resolve_path = false; // Don't resolve the dependend file paths since they may not reside on this system
uint32_t i;
for (i=0; i<m_header.ncmds; ++i)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct load_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
lldb::addr_t start_address = LLDB_INVALID_ADDRESS;
bool done = false;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
if (!m_thread_context_offsets_valid)
{
m_thread_context_offsets_valid = true;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
FileRangeArray::Entry file_range;
thread_command thread_cmd;
for (uint32_t i=0; i<m_header.ncmds; ++i)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct dylib_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t version_cmd = 0;
uint64_t version = 0;
uint32_t i;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
virtual bool
IsExecutable () const;
- virtual size_t
+ virtual uint32_t
GetAddressByteSize () const;
virtual lldb::AddressClass
ObjectFilePECOFF::MagicBytesMatch (DataBufferSP& dataSP)
{
DataExtractor data(dataSP, eByteOrderLittle, 4);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint16_t magic = data.GetU16 (&offset);
return magic == IMAGE_DOS_SIGNATURE;
}
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
m_sect_headers.clear();
m_data.SetByteOrder (eByteOrderLittle);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (ParseDOSHeader())
{
return (m_coff_header.flags & IMAGE_FILE_DLL) == 0;
}
-size_t
+uint32_t
ObjectFilePECOFF::GetAddressByteSize () const
{
if (m_coff_header_opt.magic == OPT_HEADER_MAGIC_PE32_PLUS)
ObjectFilePECOFF::ParseDOSHeader ()
{
bool success = false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
success = m_data.ValidOffsetForDataOfSize(0, sizeof(m_dos_header));
if (success)
// ParserCOFFHeader
//----------------------------------------------------------------------
bool
-ObjectFilePECOFF::ParseCOFFHeader(uint32_t* offset_ptr)
+ObjectFilePECOFF::ParseCOFFHeader(lldb::offset_t *offset_ptr)
{
bool success = m_data.ValidOffsetForDataOfSize (*offset_ptr, sizeof(m_coff_header));
if (success)
}
bool
-ObjectFilePECOFF::ParseCOFFOptionalHeader(uint32_t* offset_ptr)
+ObjectFilePECOFF::ParseCOFFOptionalHeader(lldb::offset_t *offset_ptr)
{
bool success = false;
- const uint32_t end_offset = *offset_ptr + m_coff_header.hdrsize;
+ const lldb::offset_t end_offset = *offset_ptr + m_coff_header.hdrsize;
if (*offset_ptr < end_offset)
{
success = true;
DataBufferSP section_header_data_sp(m_file.ReadFileContents (section_header_data_offset, section_header_byte_size));
DataExtractor section_header_data (section_header_data_sp, GetByteOrder(), addr_byte_size);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (section_header_data.ValidOffsetForDataOfSize (offset, section_header_byte_size))
{
m_sect_headers.resize(nsects);
{
if (sect.name[0] == '/')
{
- uint32_t stroff = strtoul(§.name[1], NULL, 10);
- uint32_t string_file_offset = m_coff_header.symoff + (m_coff_header.nsyms * 18) + stroff;
+ lldb::offset_t stroff = strtoul(§.name[1], NULL, 10);
+ lldb::offset_t string_file_offset = m_coff_header.symoff + (m_coff_header.nsyms * 18) + stroff;
const char *name = m_data.GetCStr (&string_file_offset);
if (name)
{
// Include the 4 bytes string table size at the end of the symbols
DataBufferSP symtab_data_sp(m_file.ReadFileContents (m_coff_header.symoff, symbol_data_size + 4));
DataExtractor symtab_data (symtab_data_sp, GetByteOrder(), addr_byte_size);
- uint32_t offset = symbol_data_size;
+ lldb::offset_t offset = symbol_data_size;
const uint32_t strtab_size = symtab_data.GetU32 (&offset);
DataBufferSP strtab_data_sp(m_file.ReadFileContents (m_coff_header.symoff + symbol_data_size + 4, strtab_size));
DataExtractor strtab_data (strtab_data_sp, GetByteOrder(), addr_byte_size);
virtual bool
IsExecutable () const;
- virtual size_t
+ virtual uint32_t
GetAddressByteSize () const;
// virtual lldb_private::AddressClass
} coff_symbol_t;
bool ParseDOSHeader ();
- bool ParseCOFFHeader (uint32_t* offset_ptr);
- bool ParseCOFFOptionalHeader (uint32_t* offset_ptr);
+ bool ParseCOFFHeader (lldb::offset_t *offset_ptr);
+ bool ParseCOFFOptionalHeader (lldb::offset_t *offset_ptr);
bool ParseSectionHeaders (uint32_t offset);
static void DumpDOSHeader(lldb_private::Stream *s, const dos_header_t& header);
if (thread_dict)
{
PythonString tid_pystr("tid");
- PythonString name_pystr("name");
- PythonString queue_pystr("queue");
- PythonString state_pystr("state");
- PythonString stop_reason_pystr("stop_reason");
- PythonString reg_data_addr_pystr ("register_data_addr");
-
const tid_t tid = thread_dict.GetItemForKeyAsInteger (tid_pystr, LLDB_INVALID_THREAD_ID);
- const addr_t reg_data_addr = thread_dict.GetItemForKeyAsInteger (reg_data_addr_pystr, LLDB_INVALID_ADDRESS);
- const char *name = thread_dict.GetItemForKeyAsString (name_pystr);
- const char *queue = thread_dict.GetItemForKeyAsString (queue_pystr);
- //const char *state = thread_dict.GetItemForKeyAsString (state_pystr);
- //const char *stop_reason = thread_dict.GetItemForKeyAsString (stop_reason_pystr);
-
- if (old_thread_list_ptr)
- thread_sp = old_thread_list_ptr->FindThreadByID (tid, false);
- if (!thread_sp)
+ if (tid != LLDB_INVALID_THREAD_ID)
{
- if (did_create_ptr)
- *did_create_ptr = true;
- thread_sp.reset (new ThreadMemory (*m_process,
- tid,
- name,
- queue,
- reg_data_addr));
+ PythonString name_pystr("name");
+ PythonString queue_pystr("queue");
+ PythonString state_pystr("state");
+ PythonString stop_reason_pystr("stop_reason");
+ PythonString reg_data_addr_pystr ("register_data_addr");
+
+ const addr_t reg_data_addr = thread_dict.GetItemForKeyAsInteger (reg_data_addr_pystr, LLDB_INVALID_ADDRESS);
+ const char *name = thread_dict.GetItemForKeyAsString (name_pystr);
+ const char *queue = thread_dict.GetItemForKeyAsString (queue_pystr);
+ //const char *state = thread_dict.GetItemForKeyAsString (state_pystr);
+ //const char *stop_reason = thread_dict.GetItemForKeyAsString (stop_reason_pystr);
+
+ if (old_thread_list_ptr)
+ thread_sp = old_thread_list_ptr->FindThreadByID (tid, false);
+ if (!thread_sp)
+ {
+ if (did_create_ptr)
+ *did_create_ptr = true;
+ thread_sp.reset (new ThreadMemory (*m_process,
+ tid,
+ name,
+ queue,
+ reg_data_addr));
+ }
}
}
return thread_sp;
{
if (WaitForPacketWithTimeoutMicroSecondsNoLock (reply_packet, GetPacketTimeoutInMicroSeconds ()))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const uint8_t reply_command = reply_packet.GetU8 (&offset);
const uint8_t reply_sequence_id = reply_packet.GetU8 (&offset);
if ((reply_command & eCommandTypeMask) == command)
if (bytes_available >= 8)
{
packet.SetData (&m_bytes[0], bytes_available, m_byte_order);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint8_t reply_command = packet.GetU8(&offset);
switch (reply_command)
{
{
// Reset the sequence ID to zero for reattach
ClearKDPSettings ();
- uint32_t offset = 4;
+ lldb::offset_t offset = 4;
m_session_key = reply_packet.GetU32 (&offset);
return true;
}
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
m_kdp_version_version = reply_packet.GetU32 (&offset);
m_kdp_version_feature = reply_packet.GetU32 (&offset);
return true;
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
m_kdp_hostinfo_cpu_mask = reply_packet.GetU32 (&offset);
m_kdp_hostinfo_cpu_type = reply_packet.GetU32 (&offset);
m_kdp_hostinfo_cpu_subtype = reply_packet.GetU32 (&offset);
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
uint32_t src_len = reply_packet.GetByteSize() - 12;
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error)
error.SetErrorStringWithFormat ("kdp write memory failed (error %u)", kdp_error);
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error)
error.SetErrorStringWithFormat ("request packet 0x%8.8x failed (error %u)", command_byte, kdp_error);
}
else
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const uint8_t first_packet_byte = packet.GetU8 (&offset);
const uint8_t sequence_id = packet.GetU8 (&offset);
const uint16_t length = packet.GetU16 (&offset);
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
uint32_t src_len = reply_packet.GetByteSize() - 12;
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error == 0)
return src_len;
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error == 0)
return true;
void
ThreadKDP::SetStopInfoFrom_KDP_EXCEPTION (const DataExtractor &exc_reply_packet)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint8_t reply_command = exc_reply_packet.GetU8(&offset);
if (reply_command == CommunicationKDP::KDP_EXCEPTION)
{
}
const RegisterInfo *
-RegisterContextDarwin_arm::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextDarwin_arm::GetRegisterInfoAtIndex (size_t reg)
{
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
}
const RegisterSet *
-RegisterContextDarwin_arm::GetRegisterSet (uint32_t reg_set)
+RegisterContextDarwin_arm::GetRegisterSet (size_t reg_set)
{
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t set);
+ GetRegisterSet (size_t set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info,
}
const RegisterInfo *
-RegisterContextDarwin_i386::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextDarwin_i386::GetRegisterInfoAtIndex (size_t reg)
{
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
}
const RegisterSet *
-RegisterContextDarwin_i386::GetRegisterSet (uint32_t reg_set)
+RegisterContextDarwin_i386::GetRegisterSet (size_t reg_set)
{
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t set);
+ GetRegisterSet (size_t set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
const RegisterInfo *
-RegisterContextDarwin_x86_64::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextDarwin_x86_64::GetRegisterInfoAtIndex (size_t reg)
{
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
}
const RegisterSet *
-RegisterContextDarwin_x86_64::GetRegisterSet (uint32_t reg_set)
+RegisterContextDarwin_x86_64::GetRegisterSet (size_t reg_set)
{
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t set);
+ GetRegisterSet (size_t set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
}
const RegisterInfo *
-RegisterContextLLDB::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextLLDB::GetRegisterInfoAtIndex (size_t reg)
{
return m_thread.GetRegisterContext()->GetRegisterInfoAtIndex (reg);
}
}
const RegisterSet *
-RegisterContextLLDB::GetRegisterSet (uint32_t reg_set)
+RegisterContextLLDB::GetRegisterSet (size_t reg_set)
{
return m_thread.GetRegisterContext()->GetRegisterSet (reg_set);
}
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
}
const RegisterInfo *
-RegisterContextMacOSXFrameBackchain::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextMacOSXFrameBackchain::GetRegisterInfoAtIndex (size_t reg)
{
return m_thread.GetRegisterContext()->GetRegisterInfoAtIndex(reg);
}
const RegisterSet *
-RegisterContextMacOSXFrameBackchain::GetRegisterSet (uint32_t reg_set)
+RegisterContextMacOSXFrameBackchain::GetRegisterSet (size_t reg_set)
{
return m_thread.GetRegisterContext()->GetRegisterSet (reg_set);
}
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
}
const RegisterInfo *
-RegisterContextMemory::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextMemory::GetRegisterInfoAtIndex (size_t reg)
{
return m_reg_infos.GetRegisterInfoAtIndex (reg);
}
}
const RegisterSet *
-RegisterContextMemory::GetRegisterSet (uint32_t reg_set)
+RegisterContextMemory::GetRegisterSet (size_t reg_set)
{
return m_reg_infos.GetRegisterSet (reg_set);
}
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual uint32_t
ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num);
}
const RegisterInfo *
-GDBRemoteRegisterContext::GetRegisterInfoAtIndex (uint32_t reg)
+GDBRemoteRegisterContext::GetRegisterInfoAtIndex (size_t reg)
{
return m_reg_info.GetRegisterInfoAtIndex (reg);
}
const RegisterSet *
-GDBRemoteRegisterContext::GetRegisterSet (uint32_t reg_set)
+GDBRemoteRegisterContext::GetRegisterSet (size_t reg_set)
{
return m_reg_info.GetRegisterSet (reg_set);
}
static ConstString gpr_reg_set ("General Purpose Registers");
static ConstString sfp_reg_set ("Software Floating Point Registers");
static ConstString vfp_reg_set ("Floating Point Registers");
- uint32_t i;
+ size_t i;
if (from_scratch)
{
// Calculate the offsets of the registers
else
{
// Add composite registers to our primordial registers, then.
- const uint32_t num_composites = llvm::array_lengthof(g_composites);
- const uint32_t num_primordials = GetNumRegisters();
+ const size_t num_composites = llvm::array_lengthof(g_composites);
+ const size_t num_primordials = GetNumRegisters();
RegisterInfo *g_comp_register_infos = g_register_infos + (num_registers - num_composites);
for (i=0; i<num_composites; ++i)
{
lldb_private::ConstString ®_alt_name,
lldb_private::ConstString &set_name)
{
- const uint32_t reg_num = m_regs.size();
+ const uint32_t reg_num = (uint32_t)m_regs.size();
m_reg_names.push_back (reg_name);
m_reg_alt_names.push_back (reg_alt_name);
reg_info.name = reg_name.AsCString();
reg_info.invalidate_regs = m_invalidate_regs_map[reg_num].data();
}
m_regs.push_back (reg_info);
- uint32_t set = GetRegisterSetIndexByName (set_name, true);
+ uint32_t set = GetRegisterSetIndexByName (set_name);
assert (set < m_sets.size());
assert (set < m_set_reg_nums.size());
assert (set < m_set_names.size());
}
uint32_t
- GetRegisterSetIndexByName (lldb_private::ConstString &set_name, bool can_create)
+ GetRegisterSetIndexByName (lldb_private::ConstString &set_name)
{
name_collection::iterator pos, end = m_set_names.end();
for (pos = m_set_names.begin(); pos != end; ++pos)
{
if (*pos == set_name)
- return std::distance (m_set_names.begin(), pos);
+ return static_cast<uint32_t>(std::distance (m_set_names.begin(), pos));
}
m_set_names.push_back(set_name);
m_set_reg_nums.resize(m_set_reg_nums.size()+1);
lldb_private::RegisterSet new_set = { set_name.AsCString(), NULL, 0, NULL };
m_sets.push_back (new_set);
- return m_sets.size() - 1;
+ return static_cast<uint32_t>(m_sets.size() - 1);
}
uint32_t
for (pos = m_regs.begin(); pos != end; ++pos)
{
if (pos->kinds[kind] == num)
- return std::distance (m_regs.begin(), pos);
+ return static_cast<uint32_t>(std::distance (m_regs.begin(), pos));
}
return LLDB_INVALID_REGNUM;
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
DataExtractor data4 (buf, sizeof(buf), gdb_remote_arch.GetByteOrder(), 4);
if (DoReadMemory (0xffff0110, buf, 4, error) == 4)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
kernel_addr = data4.GetU32(&offset);
memory_module_sp = ReadModuleFromMemory (FileSpec("mach_kernel", false), kernel_addr, false, false);
if (!memory_module_sp.get()
DataExtractor data8 (buf, sizeof(buf), gdb_remote_arch.GetByteOrder(), 8);
if (DoReadMemory (0xffffff8000002010ULL, buf, 8, error) == 8)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
kernel_addr = data8.GetU64(&offset);
memory_module_sp = ReadModuleFromMemory (FileSpec("mach_kernel", false), kernel_addr, false, false);
if (!memory_module_sp.get()
Error error;
if (ReadMemory (m_dispatch_queue_offsets_addr, memory_buffer, sizeof(dispatch_queue_offsets), error) == sizeof(dispatch_queue_offsets))
{
- uint32_t data_offset = 0;
+ lldb::offset_t data_offset = 0;
if (data.GetU16(&data_offset, &dispatch_queue_offsets.dqo_version, sizeof(dispatch_queue_offsets)/sizeof(uint16_t)))
{
if (ReadMemory (thread_dispatch_qaddr, &memory_buffer, data.GetAddressByteSize(), error) == data.GetAddressByteSize())
}
bool
-DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, uint32_t* offset_ptr)
+DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, lldb::offset_t* offset_ptr)
{
return Extract(data, offset_ptr, data.GetULEB128(offset_ptr));
}
bool
-DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, uint32_t* offset_ptr, dw_uleb128_t code)
+DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr, dw_uleb128_t code)
{
m_code = code;
m_attributes.clear();
dw_attr_t attr;
dw_form_t form;
uint32_t i;
- dw_offset_t offset = debug_info_offset;
+ lldb::offset_t offset = debug_info_offset;
for (i = 0; i < num_abbr_decl_attributes; ++i)
{
void SetCode(dw_uleb128_t code) { m_code = code; }
dw_tag_t Tag() const { return m_tag; }
bool HasChildren() const { return m_has_children; }
- uint32_t NumAttributes() const { return m_attributes.size(); }
+ size_t NumAttributes() const { return m_attributes.size(); }
dw_attr_t GetAttrByIndex(uint32_t idx) const { return m_attributes.size() > idx ? m_attributes[idx].get_attr() : 0; }
dw_form_t GetFormByIndex(uint32_t idx) const { return m_attributes.size() > idx ? m_attributes[idx].get_form() : 0; }
bool GetAttrAndFormByIndex(uint32_t idx, dw_attr_t& attr, dw_form_t& form) const
const DWARFCompileUnit* cu,
const uint32_t strp_min_len);
uint32_t FindAttributeIndex(dw_attr_t attr) const;
- bool Extract(const lldb_private::DataExtractor& data, uint32_t* offset_ptr);
- bool Extract(const lldb_private::DataExtractor& data, uint32_t* offset_ptr, dw_uleb128_t code);
+ bool Extract(const lldb_private::DataExtractor& data, lldb::offset_t *offset_ptr);
+ bool Extract(const lldb_private::DataExtractor& data, lldb::offset_t *offset_ptr, dw_uleb128_t code);
// void Append(BinaryStreamBuf& out_buff) const;
bool IsValid();
void Dump(lldb_private::Stream *s) const;
void set_attr(dw_attr_t attr) { m_attr_form = (m_attr_form & 0x0000ffffu) | (attr << 16); }
void set_form(dw_form_t form) { m_attr_form = (m_attr_form & 0xffff0000u) | form; }
dw_attr_t get_attr() const { return m_attr_form >> 16; }
- dw_form_t get_form() const { return m_attr_form; }
+ dw_form_t get_form() const { return (dw_form_t)m_attr_form; }
void get(dw_attr_t& attr, dw_form_t& form) const
{
register uint32_t attr_form = m_attr_form;
attr = attr_form >> 16;
- form = attr_form;
+ form = (dw_form_t)attr_form;
}
bool operator == (const DWARFAttribute& rhs) const { return m_attr_form == rhs.m_attr_form; }
typedef std::vector<DWARFAttribute> collection;
}
bool
-DWARFCompileUnit::Extract(const DataExtractor &debug_info, uint32_t* offset_ptr)
+DWARFCompileUnit::Extract(const DataExtractor &debug_info, lldb::offset_t *offset_ptr)
{
Clear();
dw_offset_t
-DWARFCompileUnit::Extract(dw_offset_t offset, const DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs)
+DWARFCompileUnit::Extract(lldb::offset_t offset, const DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs)
{
Clear();
// Set the offset to that of the first DIE and calculate the start of the
// next compilation unit header.
- uint32_t offset = GetFirstDIEOffset();
- uint32_t next_cu_offset = GetNextCompileUnitOffset();
+ lldb::offset_t offset = GetFirstDIEOffset();
+ lldb::offset_t next_cu_offset = GetNextCompileUnitOffset();
DWARFDebugInfoEntry die;
// Keep a flat array of the DIE for binary lookup by DIE offset
// unit header).
if (offset > next_cu_offset)
{
- m_dwarf2Data->GetObjectFile()->GetModule()->ReportWarning ("DWARF compile unit extends beyond its bounds cu 0x%8.8x at 0x%8.8x\n",
+ m_dwarf2Data->GetObjectFile()->GetModule()->ReportWarning ("DWARF compile unit extends beyond its bounds cu 0x%8.8x at 0x%8.8" PRIx64 "\n",
GetOffset(),
offset);
}
DWARFCompileUnit(SymbolFileDWARF* dwarf2Data);
- bool Extract(const lldb_private::DataExtractor &debug_info, uint32_t* offset_ptr);
- dw_offset_t Extract(dw_offset_t offset, const lldb_private::DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs);
+ bool Extract(const lldb_private::DataExtractor &debug_info, lldb::offset_t *offset_ptr);
+ dw_offset_t Extract(lldb::offset_t offset, const lldb_private::DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs);
size_t ExtractDIEsIfNeeded (bool cu_die_only);
bool LookupAddress(
const dw_addr_t address,
// DWARFAbbreviationDeclarationSet::Extract()
//----------------------------------------------------------------------
bool
-DWARFAbbreviationDeclarationSet::Extract(const DataExtractor& data, uint32_t* offset_ptr)
+DWARFAbbreviationDeclarationSet::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr)
{
- const uint32_t begin_offset = *offset_ptr;
+ const lldb::offset_t begin_offset = *offset_ptr;
m_offset = begin_offset;
Clear();
DWARFAbbreviationDeclaration abbrevDeclaration;
void
DWARFDebugAbbrev::Parse(const DataExtractor& data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (data.ValidOffset(offset))
{
void Clear();
dw_offset_t GetOffset() const { return m_offset; }
void Dump(lldb_private::Stream *s) const;
- bool Extract(const lldb_private::DataExtractor& data, uint32_t* offset_ptr);
+ bool Extract(const lldb_private::DataExtractor& data, lldb::offset_t *offset_ptr);
//void Encode(BinaryStreamBuf& debug_abbrev_buf) const;
dw_uleb128_t AppendAbbrevDeclSequential(const DWARFAbbreviationDeclaration& abbrevDecl);
}
bool
-DWARFDebugArangeSet::Extract(const DataExtractor &data, uint32_t* offset_ptr)
+DWARFDebugArangeSet::Extract(const DataExtractor &data, lldb::offset_t *offset_ptr)
{
if (data.ValidOffset(*offset_ptr))
{
void SetHeader(uint16_t version, uint32_t cu_offset, uint8_t addr_size, uint8_t seg_size);
void AddDescriptor(const DWARFDebugArangeSet::Descriptor& range);
void Compact();
- bool Extract(const lldb_private::DataExtractor &data, uint32_t* offset_ptr);
+ bool Extract(const lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr);
void Dump(lldb_private::Stream *s) const;
dw_offset_t GetCompileUnitDIEOffset() const { return m_header.cu_offset; }
dw_offset_t GetOffsetOfNextEntry() const;
dw_offset_t FindAddress(dw_addr_t address) const;
- uint32_t NumDescriptors() const { return m_arange_descriptors.size(); }
+ size_t NumDescriptors() const { return m_arange_descriptors.size(); }
const Header& GetHeader() const { return m_header; }
const Descriptor* GetDescriptor(uint32_t i) const
{
{
if (debug_aranges_data.ValidOffset(0))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
DWARFDebugArangeSet set;
Range range;
{
return m_aranges.IsEmpty();
}
- uint32_t
+ size_t
GetNumRanges() const
{
return m_aranges.GetSize();
log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s/%s\" by parsing",
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetDirectory().GetCString(),
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetFilename().GetCString());
- const uint32_t num_compile_units = GetNumCompileUnits();
- uint32_t idx;
+ const size_t num_compile_units = GetNumCompileUnits();
const bool clear_dies_if_already_not_parsed = true;
- for (idx = 0; idx < num_compile_units; ++idx)
+ for (size_t idx = 0; idx < num_compile_units; ++idx)
{
DWARFCompileUnit* cu = GetCompileUnitAtIndex(idx);
if (cu)
{
if (m_dwarf2Data != NULL)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const DataExtractor &debug_info_data = m_dwarf2Data->get_debug_info_data();
while (debug_info_data.ValidOffset(offset))
{
}
}
-uint32_t
+size_t
DWARFDebugInfo::GetNumCompileUnits()
{
ParseCompileUnitHeadersIfNeeded();
{
if (dwarf2Data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t depth = 0;
DWARFCompileUnitSP cu(new DWARFCompileUnit(dwarf2Data));
if (cu.get() == NULL)
DWARFDebugInfoEntry** block_die);
void AddCompileUnit(DWARFCompileUnitSP& cu);
- uint32_t GetNumCompileUnits();
+ size_t GetNumCompileUnits();
bool ContainsCompileUnit (const DWARFCompileUnit *cu) const;
DWARFCompileUnit* GetCompileUnitAtIndex(uint32_t idx);
DWARFCompileUnitSP GetCompileUnit(dw_offset_t cu_offset, uint32_t* idx_ptr = NULL);
DWARFDebugInfoEntry::Attributes::ExtractFormValueAtIndex (SymbolFileDWARF* dwarf2Data, uint32_t i, DWARFFormValue &form_value) const
{
form_value.SetForm(FormAtIndex(i));
- dw_offset_t offset = DIEOffsetAtIndex(i);
+ lldb::offset_t offset = DIEOffsetAtIndex(i);
return form_value.ExtractValue(dwarf2Data->get_debug_info_data(), &offset, CompileUnitAtIndex(i));
}
const DataExtractor& debug_info_data,
const DWARFCompileUnit* cu,
const uint8_t *fixed_form_sizes,
- uint32_t* offset_ptr
+ lldb::offset_t *offset_ptr
)
{
m_offset = *offset_ptr;
if (m_abbr_idx)
{
- uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
const DWARFAbbreviationDeclaration *abbrevDecl = cu->GetAbbreviations()->GetAbbreviationDeclaration(m_abbr_idx);
(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- uint32_t* offset_ptr
+ lldb::offset_t *offset_ptr
)
{
const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data();
// const DataExtractor& debug_str_data = dwarf2Data->get_debug_str_data();
const uint32_t cu_end_offset = cu->GetNextCompileUnitOffset();
const uint8_t cu_addr_size = cu->GetAddressByteSize();
- uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
// if (offset >= cu_end_offset)
// Log::Error("DIE at offset 0x%8.8x is beyond the end of the current compile unit (0x%8.8x)", m_offset, cu_end_offset);
if ((offset < cu_end_offset) && debug_info_data.ValidOffset(offset))
if (dwarf2Data == NULL)
return false;
- dw_addr_t lo_pc = DW_INVALID_ADDRESS;
- dw_addr_t hi_pc = DW_INVALID_ADDRESS;
+ dw_addr_t lo_pc = LLDB_INVALID_ADDRESS;
+ dw_addr_t hi_pc = LLDB_INVALID_ADDRESS;
std::vector<dw_offset_t> die_offsets;
bool set_frame_base_loclist_addr = false;
- dw_offset_t offset;
+ lldb::offset_t offset;
const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset);
if (abbrevDecl)
if (loc_list_length > 0)
{
frame_base->SetOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length);
- if (lo_pc != DW_INVALID_ADDRESS)
+ if (lo_pc != LLDB_INVALID_ADDRESS)
{
assert (lo_pc >= cu->GetBaseAddress());
frame_base->SetLocationListSlide(lo_pc - cu->GetBaseAddress());
if (ranges.IsEmpty())
{
- if (lo_pc != DW_INVALID_ADDRESS)
+ if (lo_pc != LLDB_INVALID_ADDRESS)
{
- if (hi_pc != DW_INVALID_ADDRESS && hi_pc > lo_pc)
+ if (hi_pc != LLDB_INVALID_ADDRESS && hi_pc > lo_pc)
ranges.Append(DWARFDebugRanges::Range (lo_pc, hi_pc - lo_pc));
else
ranges.Append(DWARFDebugRanges::Range (lo_pc, 0));
) const
{
const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data();
- uint32_t offset = m_offset;
+ lldb::offset_t offset = m_offset;
if (debug_info_data.ValidOffset(offset))
{
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
const DataExtractor& debug_info_data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
Stream &s,
dw_attr_t attr,
dw_form_t form
{
if ( !verbose )
form_value.Dump(s, debug_str_data, cu);
- uint32_t ranges_offset = form_value.Unsigned();
+ lldb::offset_t ranges_offset = form_value.Unsigned();
dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0;
if (dwarf2Data)
DWARFDebugRanges::Dump(s, dwarf2Data->get_debug_ranges_data(), &ranges_offset, base_addr);
uint32_t curr_depth
) const
{
- uint32_t offset;
+ lldb::offset_t offset;
const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset);
if (abbrevDecl)
dw_offset_t* end_attr_offset_ptr
) const
{
- uint32_t offset;
+ lldb::offset_t offset;
const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset);
if (abbrevDecl)
// We have a location list offset as the value that is
// the offset into the .debug_loc section that describes
// the value over it's lifetime
- dw_offset_t debug_loc_offset = form_value.Unsigned();
+ lldb::offset_t debug_loc_offset = form_value.Unsigned();
if (dwarf2Data)
{
assert(dwarf2Data->get_debug_loc_data().GetAddressByteSize() == cu->GetAddressByteSize());
(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- const uint32_t die_offset,
+ const dw_offset_t die_offset,
Stream &s
)
{
}
DWARFDebugInfoEntry die;
- uint32_t offset = die_offset;
+ lldb::offset_t offset = die_offset;
if (die.Extract(dwarf2Data, cu, &offset))
{
if (die.IsNULL())
(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- const uint32_t die_offset,
+ const dw_offset_t die_offset,
Stream &s
)
{
}
DWARFDebugInfoEntry die;
- uint32_t offset = die_offset;
+ lldb::offset_t offset = die_offset;
if (die.Extract(dwarf2Data, cu, &offset))
{
if (die.IsNULL())
{
if (m_tag == DW_TAG_subprogram)
{
- dw_addr_t hi_pc = DW_INVALID_ADDRESS;
- dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (lo_pc != DW_INVALID_ADDRESS)
- hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, DW_INVALID_ADDRESS);
- if (hi_pc != DW_INVALID_ADDRESS)
+ dw_addr_t hi_pc = LLDB_INVALID_ADDRESS;
+ dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (lo_pc != LLDB_INVALID_ADDRESS)
+ hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, LLDB_INVALID_ADDRESS);
+ if (hi_pc != LLDB_INVALID_ADDRESS)
{
/// printf("BuildAddressRangeTable() 0x%8.8x: %30s: [0x%8.8x - 0x%8.8x)\n", m_offset, DW_TAG_value_to_name(tag), lo_pc, hi_pc);
debug_aranges->AppendRange (cu->GetOffset(), lo_pc, hi_pc);
{
if (m_tag == DW_TAG_subprogram)
{
- dw_addr_t hi_pc = DW_INVALID_ADDRESS;
- dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (lo_pc != DW_INVALID_ADDRESS)
- hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, DW_INVALID_ADDRESS);
- if (hi_pc != DW_INVALID_ADDRESS)
+ dw_addr_t hi_pc = LLDB_INVALID_ADDRESS;
+ dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (lo_pc != LLDB_INVALID_ADDRESS)
+ hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, LLDB_INVALID_ADDRESS);
+ if (hi_pc != LLDB_INVALID_ADDRESS)
{
// printf("BuildAddressRangeTable() 0x%8.8x: [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n", m_offset, lo_pc, hi_pc); // DEBUG ONLY
debug_aranges->AppendRange (GetOffset(), lo_pc, hi_pc);
if (match_addr_range)
{
- dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (lo_pc != DW_INVALID_ADDRESS)
+ dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (lo_pc != LLDB_INVALID_ADDRESS)
{
- dw_addr_t hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, DW_INVALID_ADDRESS);
- if (hi_pc != DW_INVALID_ADDRESS)
+ dw_addr_t hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, LLDB_INVALID_ADDRESS);
+ if (hi_pc != LLDB_INVALID_ADDRESS)
{
// printf("\n0x%8.8x: %30s: address = 0x%8.8x [0x%8.8x - 0x%8.8x) ", m_offset, DW_TAG_value_to_name(tag), address, lo_pc, hi_pc);
if ((lo_pc <= address) && (address < hi_pc))
const DWARFAbbreviationDeclaration*
DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr (SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit *cu,
- dw_offset_t &offset) const
+ lldb::offset_t &offset) const
{
if (dwarf2Data)
{
bool ContainsAttribute(dw_attr_t attr) const;
bool RemoveAttribute(dw_attr_t attr);
void Clear() { m_infos.clear(); }
- uint32_t Size() const { return m_infos.size(); }
+ size_t Size() const { return m_infos.size(); }
protected:
struct Info
const lldb_private::DataExtractor& debug_info_data,
const DWARFCompileUnit* cu,
const uint8_t *fixed_form_sizes,
- dw_offset_t* offset_ptr);
+ lldb::offset_t* offset_ptr);
bool Extract(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- dw_offset_t* offset_ptr);
+ lldb::offset_t* offset_ptr);
bool LookupAddress(
const dw_addr_t address,
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
const lldb_private::DataExtractor& debug_info_data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
lldb_private::Stream &s,
dw_attr_t attr,
dw_form_t form);
const DWARFAbbreviationDeclaration*
GetAbbreviationDeclarationPtr (SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit *cu,
- dw_offset_t &offset) const;
+ lldb::offset_t &offset) const;
dw_tag_t
Tag () const
DWARFDebugLine::Parse(const DataExtractor& debug_line_data)
{
m_lineTableMap.clear();
- dw_offset_t offset = 0;
+ lldb::offset_t offset = 0;
LineTable::shared_ptr line_table_sp(new LineTable);
while (debug_line_data.ValidOffset(offset))
{
- const uint32_t debug_line_offset = offset;
+ const lldb::offset_t debug_line_offset = offset;
if (line_table_sp.get() == NULL)
break;
{
if (debug_line_data.ValidOffset(debug_line_offset))
{
- uint32_t offset = debug_line_offset;
+ lldb::offset_t offset = debug_line_offset;
log->Printf( "----------------------------------------------------------------------\n"
"debug_line[0x%8.8x]\n"
"----------------------------------------------------------------------\n", debug_line_offset);
dw_offset_t
DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_data, const dw_offset_t debug_line_offset, uint32_t flags)
{
- uint32_t offset = debug_line_offset;
+ lldb::offset_t offset = debug_line_offset;
if (debug_line_data.ValidOffset(offset))
{
Prologue prologue;
else
{
offset = debug_line_offset;
- log->Printf( "0x%8.8x: skipping pad byte %2.2x", offset, debug_line_data.GetU8(&offset));
+ log->Printf( "0x%8.8" PRIx64 ": skipping pad byte %2.2x", offset, debug_line_data.GetU8(&offset));
return offset;
}
void
DWARFDebugLine::Parse(const DataExtractor& debug_line_data, DWARFDebugLine::State::Callback callback, void* userData)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (debug_line_data.ValidOffset(offset))
{
if (!ParseStatementTable(debug_line_data, &offset, callback, userData))
// DWARFDebugLine::ParsePrologue
//----------------------------------------------------------------------
bool
-DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, dw_offset_t* offset_ptr, Prologue* prologue)
+DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, lldb::offset_t* offset_ptr, Prologue* prologue)
{
- const uint32_t prologue_offset = *offset_ptr;
+ const lldb::offset_t prologue_offset = *offset_ptr;
//DEBUG_PRINTF("0x%8.8x: ParsePrologue()\n", *offset_ptr);
return false;
prologue->prologue_length = debug_line_data.GetU32(offset_ptr);
- const dw_offset_t end_prologue_offset = prologue->prologue_length + *offset_ptr;
+ const lldb::offset_t end_prologue_offset = prologue->prologue_length + *offset_ptr;
prologue->min_inst_length = debug_line_data.GetU8(offset_ptr);
prologue->default_is_stmt = debug_line_data.GetU8(offset_ptr);
prologue->line_base = debug_line_data.GetU8(offset_ptr);
if (*offset_ptr != end_prologue_offset)
{
Host::SystemLog (Host::eSystemLogWarning,
- "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8x\n",
- prologue_offset,
+ "warning: parsing line table prologue at 0x%8.8" PRIx64 " should have ended at 0x%8.8" PRIx64 " but it ended ad 0x%8.8" PRIx64 "\n",
+ prologue_offset,
end_prologue_offset,
*offset_ptr);
}
dw_offset_t stmt_list,
FileSpecList &support_files)
{
- uint32_t offset = stmt_list + 4; // Skip the total length
+ lldb::offset_t offset = stmt_list + 4; // Skip the total length
const char * s;
uint32_t version = debug_line_data.GetU16(&offset);
if (version != 2)
if (offset != end_prologue_offset)
{
Host::SystemLog (Host::eSystemLogError,
- "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8x\n",
+ "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8" PRIx64 "\n",
stmt_list,
end_prologue_offset,
offset);
DWARFDebugLine::ParseStatementTable
(
const DataExtractor& debug_line_data,
- dw_offset_t* offset_ptr,
+ lldb::offset_t* offset_ptr,
DWARFDebugLine::State::Callback callback,
void* userData
)
{
// Extended Opcodes always start with a zero opcode followed by
// a uleb128 length so you can skip ones you don't know about
- dw_offset_t ext_offset = *offset_ptr;
+ lldb::offset_t ext_offset = *offset_ptr;
dw_uleb128_t len = debug_line_data.GetULEB128(offset_ptr);
dw_offset_t arg_size = len - (*offset_ptr - ext_offset);
// the prologue and all rows.
//----------------------------------------------------------------------
bool
-DWARFDebugLine::ParseStatementTable(const DataExtractor& debug_line_data, uint32_t* offset_ptr, LineTable* line_table)
+DWARFDebugLine::ParseStatementTable(const DataExtractor& debug_line_data, lldb::offset_t *offset_ptr, LineTable* line_table)
{
return ParseStatementTable(debug_line_data, offset_ptr, ParseStatementTableCallback, line_table);
}
static bool DumpOpcodes(lldb_private::Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t line_offset = DW_INVALID_OFFSET, uint32_t dump_flags = 0); // If line_offset is invalid, dump everything
static bool DumpLineTableRows(lldb_private::Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t line_offset = DW_INVALID_OFFSET); // If line_offset is invalid, dump everything
static bool ParseSupportFiles(const lldb::ModuleSP &module_sp, const lldb_private::DataExtractor& debug_line_data, const char *cu_comp_dir, dw_offset_t stmt_list, lldb_private::FileSpecList &support_files);
- static bool ParsePrologue(const lldb_private::DataExtractor& debug_line_data, dw_offset_t* offset_ptr, Prologue* prologue);
- static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, dw_offset_t* offset_ptr, State::Callback callback, void* userData);
+ static bool ParsePrologue(const lldb_private::DataExtractor& debug_line_data, lldb::offset_t* offset_ptr, Prologue* prologue);
+ static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, lldb::offset_t* offset_ptr, State::Callback callback, void* userData);
static dw_offset_t DumpStatementTable(lldb_private::Log *log, const lldb_private::DataExtractor& debug_line_data, const dw_offset_t line_offset);
static dw_offset_t DumpStatementOpcodes(lldb_private::Log *log, const lldb_private::DataExtractor& debug_line_data, const dw_offset_t line_offset, uint32_t flags);
- static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, uint32_t* offset_ptr, LineTable* line_table);
+ static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, lldb::offset_t *offset_ptr, LineTable* line_table);
static void Parse(const lldb_private::DataExtractor& debug_line_data, DWARFDebugLine::State::Callback callback, void* userData);
// static void AppendLineTableData(const DWARFDebugLine::Prologue* prologue, const DWARFDebugLine::Row::collection& state_coll, const uint32_t addr_size, BinaryStreamBuf &debug_line_data);
}
void
-DWARFDebugMacinfo::Dump(Stream *s, const DataExtractor& macinfo_data, dw_offset_t offset)
+DWARFDebugMacinfo::Dump(Stream *s, const DataExtractor& macinfo_data, lldb::offset_t offset)
{
DWARFDebugMacinfoEntry maninfo_entry;
if (macinfo_data.GetByteSize() == 0)
s->PutCString("< EMPTY >\n");
return;
}
- if (offset == DW_INVALID_OFFSET)
+ if (offset == LLDB_INVALID_OFFSET)
{
offset = 0;
while (maninfo_entry.Extract(macinfo_data, &offset))
static void
Dump (lldb_private::Stream *s,
const lldb_private::DataExtractor& macinfo_data,
- dw_offset_t offset = DW_INVALID_OFFSET);
+ lldb::offset_t offset = LLDB_INVALID_OFFSET);
};
bool
-DWARFDebugMacinfoEntry::Extract(const DataExtractor& mac_info_data, dw_offset_t* offset_ptr)
+DWARFDebugMacinfoEntry::Extract(const DataExtractor& mac_info_data, lldb::offset_t* offset_ptr)
{
if (mac_info_data.ValidOffset(*offset_ptr))
{
bool
Extract(const lldb_private::DataExtractor& mac_info_data,
- dw_offset_t* offset_ptr);
+ lldb::offset_t* offset_ptr);
protected:
if (data.ValidOffset(0))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
DWARFDebugPubnamesSet set;
while (data.ValidOffset(offset))
bool
-DWARFDebugPubnamesSet::Extract(const DataExtractor& data, uint32_t* offset_ptr)
+DWARFDebugPubnamesSet::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr)
{
if (data.ValidOffset(*offset_ptr))
{
uint32_t NumDescriptors() const { return m_descriptors.size(); }
void AddDescriptor(dw_offset_t cu_rel_offset, const char* name);
void Clear();
- bool Extract(const lldb_private::DataExtractor& debug_pubnames_data, uint32_t* offset_ptr);
+ bool Extract(const lldb_private::DataExtractor& debug_pubnames_data, lldb::offset_t *offset_ptr);
void Dump(lldb_private::Log *s) const;
void InitNameIndexes() const;
void Find(const char* name, bool ignore_case, std::vector<dw_offset_t>& die_offset_coll) const;
DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data)
{
RangeList range_list;
- dw_offset_t offset = 0;
+ lldb::offset_t offset = 0;
dw_offset_t debug_ranges_offset = offset;
while (Extract(dwarf2Data, &offset, range_list))
{
//}
bool
-DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, uint32_t* offset_ptr, RangeList &range_list)
+DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, lldb::offset_t *offset_ptr, RangeList &range_list)
{
range_list.Clear();
- uint32_t range_offset = *offset_ptr;
+ lldb::offset_t range_offset = *offset_ptr;
const DataExtractor& debug_ranges_data = dwarf2Data->get_debug_ranges_data();
uint32_t addr_size = debug_ranges_data.GetAddressByteSize();
{
case 2:
if (begin == 0xFFFFull)
- begin = DW_INVALID_ADDRESS;
+ begin = LLDB_INVALID_ADDRESS;
break;
case 4:
if (begin == 0xFFFFFFFFull)
- begin = DW_INVALID_ADDRESS;
+ begin = LLDB_INVALID_ADDRESS;
break;
case 8:
return range_offset != *offset_ptr;
}
-//
-//dw_addr_t
-//DWARFDebugRanges::RangeList::LowestAddress(const dw_addr_t cu_base_addr) const
-//{
-// dw_addr_t addr = DW_INVALID_ADDRESS;
-// dw_addr_t curr_base_addr = cu_base_addr;
-// if (!ranges.empty())
-// {
-// Range::const_iterator pos = ranges.begin();
-// Range::const_iterator end_pos = ranges.end();
-// for (pos = ranges.begin(); pos != end_pos; ++pos)
-// {
-// if (pos->begin_offset == DW_INVALID_ADDRESS)
-// curr_base_addr = pos->end_offset;
-// else if (curr_base_addr != DW_INVALID_ADDRESS)
-// {
-// dw_addr_t curr_addr = curr_base_addr + pos->begin_offset;
-// if (addr > curr_addr)
-// addr = curr_addr;
-// }
-// }
-// }
-// return addr;
-//}
-//
-//dw_addr_t
-//DWARFDebugRanges::RangeList::HighestAddress(const dw_addr_t cu_base_addr) const
-//{
-// dw_addr_t addr = 0;
-// dw_addr_t curr_base_addr = cu_base_addr;
-// if (!ranges.empty())
-// {
-// Range::const_iterator pos = ranges.begin();
-// Range::const_iterator end_pos = ranges.end();
-// for (pos = ranges.begin(); pos != end_pos; ++pos)
-// {
-// if (pos->begin_offset == DW_INVALID_ADDRESS)
-// curr_base_addr = pos->end_offset;
-// else if (curr_base_addr != DW_INVALID_ADDRESS)
-// {
-// dw_addr_t curr_addr = curr_base_addr + pos->end_offset;
-// if (addr < curr_addr)
-// addr = curr_addr;
-// }
-// }
-// }
-// if (addr != 0)
-// return addr;
-// return DW_INVALID_ADDRESS;
-//}
-//
void
-DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr)
+DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, lldb::offset_t *offset_ptr, dw_addr_t cu_base_addr)
{
uint32_t addr_size = s.GetAddressByteSize();
bool verbose = s.GetVerbose();
// Extend 4 byte addresses that consits of 32 bits of 1's to be 64 bits
// of ones
if (begin == 0xFFFFFFFFull && addr_size == 4)
- begin = DW_INVALID_ADDRESS;
+ begin = LLDB_INVALID_ADDRESS;
s.Indent();
if (verbose)
s.PutCString(" End");
break;
}
- else if (begin == DW_INVALID_ADDRESS)
+ else if (begin == LLDB_INVALID_ADDRESS)
{
// A base address selection entry
base_addr = end;
DWARFDebugRanges();
~DWARFDebugRanges();
void Extract(SymbolFileDWARF* dwarf2Data);
- static void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr);
+ static void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor& debug_ranges_data, lldb::offset_t *offset_ptr, dw_addr_t cu_base_addr);
bool FindRanges(dw_offset_t debug_ranges_offset, DWARFDebugRanges::RangeList& range_list) const;
protected:
bool
Extract (SymbolFileDWARF* dwarf2Data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
RangeList &range_list);
typedef std::map<dw_offset_t, RangeList> range_map;
}
bool
-DWARFFormValue::ExtractValue(const DataExtractor& data, uint32_t* offset_ptr, const DWARFCompileUnit* cu)
+DWARFFormValue::ExtractValue(const DataExtractor& data, lldb::offset_t* offset_ptr, const DWARFCompileUnit* cu)
{
bool indirect = false;
bool is_block = false;
}
bool
-DWARFFormValue::SkipValue(const DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu) const
+DWARFFormValue::SkipValue(const DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const
{
return DWARFFormValue::SkipValue(m_form, debug_info_data, offset_ptr, cu);
}
bool
-DWARFFormValue::SkipValue(dw_form_t form, const DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu)
+DWARFFormValue::SkipValue(dw_form_t form, const DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu)
{
switch (form)
{
void SetForm(dw_form_t form) { m_form = form; }
const ValueType& Value() const { return m_value; }
void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const;
- bool ExtractValue(const lldb_private::DataExtractor& data, uint32_t* offset_ptr, const DWARFCompileUnit* cu);
+ bool ExtractValue(const lldb_private::DataExtractor& data,
+ lldb::offset_t* offset_ptr,
+ const DWARFCompileUnit* cu);
bool IsInlinedCStr() const { return (m_value.data != NULL) && m_value.data == (uint8_t*)m_value.value.cstr; }
const uint8_t* BlockData() const;
uint64_t Reference(const DWARFCompileUnit* cu) const;
int64_t Signed() const { return m_value.value.sval; }
void SetSigned(int64_t sval) { m_value.value.sval = sval; }
const char* AsCString(const lldb_private::DataExtractor* debug_str_data_ptr) const;
- bool SkipValue(const lldb_private::DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu) const;
- static bool SkipValue(const dw_form_t form, const lldb_private::DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu);
-// static bool TransferValue(dw_form_t form, const lldb_private::DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
+ bool SkipValue(const lldb_private::DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const;
+ static bool SkipValue(const dw_form_t form, const lldb_private::DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu);
+// static bool TransferValue(dw_form_t form, const lldb_private::DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
// static bool TransferValue(const DWARFFormValue& formValue, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
// static bool PutUnsigned(dw_form_t form, dw_offset_t offset, uint64_t value, BinaryStreamBuf& out_buff, const DWARFCompileUnit* cu, bool fixup_cu_relative_refs);
static bool IsBlockForm(const dw_form_t form);
using namespace lldb_private;
-static int print_dwarf_exp_op (Stream &s, const DataExtractor& data, uint32_t* offset_ptr, int address_size, int dwarf_ref_size);
+static int print_dwarf_exp_op (Stream &s, const DataExtractor& data, lldb::offset_t *offset_ptr, int address_size, int dwarf_ref_size);
int
print_dwarf_expression (Stream &s,
bool location_expression)
{
int op_count = 0;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (data.ValidOffset(offset))
{
if (location_expression && op_count > 0)
static int
print_dwarf_exp_op (Stream &s,
const DataExtractor& data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
int address_size,
int dwarf_ref_size)
{
using namespace lldb_private;
dw_offset_t
-DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtractor& debug_loc_data, dw_offset_t offset)
+DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtractor& debug_loc_data, lldb::offset_t offset)
{
uint64_t start_addr, end_addr;
uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu);
}
bool
-DWARFLocationList::Extract(const DataExtractor& debug_loc_data, dw_offset_t* offset_ptr, DataExtractor& location_list_data)
+DWARFLocationList::Extract(const DataExtractor& debug_loc_data, lldb::offset_t* offset_ptr, DataExtractor& location_list_data)
{
// Initialize with no data just in case we don't find anything
location_list_data.Clear();
}
size_t
-DWARFLocationList::Size(const DataExtractor& debug_loc_data, dw_offset_t offset)
+DWARFLocationList::Size(const DataExtractor& debug_loc_data, lldb::offset_t offset)
{
const dw_offset_t debug_loc_offset = offset;
Dump (lldb_private::Stream &s,
const DWARFCompileUnit* cu,
const lldb_private::DataExtractor& debug_loc_data,
- dw_offset_t offset);
+ lldb::offset_t offset);
static bool
Extract (const lldb_private::DataExtractor& debug_loc_data,
- dw_offset_t* offset_ptr,
+ lldb::offset_t* offset_ptr,
lldb_private::DataExtractor& location_list_data);
static size_t
Size (const lldb_private::DataExtractor& debug_loc_data,
- dw_offset_t offset);
+ lldb::offset_t offset);
};
#endif // SymbolFileDWARF_DWARFLocationList_h_
// void
// Dump (std::ostream* ostrm_ptr);
- uint32_t
- Read (const lldb_private::DataExtractor &data, uint32_t offset)
+ lldb::offset_t
+ Read (const lldb_private::DataExtractor &data,
+ lldb::offset_t offset)
{
ClearAtoms ();
// virtual void
// Dump (std::ostream* ostrm_ptr);
//
- virtual uint32_t
- Read (lldb_private::DataExtractor &data, uint32_t offset)
+ virtual lldb::offset_t
+ Read (lldb_private::DataExtractor &data, lldb::offset_t offset)
{
offset = MappedHash::Header<Prologue>::Read (data, offset);
if (offset != UINT32_MAX)
bool
Read (const lldb_private::DataExtractor &data,
- uint32_t *offset_ptr,
+ lldb::offset_t *offset_ptr,
DIEInfo &hash_data) const
{
const size_t num_atoms = header_data.atoms.size();
switch (header_data.atoms[i].type)
{
case eAtomTypeDIEOffset: // DIE offset, check form for encoding
- hash_data.offset = form_value.Reference (header_data.die_base_offset);
+ hash_data.offset = (dw_offset_t)form_value.Reference (header_data.die_base_offset);
break;
case eAtomTypeTag: // DW_TAG value for the DIE
- hash_data.tag = form_value.Unsigned ();
+ hash_data.tag = (dw_tag_t)form_value.Unsigned ();
case eAtomTypeTypeFlags: // Flags from enum TypeFlags
- hash_data.type_flags = form_value.Unsigned ();
+ hash_data.type_flags = (uint32_t)form_value.Unsigned ();
break;
default:
return false;
virtual Result
GetHashDataForName (const char *name,
- uint32_t* hash_data_offset_ptr,
+ lldb::offset_t* hash_data_offset_ptr,
Pair &pair) const
{
pair.key = m_data.GetU32 (hash_data_offset_ptr);
}
const uint32_t count = m_data.GetU32 (hash_data_offset_ptr);
- const uint32_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
+ const size_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
if (count > 0 && m_data.ValidOffsetForDataOfSize (*hash_data_offset_ptr, min_total_hash_data_size))
{
// We have at least one HashData entry, and we have enough
virtual Result
AppendHashDataForRegularExpression (const lldb_private::RegularExpression& regex,
- uint32_t* hash_data_offset_ptr,
+ lldb::offset_t* hash_data_offset_ptr,
Pair &pair) const
{
pair.key = m_data.GetU32 (hash_data_offset_ptr);
return eResultError;
const uint32_t count = m_data.GetU32 (hash_data_offset_ptr);
- const uint32_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
+ const size_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
if (count > 0 && m_data.ValidOffsetForDataOfSize (*hash_data_offset_ptr, min_total_hash_data_size))
{
const bool match = regex.Execute(strp_cstr);
Pair pair;
for (uint32_t offset_idx=0; offset_idx<hash_count; ++offset_idx)
{
- uint32_t hash_data_offset = GetHashDataOffset (offset_idx);
+ lldb::offset_t hash_data_offset = GetHashDataOffset (offset_idx);
while (hash_data_offset != UINT32_MAX)
{
- const uint32_t prev_hash_data_offset = hash_data_offset;
+ const lldb::offset_t prev_hash_data_offset = hash_data_offset;
Result hash_result = AppendHashDataForRegularExpression (regex, &hash_data_offset, pair);
if (prev_hash_data_offset == hash_data_offset)
break;
for (uint32_t offset_idx=0; offset_idx<hash_count; ++offset_idx)
{
bool done = false;
- uint32_t hash_data_offset = GetHashDataOffset (offset_idx);
+ lldb::offset_t hash_data_offset = GetHashDataOffset (offset_idx);
while (!done && hash_data_offset != UINT32_MAX)
{
KeyType key = m_data.GetU32 (&hash_data_offset);
SectionSP(),
llvm::OwningPtr<LineSequence>()
};
- uint32_t offset = cu_line_offset;
+ lldb::offset_t offset = cu_line_offset;
DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info);
sc.comp_unit->SetLineTable(line_table_ap.release());
return true;
{
const DWARFDebugInfoEntry *function_die = dwarf_cu->GetDIEPtr(sc.function->GetID());
- dw_addr_t func_lo_pc = function_die->GetAttributeValueAsUnsigned (this, dwarf_cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (func_lo_pc != DW_INVALID_ADDRESS)
+ dw_addr_t func_lo_pc = function_die->GetAttributeValueAsUnsigned (this, dwarf_cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (func_lo_pc != LLDB_INVALID_ADDRESS)
{
const size_t num_variables = ParseVariables(sc, dwarf_cu, func_lo_pc, function_die->GetFirstChild(), true, true);
clang_type_t
ClangASTContext::GetDirectBaseClassAtIndex (clang::ASTContext *ast,
clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr)
{
if (clang_type == NULL)
clang_type_t
ClangASTContext::GetVirtualBaseClassAtIndex (clang::ASTContext *ast,
clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr)
{
if (clang_type == NULL)
clang_type_t
ClangASTContext::GetFieldAtIndex (clang::ASTContext *ast,
clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
std::string& name,
uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
ExecutionContext *exe_ctx,
const char *parent_name,
clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
ASTContext *ast,
const char *parent_name,
clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
std::pair<uint64_t, unsigned> field_type_info = ast->getTypeInfo(array->getElementType());
char element_name[64];
- ::snprintf (element_name, sizeof (element_name), "[%u]", idx);
+ ::snprintf (element_name, sizeof (element_name), "[%zu]", idx);
child_name.assign(element_name);
assert(field_type_info.first % 8 == 0);
const clang::EnumDecl *enum_decl = enum_type->getDecl();
assert(enum_decl);
clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
- uint32_t offset = data_byte_offset;
+ lldb::offset_t offset = data_byte_offset;
const int64_t enum_value = data.GetMaxU64Bitfield(&offset, data_byte_size, bitfield_bit_size, bitfield_bit_offset);
for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
{
const clang::EnumDecl *enum_decl = enum_type->getDecl();
assert(enum_decl);
clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
- uint32_t offset = byte_offset;
+ lldb::offset_t offset = byte_offset;
const int64_t enum_value = data.GetMaxU64Bitfield (&offset, byte_size, bitfield_bit_size, bitfield_bit_offset);
for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
{
Process *process = exe_ctx->GetProcessPtr();
if (process)
{
- uint32_t offset = data_byte_offset;
+ lldb::offset_t offset = data_byte_offset;
lldb::addr_t pointer_addresss = data.GetMaxU64(&offset, data_byte_size);
std::vector<uint8_t> buf;
if (length > 0)
uint64_t bit_width = ast_context->getTypeSize(qual_type);
uint32_t byte_size = (bit_width + 7 ) / 8;
- uint32_t offset = data_byte_offset;
+ lldb::offset_t offset = data_byte_offset;
switch (encoding)
{
case lldb::eEncodingInvalid:
DWARFCallFrameInfo::ParseCIE (const dw_offset_t cie_offset)
{
CIESP cie_sp(new CIE(cie_offset));
- dw_offset_t offset = cie_offset;
+ lldb::offset_t offset = cie_offset;
if (m_cfi_data_initialized == false)
GetCFIData();
const uint32_t length = m_cfi_data.GetU32(&offset);
const dw_offset_t cie_id = m_cfi_data.GetU32(&offset);
const dw_offset_t end_offset = cie_offset + length + 4;
- if (length > 0 && ((!m_is_eh_frame && cie_id == 0xfffffffful) || (m_is_eh_frame && cie_id == 0ul)))
+ if (length > 0 && ((!m_is_eh_frame && cie_id == UINT32_MAX) || (m_is_eh_frame && cie_id == 0ul)))
{
size_t i;
// cie.offset = cie_offset;
if (m_fde_index_initialized) // if two threads hit the locker
return;
- dw_offset_t offset = 0;
+ lldb::offset_t offset = 0;
if (m_cfi_data_initialized == false)
GetCFIData();
while (m_cfi_data.ValidOffsetForDataOfSize (offset, 8))
}
bool
-DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t offset, Address startaddr, UnwindPlan& unwind_plan)
+DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr, UnwindPlan& unwind_plan)
{
- dw_offset_t current_entry = offset;
+ lldb::offset_t offset = dwarf_offset;
+ lldb::offset_t current_entry = offset;
if (m_section_sp.get() == NULL || m_section_sp->IsEncrypted())
return false;
bool is_artificial,
const lldb::SectionSP §ion_sp,
addr_t offset,
- uint32_t size,
+ addr_t size,
uint32_t flags
) :
SymbolContextScope (),
}
bool
-SymbolContextList::GetContextAtIndex(uint32_t idx, SymbolContext& sc) const
+SymbolContextList::GetContextAtIndex(size_t idx, SymbolContext& sc) const
{
if (idx < m_symbol_contexts.size())
{
}
bool
-SymbolContextList::RemoveContextAtIndex (uint32_t idx)
+SymbolContextList::RemoveContextAtIndex (size_t idx)
{
if (idx < m_symbol_contexts.size())
{
SymbolContextList::NumLineEntriesWithLine (uint32_t line) const
{
uint32_t match_count = 0;
- const uint32_t size = m_symbol_contexts.size();
- for (uint32_t idx = 0; idx<size; ++idx)
+ const size_t size = m_symbol_contexts.size();
+ for (size_t idx = 0; idx<size; ++idx)
{
if (m_symbol_contexts[idx].line_entry.line == line)
++match_count;
lldb::DescriptionLevel level,
Target *target) const
{
- const uint32_t size = m_symbol_contexts.size();
- for (uint32_t idx = 0; idx<size; ++idx)
+ const size_t size = m_symbol_contexts.size();
+ for (size_t idx = 0; idx<size; ++idx)
m_symbol_contexts[idx].GetDescription (s, level, target);
}
// We currently only have one debug symbol parser...
//----------------------------------------------------------------------
SymbolVendorCreateInstance create_callback;
- for (uint32_t idx = 0; (create_callback = PluginManager::GetSymbolVendorCreateCallbackAtIndex(idx)) != NULL; ++idx)
+ for (size_t idx = 0; (create_callback = PluginManager::GetSymbolVendorCreateCallbackAtIndex(idx)) != NULL; ++idx)
{
instance_ap.reset(create_callback(module_sp, feedback_strm));
}
bool
-SymbolVendor::SetCompileUnitAtIndex (uint32_t idx, const CompUnitSP &cu_sp)
+SymbolVendor::SetCompileUnitAtIndex (size_t idx, const CompUnitSP &cu_sp)
{
ModuleSP module_sp(GetModule());
if (module_sp)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
- const uint32_t num_compile_units = GetNumCompileUnits();
+ const size_t num_compile_units = GetNumCompileUnits();
if (idx < num_compile_units)
{
// Fire off an assertion if this compile unit already exists for now.
return false;
}
-uint32_t
+size_t
SymbolVendor::GetNumCompileUnits()
{
ModuleSP module_sp(GetModule());
return 0;
}
-uint32_t
-SymbolVendor::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
+size_t
+SymbolVendor::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, size_t max_matches, VariableList& variables)
{
ModuleSP module_sp(GetModule());
if (module_sp)
return 0;
}
-uint32_t
-SymbolVendor::FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables)
+size_t
+SymbolVendor::FindGlobalVariables (const RegularExpression& regex, bool append, size_t max_matches, VariableList& variables)
{
ModuleSP module_sp(GetModule());
if (module_sp)
return 0;
}
-uint32_t
+size_t
SymbolVendor::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list)
{
ModuleSP module_sp(GetModule());
return 0;
}
-uint32_t
+size_t
SymbolVendor::FindFunctions(const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list)
{
ModuleSP module_sp(GetModule());
}
-uint32_t
-SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types)
+size_t
+SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, size_t max_matches, TypeList& types)
{
ModuleSP module_sp(GetModule());
if (module_sp)
}
CompUnitSP
-SymbolVendor::GetCompileUnitAtIndex(uint32_t idx)
+SymbolVendor::GetCompileUnitAtIndex(size_t idx)
{
CompUnitSP cu_sp;
ModuleSP module_sp(GetModule());
if (module_sp)
{
- const uint32_t num_compile_units = GetNumCompileUnits();
+ const size_t num_compile_units = GetNumCompileUnits();
if (idx < num_compile_units)
{
cu_sp = m_compile_units[idx];
}
void
-Symtab::Reserve(uint32_t count)
+Symtab::Reserve(size_t count)
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
}
Symbol *
-Symtab::Resize(uint32_t count)
+Symtab::Resize(size_t count)
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
std::vector<uint32_t>::const_iterator end = m_addr_indexes.end();
for (pos = m_addr_indexes.begin(); pos != end; ++pos)
{
- uint32_t idx = *pos;
+ size_t idx = *pos;
if (idx < num_symbols)
{
s->Indent();
DumpSymbolHeader (s);
for (pos = indexes.begin(); pos != end; ++pos)
{
- uint32_t idx = *pos;
+ size_t idx = *pos;
if (idx < num_symbols)
{
s->Indent();
Symbol *
-Symtab::SymbolAtIndex(uint32_t idx)
+Symtab::SymbolAtIndex(size_t idx)
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
const Symbol *
-Symtab::SymbolAtIndex(uint32_t idx) const
+Symtab::SymbolAtIndex(size_t idx) const
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
Mutex::Locker locker (m_mutex);
const size_t count = m_symbols.size();
- for (uint32_t idx = start_idx; idx < count; ++idx)
+ for (size_t idx = start_idx; idx < count; ++idx)
{
if (symbol_type == eSymbolTypeAny || m_symbols[idx].GetType() == symbol_type)
{
}
VariableSP
-VariableList::GetVariableAtIndex(uint32_t idx) const
+VariableList::GetVariableAtIndex(size_t idx) const
{
VariableSP var_sp;
if (idx < m_variables.size())
}
VariableSP
-VariableList::RemoveVariableAtIndex(uint32_t idx)
+VariableList::RemoveVariableAtIndex(size_t idx)
{
VariableSP var_sp;
if (idx < m_variables.size())
}
else
{
- bp_site_sp.reset (new BreakpointSite (&m_breakpoint_site_list, owner, load_addr, LLDB_INVALID_THREAD_ID, use_hardware));
+ bp_site_sp.reset (new BreakpointSite (&m_breakpoint_site_list, owner, load_addr, use_hardware));
if (bp_site_sp)
{
if (EnableBreakpoint (bp_site_sp.get()).Success())
}
size_t
-Process::WriteScalarToMemory (addr_t addr, const Scalar &scalar, uint32_t byte_size, Error &error)
+Process::WriteScalarToMemory (addr_t addr, const Scalar &scalar, size_t byte_size, Error &error)
{
if (byte_size == UINT32_MAX)
byte_size = scalar.GetByteSize();
if (bytes_read == byte_size)
{
DataExtractor data (&uval, sizeof(uval), GetByteOrder(), GetAddressByteSize());
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (byte_size <= 4)
scalar = data.GetMaxU32 (&offset, byte_size);
else
if (bytes_read == byte_size)
{
DataExtractor data (&uval, sizeof(uval), m_arch.GetByteOrder(), m_arch.GetAddressByteSize());
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (byte_size <= 4)
scalar = data.GetMaxU32 (&offset, byte_size);
else
++m_index;
return ch;
}
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
}
}
if (set_eof_on_fail || m_index >= m_packet.size())
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
// Make sure we don't exceed the size of a uint32_t...
if (nibble_count >= (sizeof(uint32_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
// Make sure we don't exceed the size of a uint32_t...
if (nibble_count >= (sizeof(uint32_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
// Make sure we don't exceed the size of a uint64_t...
if (nibble_count >= (sizeof(uint64_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
// Make sure we don't exceed the size of a uint64_t...
if (nibble_count >= (sizeof(uint64_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
// Little Endian
uint32_t shift_amount;
for (i = 0, shift_amount = 0;
- i < byte_size && m_index != UINT32_MAX;
+ i < byte_size && IsGood();
++i, shift_amount += 8)
{
result |= ((uint64_t)GetHexU8() << shift_amount);
else
{
// Big Endian
- for (i = 0; i < byte_size && m_index != UINT32_MAX; ++i)
+ for (i = 0; i < byte_size && IsGood(); ++i)
{
result <<= 8;
result |= GetHexU8();
}
}
}
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
}
}
}
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return false;
}
bool
IsGood() const
{
- return m_index != UINT32_MAX;
+ return m_index != UINT64_MAX;
}
- uint32_t
+ uint64_t
GetFilePos () const
{
return m_index;
return m_packet.empty();
}
- uint32_t
+ size_t
GetBytesLeft ()
{
if (m_index < m_packet.size())
// For StringExtractor only
//------------------------------------------------------------------
std::string m_packet; // The string in which to extract data.
- uint32_t m_index; // When extracting data from a packet, this index
+ uint64_t m_index; // When extracting data from a packet, this index
// will march along as things get extracted. If set
- // to UINT32_MAX the end of the packet data was
+ // to UINT64_MAX the end of the packet data was
// reached when decoding information
};
assert(m_ptrSize != 0);
return GetMax64(offset_ptr, m_ptrSize);
}
-
-//----------------------------------------------------------------------
-// GetDwarfEHPtr
-//
-// Used for calls when the value type is specified by a DWARF EH Frame
-// pointer encoding.
-//----------------------------------------------------------------------
-/*
-uint64_t
-DNBDataRef::GetDwarfEHPtr(offset_t *offset_ptr, uint32_t encoding) const
-{
- if (encoding == DW_EH_PE_omit)
- return ULLONG_MAX; // Value isn't in the buffer...
-
- uint64_t baseAddress = 0;
- uint64_t addressValue = 0;
-
- BOOL signExtendValue = NO;
- // Decode the base part or adjust our offset
- switch (encoding & 0x70)
- {
- case DW_EH_PE_pcrel:
- // SetEHPtrBaseAddresses should be called prior to extracting these
- // so the base addresses are cached.
- assert(m_addrPCRelative != INVALID_NUB_ADDRESS);
- signExtendValue = YES;
- baseAddress = *offset_ptr + m_addrPCRelative;
- break;
-
- case DW_EH_PE_textrel:
- // SetEHPtrBaseAddresses should be called prior to extracting these
- // so the base addresses are cached.
- assert(m_addrTEXT != INVALID_NUB_ADDRESS);
- signExtendValue = YES;
- baseAddress = m_addrTEXT;
- break;
-
- case DW_EH_PE_datarel:
- // SetEHPtrBaseAddresses should be called prior to extracting these
- // so the base addresses are cached.
- assert(m_addrDATA != INVALID_NUB_ADDRESS);
- signExtendValue = YES;
- baseAddress = m_addrDATA;
- break;
-
- case DW_EH_PE_funcrel:
- signExtendValue = YES;
- break;
-
- case DW_EH_PE_aligned:
- // SetPointerSize should be called prior to extracting these so the
- // pointer size is cached
- assert(m_ptrSize != 0);
- if (m_ptrSize)
- {
- // Align to a address size boundary first
- uint32_t alignOffset = *offset_ptr % m_ptrSize;
- if (alignOffset)
- offset_ptr += m_ptrSize - alignOffset;
- }
- break;
-
- default:
- break;
- }
-
- // Decode the value part
- switch (encoding & DW_EH_PE_MASK_ENCODING)
- {
- case DW_EH_PE_absptr : addressValue = GetPointer(offset_ptr); break;
- case DW_EH_PE_uleb128 : addressValue = Get_ULEB128(offset_ptr); break;
- case DW_EH_PE_udata2 : addressValue = Get16(offset_ptr); break;
- case DW_EH_PE_udata4 : addressValue = Get32(offset_ptr); break;
- case DW_EH_PE_udata8 : addressValue = Get64(offset_ptr); break;
- case DW_EH_PE_sleb128 : addressValue = Get_SLEB128(offset_ptr); break;
- case DW_EH_PE_sdata2 : addressValue = (int16_t)Get16(offset_ptr); break;
- case DW_EH_PE_sdata4 : addressValue = (int32_t)Get32(offset_ptr); break;
- case DW_EH_PE_sdata8 : addressValue = (int64_t)Get64(offset_ptr); break;
- default:
- // Unhandled encoding type
- assert(encoding);
- break;
- }
-
- // Since we promote everything to 64 bit, we may need to sign extend
- if (signExtendValue && m_ptrSize < sizeof(baseAddress))
- {
- uint64_t sign_bit = 1ull << ((m_ptrSize * 8ull) - 1ull);
- if (sign_bit & addressValue)
- {
- uint64_t mask = ~sign_bit + 1;
- addressValue |= mask;
- }
- }
- return baseAddress + addressValue;
-}
-*/
-
-
//----------------------------------------------------------------------
// GetCStr
//----------------------------------------------------------------------