diff options
Diffstat (limited to 'lldb/source/Plugins')
76 files changed, 416 insertions, 454 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp index d25c9b427a7..3a9f767cfc7 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp @@ -548,7 +548,7 @@ ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj { 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); diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp index 7390b5596cb..03592522833 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp @@ -722,7 +722,7 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb { 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); diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index c412c1f6459..fbb18ddce02 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -588,7 +588,7 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb 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); @@ -727,7 +727,7 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, DataExtractor data; if (xmm0_value.GetData(data)) { - uint32_t offset = 0; + lldb::offset_t offset = 0; switch (bit_width) { default: diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 7522a1ced16..ec715293bd1 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -68,7 +68,7 @@ public: 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 @@ -239,7 +239,7 @@ public: 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: @@ -486,8 +486,8 @@ DisassemblerLLVMC::~DisassemblerLLVMC() 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) diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h index 5f9bcc837ee..c6c3e6652bb 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h @@ -50,8 +50,8 @@ public: 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); //------------------------------------------------------------------ diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 0cb04468fbb..5aa8869091f 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -612,7 +612,7 @@ DynamicLoaderDarwinKernel::ReadKextSummaryHeader () 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) { @@ -723,7 +723,7 @@ DynamicLoaderDarwinKernel::ReadKextSummaries (const Address &kext_summary_addr, 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; diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 22cc1d56d86..dd34da370db 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -279,7 +279,7 @@ DynamicLoaderMacOSXDYLD::LocateDYLD() 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) { @@ -449,8 +449,8 @@ DynamicLoaderMacOSXDYLD::UpdateCommPageLoadAddress(Module *module) 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) @@ -490,8 +490,8 @@ DynamicLoaderMacOSXDYLD::UpdateImageLoadAddress (Module *module, DYLDImageInfo& 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 @@ -585,8 +585,8 @@ DynamicLoaderMacOSXDYLD::UnloadImageLoadAddress (Module *module, DYLDImageInfo& 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) @@ -715,7 +715,7 @@ DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure () 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 @@ -740,7 +740,6 @@ DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure () 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) { @@ -767,10 +766,7 @@ DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure () 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) @@ -1049,7 +1045,7 @@ DynamicLoaderMacOSXDYLD::ReadImageInfos (lldb::addr_t image_infos_addr, 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++) { @@ -1167,7 +1163,7 @@ DynamicLoaderMacOSXDYLD::ReadMachHeader (lldb::addr_t addr, llvm::MachO::mach_he 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 @@ -1229,7 +1225,7 @@ DynamicLoaderMacOSXDYLD::ReadMachHeader (lldb::addr_t addr, llvm::MachO::mach_he 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); @@ -1242,7 +1238,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, DYLDImage 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) @@ -1276,7 +1272,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, DYLDImage 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); } diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp index 17d9da054ca..de4d1e77b88 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp @@ -26,21 +26,25 @@ using namespace lldb_private; 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; @@ -57,7 +61,7 @@ void AuxVector::ParseAuxv(DataExtractor &data) { const unsigned int byte_size = m_process->GetAddressByteSize(); - uint32_t offset = 0; + lldb::offset_t offset = 0; for (;;) { diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp index 6b9b8d6baa2..b57f2c5b0b3 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -304,7 +304,7 @@ DYLDRendezvous::DumpToLog(LogSP log) const 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()); diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h index 3402a72ce91..81cb74f153b 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h @@ -73,7 +73,7 @@ public: 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 @@ -92,7 +92,7 @@ public: 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 diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index 2cd340980c1..494cf92bc37 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -90,10 +90,10 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value, 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: @@ -255,8 +255,8 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value, 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. diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index 545a8cae624..782b74a43fe 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -385,7 +385,7 @@ AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded() 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); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index cfe7d13c697..6c4223784cd 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -1256,7 +1256,7 @@ private: 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; @@ -1315,7 +1315,7 @@ private: 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); @@ -1386,13 +1386,13 @@ private: 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); @@ -1422,7 +1422,7 @@ private: 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); @@ -1465,7 +1465,7 @@ private: 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); @@ -1508,7 +1508,7 @@ private: 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); @@ -1555,7 +1555,7 @@ private: 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); @@ -2176,11 +2176,11 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded() 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)); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index 1e35a2f9661..7766f5cd2aa 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -194,12 +194,12 @@ AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion() 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. @@ -239,16 +239,16 @@ AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion() // 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) @@ -256,7 +256,7 @@ AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion() 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: @@ -427,8 +427,8 @@ AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines (void *baton, 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); diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 97aed1a323b..d61a88b51af 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -49,8 +49,8 @@ ObjectContainerBSDArchive::Object::Clear() 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; @@ -98,7 +98,7 @@ ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, uint32_t ar_file_size = ar_size - ar_name_len; return offset; } - return LLDB_INVALID_INDEX32; + return LLDB_INVALID_OFFSET; } ObjectContainerBSDArchive::Archive::Archive @@ -120,7 +120,7 @@ size_t 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) { @@ -128,9 +128,9 @@ ObjectContainerBSDArchive::Archive::ParseObjects (DataExtractor &data) 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); @@ -147,7 +147,7 @@ ObjectContainerBSDArchive::Archive::ParseObjects (DataExtractor &data) 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; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h index ce245b1f54b..22779a1848a 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h @@ -97,8 +97,8 @@ protected: 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 @@ -106,8 +106,8 @@ protected: 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; @@ -170,14 +170,14 @@ protected: 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 diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp index 2241bc773a5..5641c265675 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -75,7 +75,7 @@ ObjectContainerUniversalMachO::CreateInstance 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; } @@ -105,7 +105,7 @@ ObjectContainerUniversalMachO::ParseHeader () { // 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); diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp index bfff9f3336e..d9cac0d06b3 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp @@ -23,20 +23,24 @@ using namespace llvm::ELF; // 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) { @@ -51,19 +55,23 @@ GetMaxU64(const lldb_private::DataExtractor &data, 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) { @@ -95,7 +103,7 @@ ELFHeader::GetByteOrder() const } 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) @@ -190,7 +198,7 @@ ELFSectionHeader::ELFSectionHeader() bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data, - uint32_t *offset) + lldb::offset_t *offset) { const unsigned byte_size = data.GetAddressByteSize(); @@ -226,7 +234,7 @@ ELFSymbol::ELFSymbol() } 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; @@ -276,7 +284,7 @@ ELFProgramHeader::ELFProgramHeader() 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; @@ -320,7 +328,7 @@ ELFDynamic::ELFDynamic() } 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); @@ -335,7 +343,7 @@ ELFRel::ELFRel() } 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(); @@ -355,7 +363,7 @@ ELFRela::ELFRela() } 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(); diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h index 45798574ccc..77e5cda3980 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h @@ -123,7 +123,7 @@ struct ELFHeader /// 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 @@ -181,7 +181,7 @@ struct ELFSectionHeader /// 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); }; //------------------------------------------------------------------------------ @@ -216,7 +216,7 @@ struct ELFProgramHeader /// 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); }; //------------------------------------------------------------------------------ @@ -259,7 +259,7 @@ struct ELFSymbol /// @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); }; //------------------------------------------------------------------------------ @@ -292,7 +292,7 @@ struct ELFDynamic /// 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); }; //------------------------------------------------------------------------------ @@ -320,7 +320,7 @@ struct ELFRel /// @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 @@ -379,7 +379,7 @@ struct ELFRela /// @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 diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index e357aff0e64..a430c264499 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -53,7 +53,7 @@ public: ~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); @@ -94,7 +94,7 @@ ELFRelocation::~ELFRelocation() } 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); @@ -270,28 +270,28 @@ ObjectFileELF::GetByteOrder() const 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); } @@ -445,8 +445,8 @@ ObjectFileELF::ParseDependentModules() 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. @@ -492,7 +492,7 @@ ObjectFileELF::ParseProgramHeaders() 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) @@ -530,7 +530,7 @@ ObjectFileELF::ParseSectionHeaders() 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) @@ -698,9 +698,8 @@ ParseSymbols(Symtab *symtab, 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"); @@ -877,8 +876,8 @@ ObjectFileELF::ParseDynamicSymbols() 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) { @@ -956,9 +955,9 @@ ParsePLTRelocations(Symtab *symbol_table, { 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; @@ -985,7 +984,7 @@ ParsePLTRelocations(Symtab *symbol_table, 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)) @@ -1378,7 +1377,7 @@ ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type) // 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)) ? '+' : ' ') diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index 9bf6d734e11..f347c7b3118 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -84,7 +84,7 @@ public: virtual bool IsExecutable () const; - virtual size_t + virtual uint32_t GetAddressByteSize() const; virtual lldb_private::Symtab * @@ -168,11 +168,11 @@ private: 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 @@ -282,7 +282,7 @@ private: static void DumpELFSectionHeader_sh_flags(lldb_private::Stream *s, - elf::elf_word sh_flags); + elf::elf_xword sh_flags); //@} /// ELF dependent module dump routine. diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 926f17f6648..ce47b58a461 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -58,7 +58,7 @@ public: 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); @@ -166,7 +166,7 @@ public: 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); @@ -273,7 +273,7 @@ public: 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); @@ -472,7 +472,7 @@ ObjectFileMachO::MagicBytesMatch (DataBufferSP& data_sp, { 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; } @@ -522,7 +522,7 @@ ObjectFileMachO::ParseHeader () { 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); @@ -612,7 +612,7 @@ ObjectFileMachO::IsExecutable() const return m_header.filetype == HeaderFileTypeExecutable; } -size_t +uint32_t ObjectFileMachO::GetAddressByteSize () const { return m_data.GetAddressByteSize (); @@ -769,7 +769,7 @@ ObjectFileMachO::ParseSections () { 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; @@ -780,7 +780,7 @@ ObjectFileMachO::ParseSections () 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; @@ -805,7 +805,7 @@ ObjectFileMachO::ParseSections () 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; @@ -826,7 +826,7 @@ ObjectFileMachO::ParseSections () // 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; @@ -1209,14 +1209,14 @@ ObjectFileMachO::ParseSymtab (bool minimize) 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) @@ -1282,13 +1282,14 @@ ObjectFileMachO::ParseSymtab (bool minimize) 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; @@ -1420,7 +1421,7 @@ ObjectFileMachO::ParseSymtab (bool minimize) { 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) @@ -1431,11 +1432,11 @@ ObjectFileMachO::ParseSymtab (bool minimize) } } - 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; @@ -1457,7 +1458,7 @@ ObjectFileMachO::ParseSymtab (bool minimize) 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; @@ -1547,7 +1548,7 @@ ObjectFileMachO::ParseSymtab (bool minimize) 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); @@ -1566,7 +1567,7 @@ ObjectFileMachO::ParseSymtab (bool minimize) // 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; @@ -2382,7 +2383,7 @@ ObjectFileMachO::ParseSymtab (bool minimize) 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; @@ -3191,7 +3192,7 @@ ObjectFileMachO::ParseSymtab (bool minimize) { 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); @@ -3299,11 +3300,11 @@ ObjectFileMachO::GetUUID (lldb_private::UUID* uuid) { 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; @@ -3346,7 +3347,7 @@ ObjectFileMachO::GetDependentModules (FileSpecList& files) { 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) @@ -3419,14 +3420,14 @@ ObjectFileMachO::GetEntryPointAddress () { 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; @@ -3563,7 +3564,7 @@ ObjectFileMachO::GetNumThreadContexts () 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) @@ -3729,13 +3730,13 @@ ObjectFileMachO::GetVersion (uint32_t *versions, uint32_t num_versions) { 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; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h index e6a4931de1d..6075bb53782 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -85,7 +85,7 @@ public: virtual bool IsExecutable () const; - virtual size_t + virtual uint32_t GetAddressByteSize () const; virtual lldb::AddressClass diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 8447a88d1dc..6bfe69503e9 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -169,7 +169,7 @@ bool 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; } @@ -206,7 +206,7 @@ ObjectFilePECOFF::ParseHeader () 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()) { @@ -239,7 +239,7 @@ ObjectFilePECOFF::IsExecutable() const 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) @@ -271,7 +271,7 @@ bool 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) @@ -326,7 +326,7 @@ ObjectFilePECOFF::ParseDOSHeader () // 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) @@ -345,10 +345,10 @@ ObjectFilePECOFF::ParseCOFFHeader(uint32_t* offset_ptr) } 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; @@ -429,7 +429,7 @@ ObjectFilePECOFF::ParseSectionHeaders (uint32_t section_header_data_offset) 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); @@ -462,8 +462,8 @@ ObjectFilePECOFF::GetSectionName(std::string& sect_name, const section_header_t& { 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) { @@ -503,7 +503,7 @@ ObjectFilePECOFF::GetSymtab() // 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); diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h index 2e41ce4ff2b..446999c6c84 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h @@ -68,7 +68,7 @@ public: virtual bool IsExecutable () const; - virtual size_t + virtual uint32_t GetAddressByteSize () const; // virtual lldb_private::AddressClass @@ -212,8 +212,8 @@ protected: } 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); diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index ddc5467ffe9..d867c891b33 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -215,30 +215,33 @@ OperatingSystemPython::CreateThreadFromThreadInfo (PythonDictionary &thread_dict 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; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index 8e658a50022..32b77ab5d08 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -122,7 +122,7 @@ CommunicationKDP::SendRequestAndGetReply (const CommandType command, { 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) @@ -273,7 +273,7 @@ CommunicationKDP::CheckForPacket (const uint8_t *src, size_t src_len, DataExtrac 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) { @@ -406,7 +406,7 @@ CommunicationKDP::SendRequestReattach (uint16_t reply_port) { // 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; } @@ -440,7 +440,7 @@ CommunicationKDP::SendRequestVersion () 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; @@ -568,7 +568,7 @@ CommunicationKDP::SendRequestHostInfo () 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); @@ -648,7 +648,7 @@ CommunicationKDP::SendRequestReadMemory (lldb::addr_t addr, 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; @@ -696,7 +696,7 @@ CommunicationKDP::SendRequestWriteMemory (lldb::addr_t addr, 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); @@ -730,7 +730,7 @@ CommunicationKDP::SendRawRequest (uint8_t command_byte, 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); @@ -799,7 +799,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet) } 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); @@ -1152,7 +1152,7 @@ CommunicationKDP::SendRequestReadRegisters (uint32_t cpu, 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; @@ -1200,7 +1200,7 @@ CommunicationKDP::SendRequestWriteRegisters (uint32_t cpu, 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; @@ -1247,7 +1247,7 @@ CommunicationKDP::SendRequestBreakpoint (bool set, addr_t addr) 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; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp index 920fccf351c..33c5e47d0b2 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -194,7 +194,7 @@ ThreadKDP::GetPrivateStopReason () 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) { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp index eacdef1fe1d..4d77b6f20fd 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp @@ -416,7 +416,7 @@ RegisterContextDarwin_arm::GetRegisterCount () } 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) @@ -464,7 +464,7 @@ RegisterContextDarwin_arm::GetRegisterSetCount () } 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]; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h index b8e91b7b19b..75832c8f85c 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h @@ -64,13 +64,13 @@ public: 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, diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp index f07dbffd1ff..a94d1f538a2 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp @@ -298,7 +298,7 @@ RegisterContextDarwin_i386::GetRegisterCount () } 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) @@ -410,7 +410,7 @@ RegisterContextDarwin_i386::GetRegisterSetCount () } 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]; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h index e2cde590a91..a588494f9dc 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h @@ -34,13 +34,13 @@ public: 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); diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp index 7d97dbd3e41..433782fe20c 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp @@ -336,7 +336,7 @@ RegisterContextDarwin_x86_64::GetRegisterCount () 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) @@ -457,7 +457,7 @@ RegisterContextDarwin_x86_64::GetRegisterSetCount () } 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]; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h index a36b8cb8731..4b8127af997 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h @@ -33,13 +33,13 @@ public: 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); diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index fa8dcd3d179..cb691c552f1 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -760,7 +760,7 @@ RegisterContextLLDB::GetRegisterCount () } const RegisterInfo * -RegisterContextLLDB::GetRegisterInfoAtIndex (uint32_t reg) +RegisterContextLLDB::GetRegisterInfoAtIndex (size_t reg) { return m_thread.GetRegisterContext()->GetRegisterInfoAtIndex (reg); } @@ -772,7 +772,7 @@ RegisterContextLLDB::GetRegisterSetCount () } const RegisterSet * -RegisterContextLLDB::GetRegisterSet (uint32_t reg_set) +RegisterContextLLDB::GetRegisterSet (size_t reg_set) { return m_thread.GetRegisterContext()->GetRegisterSet (reg_set); } diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h index 1b60996dfb5..572d119446f 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h @@ -46,13 +46,13 @@ public: 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); diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp index 6cfad1eb0dd..2c3eee45248 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp @@ -59,7 +59,7 @@ RegisterContextMacOSXFrameBackchain::GetRegisterCount () } const RegisterInfo * -RegisterContextMacOSXFrameBackchain::GetRegisterInfoAtIndex (uint32_t reg) +RegisterContextMacOSXFrameBackchain::GetRegisterInfoAtIndex (size_t reg) { return m_thread.GetRegisterContext()->GetRegisterInfoAtIndex(reg); } @@ -73,7 +73,7 @@ RegisterContextMacOSXFrameBackchain::GetRegisterSetCount () const RegisterSet * -RegisterContextMacOSXFrameBackchain::GetRegisterSet (uint32_t reg_set) +RegisterContextMacOSXFrameBackchain::GetRegisterSet (size_t reg_set) { return m_thread.GetRegisterContext()->GetRegisterSet (reg_set); } diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h index cc6cb5d5d8c..449e053e5ef 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h @@ -42,13 +42,13 @@ public: 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); diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp index 9f8e2b56ca7..8c33a6814ac 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp @@ -80,7 +80,7 @@ RegisterContextMemory::GetRegisterCount () } const RegisterInfo * -RegisterContextMemory::GetRegisterInfoAtIndex (uint32_t reg) +RegisterContextMemory::GetRegisterInfoAtIndex (size_t reg) { return m_reg_infos.GetRegisterInfoAtIndex (reg); } @@ -92,7 +92,7 @@ RegisterContextMemory::GetRegisterSetCount () } const RegisterSet * -RegisterContextMemory::GetRegisterSet (uint32_t reg_set) +RegisterContextMemory::GetRegisterSet (size_t reg_set) { return m_reg_infos.GetRegisterSet (reg_set); } diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h index 062f27aa9b4..8bba52c627f 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h @@ -46,13 +46,13 @@ public: 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); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index 921d08eaa65..c5e86736f96 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -85,7 +85,7 @@ GDBRemoteRegisterContext::GetRegisterCount () } const RegisterInfo * -GDBRemoteRegisterContext::GetRegisterInfoAtIndex (uint32_t reg) +GDBRemoteRegisterContext::GetRegisterInfoAtIndex (size_t reg) { return m_reg_info.GetRegisterInfoAtIndex (reg); } @@ -99,7 +99,7 @@ GDBRemoteRegisterContext::GetRegisterSetCount () const RegisterSet * -GDBRemoteRegisterContext::GetRegisterSet (uint32_t reg_set) +GDBRemoteRegisterContext::GetRegisterSet (size_t reg_set) { return m_reg_info.GetRegisterSet (reg_set); } @@ -857,7 +857,7 @@ GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch) 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 @@ -905,8 +905,8 @@ GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch) 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) { diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h index d052449e9b0..3110ddf8edf 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h @@ -51,7 +51,7 @@ public: 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(); @@ -73,7 +73,7 @@ public: 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()); @@ -129,20 +129,20 @@ public: } 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 @@ -152,7 +152,7 @@ public: 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; @@ -217,13 +217,13 @@ public: 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); diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 07ced0df798..bdeb8671857 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -596,7 +596,7 @@ ProcessGDBRemote::CheckForKernel (Stream *strm) 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() @@ -616,7 +616,7 @@ ProcessGDBRemote::CheckForKernel (Stream *strm) 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() @@ -3041,7 +3041,7 @@ ProcessGDBRemote::GetDispatchQueueNameForThread 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()) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp index 989e49452fb..06e87eab33c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp @@ -32,13 +32,13 @@ DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag, uint8_t } 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(); @@ -155,7 +155,7 @@ DWARFAbbreviationDeclaration::CopyChangingStringToStrp( 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) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h index f748ab141af..f462b7fc108 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h @@ -32,7 +32,7 @@ public: 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 @@ -63,8 +63,8 @@ public: 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; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h index 2d875875e1e..8310b1dda5f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h @@ -25,12 +25,12 @@ public: 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; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 08a022f8e68..5d93d194056 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -68,7 +68,7 @@ DWARFCompileUnit::Clear() } bool -DWARFCompileUnit::Extract(const DataExtractor &debug_info, uint32_t* offset_ptr) +DWARFCompileUnit::Extract(const DataExtractor &debug_info, lldb::offset_t *offset_ptr) { Clear(); @@ -103,7 +103,7 @@ DWARFCompileUnit::Extract(const DataExtractor &debug_info, uint32_t* offset_ptr) 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(); @@ -167,8 +167,8 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (bool cu_die_only) // 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 @@ -273,7 +273,7 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (bool cu_die_only) // 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); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h index c400497f0b2..acbbdf1c2a6 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -29,8 +29,8 @@ public: 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, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp index fcf20c1cf48..47657d5089b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp @@ -30,9 +30,9 @@ DWARFAbbreviationDeclarationSet::Clear() // 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; @@ -144,7 +144,7 @@ DWARFDebugAbbrev::DWARFDebugAbbrev() : void DWARFDebugAbbrev::Parse(const DataExtractor& data) { - uint32_t offset = 0; + lldb::offset_t offset = 0; while (data.ValidOffset(offset)) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h index 98bddd99c98..eba439928a2 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h @@ -43,7 +43,7 @@ public: 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); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp index 81dc58cc312..b1eb27299ef 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp @@ -162,7 +162,7 @@ DWARFDebugArangeSet::AddDescriptor(const DWARFDebugArangeSet::Descriptor& range) } 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)) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h index 5c1c44e50dd..19ec8d042e7 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h @@ -41,12 +41,12 @@ public: 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 { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index 94519a472f1..bcf62b88fef 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -60,7 +60,7 @@ DWARFDebugAranges::Extract(const DataExtractor &debug_aranges_data) { if (debug_aranges_data.ValidOffset(0)) { - uint32_t offset = 0; + lldb::offset_t offset = 0; DWARFDebugArangeSet set; Range range; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h index e17a37da542..88db929226a 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h @@ -66,7 +66,7 @@ public: { return m_aranges.IsEmpty(); } - uint32_t + size_t GetNumRanges() const { return m_aranges.GetSize(); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 5395a6adae7..2015b2441f1 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -73,10 +73,9 @@ DWARFDebugInfo::GetCompileUnitAranges () 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) @@ -148,7 +147,7 @@ DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() { 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)) { @@ -168,7 +167,7 @@ DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() } } -uint32_t +size_t DWARFDebugInfo::GetNumCompileUnits() { ParseCompileUnitHeadersIfNeeded(); @@ -395,7 +394,7 @@ DWARFDebugInfo::Parse(SymbolFileDWARF* dwarf2Data, Callback callback, void* user { if (dwarf2Data) { - uint32_t offset = 0; + lldb::offset_t offset = 0; uint32_t depth = 0; DWARFCompileUnitSP cu(new DWARFCompileUnit(dwarf2Data)); if (cu.get() == NULL) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h index b9010cdefaa..c716fa423ff 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -45,7 +45,7 @@ public: 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); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 5411ee59bb4..949d6d08488 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -89,7 +89,7 @@ bool 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)); } @@ -119,7 +119,7 @@ DWARFDebugInfoEntry::FastExtract 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; @@ -134,7 +134,7 @@ DWARFDebugInfoEntry::FastExtract if (m_abbr_idx) { - uint32_t offset = *offset_ptr; + lldb::offset_t offset = *offset_ptr; const DWARFAbbreviationDeclaration *abbrevDecl = cu->GetAbbreviations()->GetAbbreviationDeclaration(m_abbr_idx); @@ -273,14 +273,14 @@ DWARFDebugInfoEntry::Extract ( 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)) @@ -745,12 +745,12 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges 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) @@ -859,7 +859,7 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges 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()); @@ -882,9 +882,9 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges 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)); @@ -934,7 +934,7 @@ DWARFDebugInfoEntry::Dump ) 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)) { @@ -1028,7 +1028,7 @@ DWARFDebugInfoEntry::DumpAttribute 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 @@ -1158,7 +1158,7 @@ DWARFDebugInfoEntry::DumpAttribute { 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); @@ -1190,7 +1190,7 @@ DWARFDebugInfoEntry::GetAttributes uint32_t curr_depth ) const { - uint32_t offset; + lldb::offset_t offset; const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset); if (abbrevDecl) @@ -1287,7 +1287,7 @@ DWARFDebugInfoEntry::GetAttributeValue dw_offset_t* end_attr_offset_ptr ) const { - uint32_t offset; + lldb::offset_t offset; const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset); if (abbrevDecl) @@ -1438,7 +1438,7 @@ DWARFDebugInfoEntry::GetAttributeValueAsLocation // 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()); @@ -1553,7 +1553,7 @@ DWARFDebugInfoEntry::GetName ( SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit* cu, - const uint32_t die_offset, + const dw_offset_t die_offset, Stream &s ) { @@ -1564,7 +1564,7 @@ DWARFDebugInfoEntry::GetName } DWARFDebugInfoEntry die; - uint32_t offset = die_offset; + lldb::offset_t offset = die_offset; if (die.Extract(dwarf2Data, cu, &offset)) { if (die.IsNULL()) @@ -1602,7 +1602,7 @@ DWARFDebugInfoEntry::AppendTypeName ( SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit* cu, - const uint32_t die_offset, + const dw_offset_t die_offset, Stream &s ) { @@ -1613,7 +1613,7 @@ DWARFDebugInfoEntry::AppendTypeName } DWARFDebugInfoEntry die; - uint32_t offset = die_offset; + lldb::offset_t offset = die_offset; if (die.Extract(dwarf2Data, cu, &offset)) { if (die.IsNULL()) @@ -1720,11 +1720,11 @@ DWARFDebugInfoEntry::BuildAddressRangeTable { 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); @@ -1761,11 +1761,11 @@ DWARFDebugInfoEntry::BuildFunctionAddressRangeTable { 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); @@ -2052,11 +2052,11 @@ DWARFDebugInfoEntry::LookupAddress 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)) @@ -2166,7 +2166,7 @@ DWARFDebugInfoEntry::LookupAddress const DWARFAbbreviationDeclaration* DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr (SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit *cu, - dw_offset_t &offset) const + lldb::offset_t &offset) const { if (dwarf2Data) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h index 0a97bbd1ec7..a77801fe265 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h @@ -75,7 +75,7 @@ public: 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 @@ -145,12 +145,12 @@ public: 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, @@ -277,7 +277,7 @@ public: 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); @@ -304,7 +304,7 @@ public: const DWARFAbbreviationDeclaration* GetAbbreviationDeclarationPtr (SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit *cu, - dw_offset_t &offset) const; + lldb::offset_t &offset) const; dw_tag_t Tag () const diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp index 77fd4eed5d9..0a19aa2cbdd 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -35,11 +35,11 @@ void 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; @@ -135,7 +135,7 @@ DWARFDebugLine::DumpStatementTable(Log *log, const DataExtractor& debug_line_dat { 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); @@ -185,7 +185,7 @@ DWARFDebugLine::DumpOpcodes(Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t d 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; @@ -200,7 +200,7 @@ DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_d 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; } @@ -388,7 +388,7 @@ DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_d 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)) @@ -401,9 +401,9 @@ DWARFDebugLine::Parse(const DataExtractor& debug_line_data, DWARFDebugLine::Stat // 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); @@ -416,7 +416,7 @@ DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, dw_offset_t* 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); @@ -459,8 +459,8 @@ DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, dw_offset_t* 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); } @@ -474,7 +474,7 @@ DWARFDebugLine::ParseSupportFiles (const lldb::ModuleSP &module_sp, 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) @@ -554,7 +554,7 @@ DWARFDebugLine::ParseSupportFiles (const lldb::ModuleSP &module_sp, 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); @@ -573,7 +573,7 @@ bool DWARFDebugLine::ParseStatementTable ( const DataExtractor& debug_line_data, - dw_offset_t* offset_ptr, + lldb::offset_t* offset_ptr, DWARFDebugLine::State::Callback callback, void* userData ) @@ -613,7 +613,7 @@ DWARFDebugLine::ParseStatementTable { // 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); @@ -873,7 +873,7 @@ ParseStatementTableCallback(dw_offset_t offset, const DWARFDebugLine::State& sta // 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); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h index 8c7ab6d8259..ade8f9bd9f7 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h @@ -197,11 +197,11 @@ public: 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); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp index 0501da8fe40..60ace9e8229 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp @@ -26,7 +26,7 @@ DWARFDebugMacinfo::~DWARFDebugMacinfo() } 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) @@ -34,7 +34,7 @@ DWARFDebugMacinfo::Dump(Stream *s, const DataExtractor& macinfo_data, dw_offset_ s->PutCString("< EMPTY >\n"); return; } - if (offset == DW_INVALID_OFFSET) + if (offset == LLDB_INVALID_OFFSET) { offset = 0; while (maninfo_entry.Extract(macinfo_data, &offset)) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h index 85ddebd1ff2..f35ff165f1f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h @@ -22,7 +22,7 @@ public: 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); }; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp index 0aaeb7e0249..5cd9cb6be47 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp @@ -80,7 +80,7 @@ DWARFDebugMacinfoEntry::Dump(Stream *s) const 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)) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h index f701c178204..46fd44a22a6 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h @@ -39,7 +39,7 @@ public: bool Extract(const lldb_private::DataExtractor& mac_info_data, - dw_offset_t* offset_ptr); + lldb::offset_t* offset_ptr); protected: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp index 11e8d4c004d..8e7191e4cb4 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp @@ -40,7 +40,7 @@ DWARFDebugPubnames::Extract(const DataExtractor& data) if (data.ValidOffset(0)) { - uint32_t offset = 0; + lldb::offset_t offset = 0; DWARFDebugPubnamesSet set; while (data.ValidOffset(offset)) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp index 0421ced55d4..2df8d525f03 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp @@ -78,7 +78,7 @@ DWARFDebugPubnamesSet::InitNameIndexes() const 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)) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h index adf93d5a194..941c83e58a4 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h @@ -70,7 +70,7 @@ public: 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; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp index f69b370b515..461b17fc3ab 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp @@ -28,7 +28,7 @@ void 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)) { @@ -82,11 +82,11 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data) //} 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(); @@ -105,12 +105,12 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, uint32_t* offset_ptr, Ran { 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: @@ -130,60 +130,9 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, uint32_t* offset_ptr, Ran 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(); @@ -196,7 +145,7 @@ DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32 // 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) @@ -210,7 +159,7 @@ DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32 s.PutCString(" End"); break; } - else if (begin == DW_INVALID_ADDRESS) + else if (begin == LLDB_INVALID_ADDRESS) { // A base address selection entry base_addr = end; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h index 82a82edfaf3..40899abe9c2 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h @@ -26,14 +26,14 @@ public: 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; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp index 3288404b236..48232656b61 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -114,7 +114,7 @@ DWARFFormValue::DWARFFormValue(dw_form_t form) : } 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; @@ -178,13 +178,13 @@ DWARFFormValue::ExtractValue(const DataExtractor& data, uint32_t* offset_ptr, co } 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) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h index 5051a5125f2..751653c7925 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h @@ -49,7 +49,9 @@ public: 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; @@ -60,9 +62,9 @@ public: 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); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp index 81492a992f2..fdc07836b88 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp @@ -15,7 +15,7 @@ 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, @@ -25,7 +25,7 @@ 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) @@ -48,7 +48,7 @@ print_dwarf_expression (Stream &s, 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) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp index ff65d08e5fc..dad5691267d 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp @@ -18,7 +18,7 @@ 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); @@ -52,7 +52,7 @@ DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtract } 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(); @@ -69,7 +69,7 @@ DWARFLocationList::Extract(const DataExtractor& debug_loc_data, dw_offset_t* off } 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; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h index a0163c0c3d3..85e11d90b36 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h @@ -19,16 +19,16 @@ public: 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_ diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h index 3aa1c13e289..8ed2e50dcfc 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h @@ -306,8 +306,9 @@ struct DWARFMappedHash // 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 (); @@ -379,8 +380,8 @@ struct DWARFMappedHash // 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) @@ -392,7 +393,7 @@ struct DWARFMappedHash 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(); @@ -409,14 +410,14 @@ struct DWARFMappedHash 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; @@ -559,7 +560,7 @@ struct DWARFMappedHash 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); @@ -580,7 +581,7 @@ struct DWARFMappedHash } 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 @@ -637,7 +638,7 @@ struct DWARFMappedHash 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); @@ -653,7 +654,7 @@ struct DWARFMappedHash 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); @@ -712,10 +713,10 @@ struct DWARFMappedHash 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; @@ -749,7 +750,7 @@ struct DWARFMappedHash 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); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 6858659f426..32a98cc185b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1206,7 +1206,7 @@ SymbolFileDWARF::ParseCompileUnitLineTable (const SymbolContext &sc) 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; @@ -6858,8 +6858,8 @@ SymbolFileDWARF::ParseVariablesForContext (const SymbolContext& sc) { 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); |