diff options
Diffstat (limited to 'source/Plugins/SymbolFile/DWARF')
42 files changed, 352 insertions, 269 deletions
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp index 06e87eab33ce..ff2e3762556a 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp @@ -32,13 +32,13 @@ DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag, uint8_t } bool -DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, lldb::offset_t* offset_ptr) +DWARFAbbreviationDeclaration::Extract(const DWARFDataExtractor& data, lldb::offset_t* offset_ptr) { return Extract(data, offset_ptr, data.GetULEB128(offset_ptr)); } bool -DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr, dw_uleb128_t code) +DWARFAbbreviationDeclaration::Extract(const DWARFDataExtractor& data, lldb::offset_t *offset_ptr, dw_uleb128_t code) { m_code = code; m_attributes.clear(); @@ -139,7 +139,7 @@ DWARFAbbreviationDeclaration::CopyExcludingAddressAttributes(const DWARFAbbrevia void DWARFAbbreviationDeclaration::CopyChangingStringToStrp( const DWARFAbbreviationDeclaration& abbr_decl, - const DataExtractor& debug_info_data, + const DWARFDataExtractor& debug_info_data, dw_offset_t debug_info_offset, const DWARFCompileUnit* cu, const uint32_t strp_min_len diff --git a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h index f462b7fc108d..48b9ebe37ee7 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h @@ -58,13 +58,13 @@ public: void CopyExcludingAddressAttributes(const DWARFAbbreviationDeclaration& abbr_decl, const uint32_t idx); void CopyChangingStringToStrp( const DWARFAbbreviationDeclaration& abbr_decl, - const lldb_private::DataExtractor& debug_info_data, + const lldb_private::DWARFDataExtractor& debug_info_data, dw_offset_t debug_info_offset, const DWARFCompileUnit* cu, const uint32_t strp_min_len); uint32_t FindAttributeIndex(dw_attr_t attr) const; - 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); + bool Extract(const lldb_private::DWARFDataExtractor& data, lldb::offset_t *offset_ptr); + bool Extract(const lldb_private::DWARFDataExtractor& 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/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h b/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h index 8310b1dda5f1..40c8af3d6e8e 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h @@ -28,7 +28,7 @@ public: 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; + uint32_t attr_form = m_attr_form; attr = attr_form >> 16; form = (dw_form_t)attr_form; } diff --git a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 493b3af6ecd1..cf664db28acd 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -69,7 +69,7 @@ DWARFCompileUnit::Clear() } bool -DWARFCompileUnit::Extract(const DataExtractor &debug_info, lldb::offset_t *offset_ptr) +DWARFCompileUnit::Extract(const DWARFDataExtractor &debug_info, lldb::offset_t *offset_ptr) { Clear(); @@ -103,30 +103,6 @@ DWARFCompileUnit::Extract(const DataExtractor &debug_info, lldb::offset_t *offse } -dw_offset_t -DWARFCompileUnit::Extract(lldb::offset_t offset, const DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs) -{ - Clear(); - - m_offset = offset; - - if (debug_info_data.ValidOffset(offset)) - { - m_length = debug_info_data.GetU32(&offset); - m_version = debug_info_data.GetU16(&offset); - bool abbrevs_OK = debug_info_data.GetU32(&offset) == abbrevs->GetOffset(); - m_abbrevs = abbrevs; - m_addr_size = debug_info_data.GetU8 (&offset); - - bool version_OK = SymbolFileDWARF::SupportedVersion(m_version); - bool addr_size_OK = ((m_addr_size == 4) || (m_addr_size == 8)); - - if (version_OK && addr_size_OK && abbrevs_OK && debug_info_data.ValidOffset(offset)) - return offset; - } - return DW_INVALID_OFFSET; -} - void DWARFCompileUnit::ClearDIEs(bool keep_compile_unit_die) { @@ -187,7 +163,7 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (bool cu_die_only) uint32_t depth = 0; // We are in our compile unit, parse starting at the offset // we were told to parse - const DataExtractor& debug_info_data = m_dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = m_dwarf2Data->get_debug_info_data(); std::vector<uint32_t> die_index_stack; die_index_stack.reserve(32); die_index_stack.push_back(0); @@ -312,7 +288,7 @@ DWARFCompileUnit::GetAbbrevOffset() const bool DWARFCompileUnit::Verify(Stream *s) const { - const DataExtractor& debug_info = m_dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor& debug_info = m_dwarf2Data->get_debug_info_data(); bool valid_offset = debug_info.ValidOffset(m_offset); bool length_OK = debug_info.ValidOffset(GetNextCompileUnitOffset()-1); bool version_OK = SymbolFileDWARF::SupportedVersion(m_version); @@ -612,7 +588,7 @@ DWARFCompileUnit::Index (const uint32_t cu_idx, NameToDIE& types, NameToDIE& namespaces) { - const DataExtractor* debug_str = &m_dwarf2Data->get_debug_str_data(); + const DWARFDataExtractor* debug_str = &m_dwarf2Data->get_debug_str_data(); const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (GetAddressByteSize()); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h index 9fee0a2d2236..35597f389423 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -29,8 +29,7 @@ public: DWARFCompileUnit(SymbolFileDWARF* dwarf2Data); - 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); + bool Extract(const lldb_private::DWARFDataExtractor &debug_info, lldb::offset_t *offset_ptr); size_t ExtractDIEsIfNeeded (bool cu_die_only); bool LookupAddress( const dw_addr_t address, diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp new file mode 100644 index 000000000000..9bf47cd7a9ac --- /dev/null +++ b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp @@ -0,0 +1,30 @@ +//===-- DWARFDataExtractor.cpp ----------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "DWARFDataExtractor.h" + +namespace lldb_private { + +uint64_t +DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const +{ + uint64_t length = GetU32(offset_ptr); + m_is_dwarf64 = (length == UINT32_MAX); + if (m_is_dwarf64) + length = GetU64(offset_ptr); + return length; +} + +dw_offset_t +DWARFDataExtractor::GetDWARFOffset(lldb::offset_t *offset_ptr) const +{ + return GetMaxU64(offset_ptr, m_is_dwarf64 ? 8 : 4); +} + +} diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h new file mode 100644 index 000000000000..6e5b974a71ff --- /dev/null +++ b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h @@ -0,0 +1,43 @@ +//===-- DWARFDataExtractor.h ------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_DWARFDataExtractor_h_ +#define liblldb_DWARFDataExtractor_h_ + +// Other libraries and framework includes. +#include "lldb/Core/DataExtractor.h" +#include "lldb/Core/dwarf.h" + +namespace lldb_private { + +class DWARFDataExtractor : public lldb_private::DataExtractor +{ +public: + DWARFDataExtractor() : DataExtractor(), m_is_dwarf64(false) { }; + + DWARFDataExtractor (const DWARFDataExtractor& data, lldb::offset_t offset, lldb::offset_t length) : + DataExtractor(data, offset, length), m_is_dwarf64(false) { }; + + uint64_t + GetDWARFInitialLength(lldb::offset_t *offset_ptr) const; + + dw_offset_t + GetDWARFOffset(lldb::offset_t *offset_ptr) const; + + size_t + GetDWARFSizeofInitialLength() const { return m_is_dwarf64 ? 12 : 4; } + +protected: + mutable bool m_is_dwarf64; +}; + +} + +#endif // liblldb_DWARFDataExtractor_h_ + diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp index 47657d5089b2..6773d0762a21 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "DWARFDebugAbbrev.h" -#include "lldb/Core/DataExtractor.h" +#include "DWARFDataExtractor.h" #include "lldb/Core/Stream.h" using namespace lldb; @@ -30,7 +30,7 @@ DWARFAbbreviationDeclarationSet::Clear() // DWARFAbbreviationDeclarationSet::Extract() //---------------------------------------------------------------------- bool -DWARFAbbreviationDeclarationSet::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr) +DWARFAbbreviationDeclarationSet::Extract(const DWARFDataExtractor& data, lldb::offset_t *offset_ptr) { const lldb::offset_t begin_offset = *offset_ptr; m_offset = begin_offset; @@ -142,7 +142,7 @@ DWARFDebugAbbrev::DWARFDebugAbbrev() : // DWARFDebugAbbrev::Parse() //---------------------------------------------------------------------- void -DWARFDebugAbbrev::Parse(const DataExtractor& data) +DWARFDebugAbbrev::Parse(const DWARFDataExtractor& data) { lldb::offset_t offset = 0; diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h index eba439928a2c..8ec2c4ba8e21 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h +++ b/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, lldb::offset_t *offset_ptr); + bool Extract(const lldb_private::DWARFDataExtractor& data, lldb::offset_t *offset_ptr); //void Encode(BinaryStreamBuf& debug_abbrev_buf) const; dw_uleb128_t AppendAbbrevDeclSequential(const DWARFAbbreviationDeclaration& abbrevDecl); @@ -65,7 +65,7 @@ public: DWARFDebugAbbrev(); const DWARFAbbreviationDeclarationSet* GetAbbreviationDeclarationSet(dw_offset_t cu_abbr_offset) const; void Dump(lldb_private::Stream *s) const; - void Parse(const lldb_private::DataExtractor& data); + void Parse(const lldb_private::DWARFDataExtractor& data); protected: DWARFAbbreviationDeclarationCollMap m_abbrevCollMap; mutable DWARFAbbreviationDeclarationCollMapConstIter m_prev_abbr_offset_pos; diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp index b1eb27299efb..d083f8a615c4 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp @@ -162,7 +162,7 @@ DWARFDebugArangeSet::AddDescriptor(const DWARFDebugArangeSet::Descriptor& range) } bool -DWARFDebugArangeSet::Extract(const DataExtractor &data, lldb::offset_t *offset_ptr) +DWARFDebugArangeSet::Extract(const DWARFDataExtractor &data, lldb::offset_t *offset_ptr) { if (data.ValidOffset(*offset_ptr)) { @@ -183,9 +183,9 @@ DWARFDebugArangeSet::Extract(const DataExtractor &data, lldb::offset_t *offset_p // descriptor on the target system. This header is followed by a series // of tuples. Each tuple consists of an address and a length, each in // the size appropriate for an address on the target architecture. - m_header.length = data.GetU32(offset_ptr); + m_header.length = data.GetDWARFInitialLength(offset_ptr); m_header.version = data.GetU16(offset_ptr); - m_header.cu_offset = data.GetU32(offset_ptr); + m_header.cu_offset = data.GetDWARFOffset(offset_ptr); m_header.addr_size = data.GetU8(offset_ptr); m_header.seg_size = data.GetU8(offset_ptr); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h index 19ec8d042e72..fde36b7e0adc 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h @@ -41,7 +41,7 @@ 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, lldb::offset_t *offset_ptr); + bool Extract(const lldb_private::DWARFDataExtractor &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; diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index 3b004c4b3890..4f77bff86bdc 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -56,7 +56,7 @@ public: // Extract //---------------------------------------------------------------------- bool -DWARFDebugAranges::Extract(const DataExtractor &debug_aranges_data) +DWARFDebugAranges::Extract(const DWARFDataExtractor &debug_aranges_data) { if (debug_aranges_data.ValidOffset(0)) { diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h index 88db929226ab..206aa3a60f49 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h @@ -35,7 +35,7 @@ public: } bool - Extract(const lldb_private::DataExtractor &debug_aranges_data); + Extract(const lldb_private::DWARFDataExtractor &debug_aranges_data); bool Generate(SymbolFileDWARF* dwarf2Data); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 4c76eed8166f..d4db12c17a40 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -57,7 +57,7 @@ DWARFDebugInfo::GetCompileUnitAranges () Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES)); m_cu_aranges_ap.reset (new DWARFDebugAranges()); - const DataExtractor &debug_aranges_data = m_dwarf2Data->get_debug_aranges_data(); + const DWARFDataExtractor &debug_aranges_data = m_dwarf2Data->get_debug_aranges_data(); if (debug_aranges_data.GetByteSize() > 0) { if (log) @@ -66,18 +66,35 @@ DWARFDebugInfo::GetCompileUnitAranges () m_cu_aranges_ap->Extract (debug_aranges_data); } - else + + // Make a list of all CUs represented by the arange data in the file. + std::set<dw_offset_t> cus_with_data; + for (size_t n=0;n<m_cu_aranges_ap.get()->GetNumRanges();n++) { - if (log) - log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" by parsing", - m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str()); - const size_t num_compile_units = GetNumCompileUnits(); - const bool clear_dies_if_already_not_parsed = true; - for (size_t idx = 0; idx < num_compile_units; ++idx) + dw_offset_t offset = m_cu_aranges_ap.get()->OffsetAtIndex(n); + if (offset != DW_INVALID_OFFSET) + cus_with_data.insert (offset); + } + + // Manually build arange data for everything that wasn't in the .debug_aranges table. + bool printed = false; + const size_t num_compile_units = GetNumCompileUnits(); + const bool clear_dies_if_already_not_parsed = true; + for (size_t idx = 0; idx < num_compile_units; ++idx) + { + DWARFCompileUnit* cu = GetCompileUnitAtIndex(idx); + + dw_offset_t offset = cu->GetOffset(); + if (cus_with_data.find(offset) == cus_with_data.end()) { - DWARFCompileUnit* cu = GetCompileUnitAtIndex(idx); - if (cu) - cu->BuildAddressRangeTable (m_dwarf2Data, m_cu_aranges_ap.get(), clear_dies_if_already_not_parsed); + if (log) + { + if (!printed) + log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" by parsing", + m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str()); + printed = true; + } + cu->BuildAddressRangeTable (m_dwarf2Data, m_cu_aranges_ap.get(), clear_dies_if_already_not_parsed); } } @@ -146,7 +163,7 @@ DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() if (m_dwarf2Data != NULL) { lldb::offset_t offset = 0; - const DataExtractor &debug_info_data = m_dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor &debug_info_data = m_dwarf2Data->get_debug_info_data(); while (debug_info_data.ValidOffset(offset)) { DWARFCompileUnitSP cu_sp(new DWARFCompileUnit(m_dwarf2Data)); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 03c12e366f92..37741eb1da9c 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -116,7 +116,7 @@ DWARFDebugInfoEntry::Attributes::FormValueAsUnsignedAtIndex(SymbolFileDWARF* dwa bool DWARFDebugInfoEntry::FastExtract ( - const DataExtractor& debug_info_data, + const DWARFDataExtractor& debug_info_data, const DWARFCompileUnit* cu, const uint8_t *fixed_form_sizes, lldb::offset_t *offset_ptr @@ -151,8 +151,8 @@ DWARFDebugInfoEntry::FastExtract m_has_children = abbrevDecl->HasChildren(); // Skip all data in the .debug_info for the attributes const uint32_t numAttributes = abbrevDecl->NumAttributes(); - register uint32_t i; - register dw_form_t form; + uint32_t i; + dw_form_t form; for (i=0; i<numAttributes; ++i) { form = abbrevDecl->GetFormByIndexUnchecked(i); @@ -166,7 +166,7 @@ DWARFDebugInfoEntry::FastExtract do { form_is_indirect = false; - register uint32_t form_size = 0; + uint32_t form_size = 0; switch (form) { // Blocks if inlined data that have a length field and the data bytes @@ -281,8 +281,8 @@ DWARFDebugInfoEntry::Extract 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 DWARFDataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); +// const DWARFDataExtractor& debug_str_data = dwarf2Data->get_debug_str_data(); const uint32_t cu_end_offset = cu->GetNextCompileUnitOffset(); const uint8_t cu_addr_size = cu->GetAddressByteSize(); lldb::offset_t offset = *offset_ptr; @@ -332,7 +332,7 @@ DWARFDebugInfoEntry::Extract do { form_is_indirect = false; - register uint32_t form_size = 0; + uint32_t form_size = 0; switch (form) { // Blocks if inlined data that have a length field and the data bytes @@ -591,7 +591,7 @@ DWARFDebugInfoEntry::DumpAncestry // // The number of attributes are the same... // if (a_attr_count > 0) // { -// const DataExtractor* debug_str_data_ptr = &dwarf2Data->get_debug_str_data(); +// const DWARFDataExtractor* debug_str_data_ptr = &dwarf2Data->get_debug_str_data(); // // uint32_t i; // for (i=0; i<a_attr_count; ++i) @@ -763,9 +763,11 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges lldb::offset_t offset; const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset); + lldb::ModuleSP module = dwarf2Data->GetObjectFile()->GetModule(); + if (abbrevDecl) { - const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); if (!debug_info_data.ValidOffset(offset)) return false; @@ -874,17 +876,17 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges { uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart(); uint32_t block_length = form_value.Unsigned(); - frame_base->SetOpcodeData(debug_info_data, block_offset, block_length); + frame_base->SetOpcodeData(module, debug_info_data, block_offset, block_length); } else { - const DataExtractor &debug_loc_data = dwarf2Data->get_debug_loc_data(); + const DWARFDataExtractor &debug_loc_data = dwarf2Data->get_debug_loc_data(); const dw_offset_t debug_loc_offset = form_value.Unsigned(); size_t loc_list_length = DWARFLocationList::Size(debug_loc_data, debug_loc_offset); if (loc_list_length > 0) { - frame_base->SetOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length); + frame_base->SetOpcodeData(module, debug_loc_data, debug_loc_offset, loc_list_length); if (lo_pc != LLDB_INVALID_ADDRESS) { assert (lo_pc >= cu->GetBaseAddress()); @@ -959,7 +961,7 @@ DWARFDebugInfoEntry::Dump uint32_t recurse_depth ) const { - const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); lldb::offset_t offset = m_offset; if (debug_info_data.ValidOffset(offset)) @@ -1053,7 +1055,7 @@ DWARFDebugInfoEntry::DumpAttribute ( SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit* cu, - const DataExtractor& debug_info_data, + const DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, Stream &s, dw_attr_t attr, @@ -1063,7 +1065,7 @@ DWARFDebugInfoEntry::DumpAttribute bool verbose = s.GetVerbose(); bool show_form = s.GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm); - const DataExtractor* debug_str_data = dwarf2Data ? &dwarf2Data->get_debug_str_data() : NULL; + const DWARFDataExtractor* debug_str_data = dwarf2Data ? &dwarf2Data->get_debug_str_data() : NULL; if (verbose) s.Offset (*offset_ptr); else @@ -1131,7 +1133,7 @@ DWARFDebugInfoEntry::DumpAttribute form_value.Dump(s, debug_str_data, cu); // Location description is inlined in data in the form value - DataExtractor locationData(debug_info_data, (*offset_ptr) - form_value.Unsigned(), form_value.Unsigned()); + DWARFDataExtractor locationData(debug_info_data, (*offset_ptr) - form_value.Unsigned(), form_value.Unsigned()); if ( verbose ) s.PutCString(" ( "); print_dwarf_expression (s, locationData, DWARFCompileUnit::GetAddressByteSize(cu), 4, false); if ( verbose ) s.PutCString(" )"); @@ -1221,7 +1223,7 @@ DWARFDebugInfoEntry::GetAttributes if (abbrevDecl) { - const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); if (fixed_form_sizes == NULL) fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize(cu->GetAddressByteSize()); @@ -1322,7 +1324,7 @@ DWARFDebugInfoEntry::GetAttributeValue if (attr_idx != DW_INVALID_INDEX) { - const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = dwarf2Data->get_debug_info_data(); uint32_t idx=0; while (idx<attr_idx) @@ -1495,7 +1497,7 @@ DWARFDebugInfoEntry::GetAttributeValueAsLocation SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit* cu, const dw_attr_t attr, - DataExtractor& location_data, + DWARFDataExtractor& location_data, uint32_t &block_size ) const { @@ -1512,7 +1514,7 @@ DWARFDebugInfoEntry::GetAttributeValueAsLocation if (blockData) { // We have an inlined location list in the .debug_info section - const DataExtractor& debug_info = dwarf2Data->get_debug_info_data(); + const DWARFDataExtractor& debug_info = dwarf2Data->get_debug_info_data(); dw_offset_t block_offset = blockData - debug_info.GetDataStart(); block_size = (end_addr_offset - attr_offset) - form_value.Unsigned(); location_data.SetData(debug_info, block_offset, block_size); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h index 85f4109ae01a..f74057555286 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h @@ -142,7 +142,7 @@ public: DWARFDebugAranges* debug_aranges) const; bool FastExtract( - const lldb_private::DataExtractor& debug_info_data, + const lldb_private::DWARFDataExtractor& debug_info_data, const DWARFCompileUnit* cu, const uint8_t *fixed_form_sizes, lldb::offset_t* offset_ptr); @@ -214,7 +214,7 @@ public: SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit* cu, const dw_attr_t attr, - lldb_private::DataExtractor& data, + lldb_private::DWARFDataExtractor& data, uint32_t &block_size) const; const char* GetName( @@ -289,7 +289,7 @@ public: static void DumpAttribute( SymbolFileDWARF* dwarf2Data, const DWARFCompileUnit* cu, - const lldb_private::DataExtractor& debug_info_data, + const lldb_private::DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, lldb_private::Stream &s, dw_attr_t attr, diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp index 6c9336a08426..0a2f1f749409 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -32,7 +32,7 @@ using namespace std; // representation. //---------------------------------------------------------------------- void -DWARFDebugLine::Parse(const DataExtractor& debug_line_data) +DWARFDebugLine::Parse(const DWARFDataExtractor& debug_line_data) { m_lineTableMap.clear(); lldb::offset_t offset = 0; @@ -59,7 +59,7 @@ DWARFDebugLine::Parse(const DataExtractor& debug_line_data) } void -DWARFDebugLine::ParseIfNeeded(const DataExtractor& debug_line_data) +DWARFDebugLine::ParseIfNeeded(const DWARFDataExtractor& debug_line_data) { if (m_lineTableMap.empty()) Parse(debug_line_data); @@ -110,7 +110,7 @@ DumpStateToFile (dw_offset_t offset, const DWARFDebugLine::State& state, void* u bool DWARFDebugLine::DumpLineTableRows(Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t debug_line_offset) { - const DataExtractor& debug_line_data = dwarf2Data->get_debug_line_data(); + const DWARFDataExtractor& debug_line_data = dwarf2Data->get_debug_line_data(); if (debug_line_offset == DW_INVALID_OFFSET) { @@ -131,7 +131,7 @@ DWARFDebugLine::DumpLineTableRows(Log *log, SymbolFileDWARF* dwarf2Data, dw_offs // DWARFDebugLine::DumpStatementTable //---------------------------------------------------------------------- dw_offset_t -DWARFDebugLine::DumpStatementTable(Log *log, const DataExtractor& debug_line_data, const dw_offset_t debug_line_offset) +DWARFDebugLine::DumpStatementTable(Log *log, const DWARFDataExtractor& debug_line_data, const dw_offset_t debug_line_offset) { if (debug_line_data.ValidOffset(debug_line_offset)) { @@ -156,7 +156,7 @@ DWARFDebugLine::DumpStatementTable(Log *log, const DataExtractor& debug_line_dat bool DWARFDebugLine::DumpOpcodes(Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t debug_line_offset, uint32_t dump_flags) { - const DataExtractor& debug_line_data = dwarf2Data->get_debug_line_data(); + const DWARFDataExtractor& debug_line_data = dwarf2Data->get_debug_line_data(); if (debug_line_data.GetByteSize() == 0) { @@ -183,7 +183,7 @@ DWARFDebugLine::DumpOpcodes(Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t d // DumpStatementOpcodes //---------------------------------------------------------------------- dw_offset_t -DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_data, const dw_offset_t debug_line_offset, uint32_t flags) +DWARFDebugLine::DumpStatementOpcodes(Log *log, const DWARFDataExtractor& debug_line_data, const dw_offset_t debug_line_offset, uint32_t flags) { lldb::offset_t offset = debug_line_offset; if (debug_line_data.ValidOffset(offset)) @@ -386,7 +386,7 @@ DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_d // the line table. //---------------------------------------------------------------------- void -DWARFDebugLine::Parse(const DataExtractor& debug_line_data, DWARFDebugLine::State::Callback callback, void* userData) +DWARFDebugLine::Parse(const DWARFDataExtractor& debug_line_data, DWARFDebugLine::State::Callback callback, void* userData) { lldb::offset_t offset = 0; if (debug_line_data.ValidOffset(offset)) @@ -401,7 +401,7 @@ DWARFDebugLine::Parse(const DataExtractor& debug_line_data, DWARFDebugLine::Stat // DWARFDebugLine::ParsePrologue //---------------------------------------------------------------------- bool -DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, lldb::offset_t* offset_ptr, Prologue* prologue) +DWARFDebugLine::ParsePrologue(const DWARFDataExtractor& debug_line_data, lldb::offset_t* offset_ptr, Prologue* prologue) { const lldb::offset_t prologue_offset = *offset_ptr; @@ -410,12 +410,12 @@ DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, lldb::offset prologue->Clear(); uint32_t i; const char * s; - prologue->total_length = debug_line_data.GetU32(offset_ptr); + prologue->total_length = debug_line_data.GetDWARFInitialLength(offset_ptr); prologue->version = debug_line_data.GetU16(offset_ptr); if (prologue->version != 2) return false; - prologue->prologue_length = debug_line_data.GetU32(offset_ptr); + prologue->prologue_length = debug_line_data.GetDWARFOffset(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); @@ -456,10 +456,11 @@ DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, lldb::offset break; } + // XXX GNU as is broken for 64-Bit DWARF if (*offset_ptr != end_prologue_offset) { Host::SystemLog (Host::eSystemLogWarning, - "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", + "warning: parsing line table prologue at 0x%8.8" PRIx64 " should have ended at 0x%8.8" PRIx64 " but it ended at 0x%8.8" PRIx64 "\n", prologue_offset, end_prologue_offset, *offset_ptr); @@ -469,18 +470,20 @@ DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, lldb::offset bool DWARFDebugLine::ParseSupportFiles (const lldb::ModuleSP &module_sp, - const DataExtractor& debug_line_data, + const DWARFDataExtractor& debug_line_data, const char *cu_comp_dir, dw_offset_t stmt_list, FileSpecList &support_files) { - lldb::offset_t offset = stmt_list + 4; // Skip the total length + lldb::offset_t offset = stmt_list; + // Skip the total length + (void)debug_line_data.GetDWARFInitialLength(&offset); const char * s; uint32_t version = debug_line_data.GetU16(&offset); if (version != 2) return false; - const dw_offset_t end_prologue_offset = debug_line_data.GetU32(&offset) + offset; + const dw_offset_t end_prologue_offset = debug_line_data.GetDWARFOffset(&offset) + offset; // Skip instruction length, default is stmt, line base, line range and // opcode base, and all opcode lengths offset += 4; @@ -554,7 +557,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.8" PRIx64 "\n", + "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended at 0x%8.8" PRIx64 "\n", stmt_list, end_prologue_offset, offset); @@ -572,7 +575,7 @@ DWARFDebugLine::ParseSupportFiles (const lldb::ModuleSP &module_sp, bool DWARFDebugLine::ParseStatementTable ( - const DataExtractor& debug_line_data, + const DWARFDataExtractor& debug_line_data, lldb::offset_t* offset_ptr, DWARFDebugLine::State::Callback callback, void* userData @@ -600,7 +603,7 @@ DWARFDebugLine::ParseStatementTable if (log) prologue->Dump (log); - const dw_offset_t end_offset = debug_line_offset + prologue->total_length + sizeof(prologue->total_length); + const dw_offset_t end_offset = debug_line_offset + prologue->total_length + (debug_line_data.GetDWARFSizeofInitialLength()); State state(prologue, log, callback, userData); @@ -873,7 +876,7 @@ ParseStatementTableCallback(dw_offset_t offset, const DWARFDebugLine::State& sta // the prologue and all rows. //---------------------------------------------------------------------- bool -DWARFDebugLine::ParseStatementTable(const DataExtractor& debug_line_data, lldb::offset_t *offset_ptr, LineTable* line_table) +DWARFDebugLine::ParseStatementTable(const DWARFDataExtractor& debug_line_data, lldb::offset_t *offset_ptr, LineTable* line_table) { return ParseStatementTable(debug_line_data, offset_ptr, ParseStatementTableCallback, line_table); } diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h index cfa8654ed9ba..0caaf596add5 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h @@ -16,6 +16,7 @@ #include "lldb/lldb-private.h" +#include "DWARFDataExtractor.h" #include "DWARFDefines.h" class SymbolFileDWARF; @@ -82,10 +83,6 @@ public: std::vector<std::string> include_directories; std::vector<FileNameEntry> file_names; - // Length of the prologue in bytes - uint32_t Length() const { return prologue_length + sizeof(total_length) + sizeof(version) + sizeof(prologue_length); } - // Length of the line table data in bytes (not including the prologue) - uint32_t StatementTableLength() const { return total_length + sizeof(total_length) - Length(); } int32_t MaxLineIncrementForSpecialOpcode() const { return line_base + (int8_t)line_range - 1; } bool IsValid() const; // void Append(BinaryStreamBuf& buff) const; @@ -196,13 +193,13 @@ 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, 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, 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 bool ParseSupportFiles(const lldb::ModuleSP &module_sp, const lldb_private::DWARFDataExtractor& debug_line_data, const char *cu_comp_dir, dw_offset_t stmt_list, lldb_private::FileSpecList &support_files); + static bool ParsePrologue(const lldb_private::DWARFDataExtractor& debug_line_data, lldb::offset_t* offset_ptr, Prologue* prologue); + static bool ParseStatementTable(const lldb_private::DWARFDataExtractor& 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::DWARFDataExtractor& debug_line_data, const dw_offset_t line_offset); + static dw_offset_t DumpStatementOpcodes(lldb_private::Log *log, const lldb_private::DWARFDataExtractor& debug_line_data, const dw_offset_t line_offset, uint32_t flags); + static bool ParseStatementTable(const lldb_private::DWARFDataExtractor& debug_line_data, lldb::offset_t *offset_ptr, LineTable* line_table); + static void Parse(const lldb_private::DWARFDataExtractor& 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); DWARFDebugLine() : @@ -210,8 +207,8 @@ public: { } - void Parse(const lldb_private::DataExtractor& debug_line_data); - void ParseIfNeeded(const lldb_private::DataExtractor& debug_line_data); + void Parse(const lldb_private::DWARFDataExtractor& debug_line_data); + void ParseIfNeeded(const lldb_private::DWARFDataExtractor& debug_line_data); LineTable::shared_ptr GetLineTable(const dw_offset_t offset) const; protected: diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp index 60ace9e82290..0e2aaa47e8c9 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp @@ -26,7 +26,7 @@ DWARFDebugMacinfo::~DWARFDebugMacinfo() } void -DWARFDebugMacinfo::Dump(Stream *s, const DataExtractor& macinfo_data, lldb::offset_t offset) +DWARFDebugMacinfo::Dump(Stream *s, const DWARFDataExtractor& macinfo_data, lldb::offset_t offset) { DWARFDebugMacinfoEntry maninfo_entry; if (macinfo_data.GetByteSize() == 0) diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h index 5f3b437d964f..077718cf7db2 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h @@ -21,7 +21,7 @@ public: static void Dump (lldb_private::Stream *s, - const lldb_private::DataExtractor& macinfo_data, + const lldb_private::DWARFDataExtractor& macinfo_data, lldb::offset_t offset = LLDB_INVALID_OFFSET); }; diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp index 5cd9cb6be474..4a176bb8aad4 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp @@ -80,7 +80,7 @@ DWARFDebugMacinfoEntry::Dump(Stream *s) const bool -DWARFDebugMacinfoEntry::Extract(const DataExtractor& mac_info_data, lldb::offset_t* offset_ptr) +DWARFDebugMacinfoEntry::Extract(const DWARFDataExtractor& mac_info_data, lldb::offset_t* offset_ptr) { if (mac_info_data.ValidOffset(*offset_ptr)) { diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h index 46fd44a22a63..72318d86e1ca 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h @@ -38,7 +38,7 @@ public: GetCString() const; bool - Extract(const lldb_private::DataExtractor& mac_info_data, + Extract(const lldb_private::DWARFDataExtractor& mac_info_data, lldb::offset_t* offset_ptr); protected: diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp index 3e511007a1ec..06ac825e0d4d 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp @@ -29,7 +29,7 @@ DWARFDebugPubnames::DWARFDebugPubnames() : } bool -DWARFDebugPubnames::Extract(const DataExtractor& data) +DWARFDebugPubnames::Extract(const DWARFDataExtractor& data) { Timer scoped_timer (__PRETTY_FUNCTION__, "DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")", @@ -77,7 +77,7 @@ DWARFDebugPubnames::GeneratePubnames(SymbolFileDWARF* dwarf2Data) if (debug_info) { - const DataExtractor* debug_str = &dwarf2Data->get_debug_str_data(); + const DWARFDataExtractor* debug_str = &dwarf2Data->get_debug_str_data(); uint32_t cu_idx = 0; const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits(); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h index 09eb80ab3006..cacb1ea109bf 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h @@ -20,7 +20,7 @@ class DWARFDebugPubnames { public: DWARFDebugPubnames(); - bool Extract(const lldb_private::DataExtractor& data); + bool Extract(const lldb_private::DWARFDataExtractor& data); bool GeneratePubnames(SymbolFileDWARF* dwarf2Data); bool GeneratePubBaseTypes(SymbolFileDWARF* dwarf2Data); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp index 2df8d525f03f..b7e1b27d1501 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp @@ -78,21 +78,21 @@ DWARFDebugPubnamesSet::InitNameIndexes() const bool -DWARFDebugPubnamesSet::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr) +DWARFDebugPubnamesSet::Extract(const DWARFDataExtractor& data, lldb::offset_t *offset_ptr) { if (data.ValidOffset(*offset_ptr)) { m_descriptors.clear(); m_offset = *offset_ptr; - m_header.length = data.GetU32(offset_ptr); + m_header.length = data.GetDWARFInitialLength(offset_ptr); m_header.version = data.GetU16(offset_ptr); - m_header.die_offset = data.GetU32(offset_ptr); - m_header.die_length = data.GetU32(offset_ptr); + m_header.die_offset = data.GetDWARFOffset(offset_ptr); + m_header.die_length = data.GetDWARFOffset(offset_ptr); Descriptor pubnameDesc; while (data.ValidOffset(*offset_ptr)) { - pubnameDesc.offset = data.GetU32(offset_ptr); + pubnameDesc.offset = data.GetDWARFOffset(offset_ptr); if (pubnameDesc.offset) { diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h index 941c83e58a44..075807b2dcc3 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h @@ -13,7 +13,7 @@ #include "SymbolFileDWARF.h" #include <string> #include <vector> -#if __cplusplus >= 201103L +#if __cplusplus >= 201103L || defined(_MSC_VER) #include <unordered_map> #else #include <ext/hash_map> @@ -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, lldb::offset_t *offset_ptr); + bool Extract(const lldb_private::DWARFDataExtractor& 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; @@ -87,7 +87,7 @@ protected: dw_offset_t m_offset; Header m_header; -#if __cplusplus >= 201103L +#if __cplusplus >= 201103L || defined(_MSC_VER) typedef std::unordered_multimap<const char*, uint32_t, std::hash<const char*>, CStringEqualBinaryPredicate> cstr_to_index_mmap; #else typedef __gnu_cxx::hash_multimap<const char*, uint32_t, __gnu_cxx::hash<const char*>, CStringEqualBinaryPredicate> cstr_to_index_mmap; diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp index 461b17fc3aba..a4968c455a68 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp @@ -87,7 +87,7 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, lldb::offset_t *offset_pt range_list.Clear(); lldb::offset_t range_offset = *offset_ptr; - const DataExtractor& debug_ranges_data = dwarf2Data->get_debug_ranges_data(); + const DWARFDataExtractor& debug_ranges_data = dwarf2Data->get_debug_ranges_data(); uint32_t addr_size = debug_ranges_data.GetAddressByteSize(); while (debug_ranges_data.ValidOffsetForDataOfSize(*offset_ptr, 2 * addr_size)) @@ -132,7 +132,7 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, lldb::offset_t *offset_pt void -DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, lldb::offset_t *offset_ptr, dw_addr_t cu_base_addr) +DWARFDebugRanges::Dump(Stream &s, const DWARFDataExtractor& debug_ranges_data, lldb::offset_t *offset_ptr, dw_addr_t cu_base_addr) { uint32_t addr_size = s.GetAddressByteSize(); bool verbose = s.GetVerbose(); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h index 40899abe9c25..50af91d41009 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h @@ -26,7 +26,7 @@ public: DWARFDebugRanges(); ~DWARFDebugRanges(); void Extract(SymbolFileDWARF* dwarf2Data); - 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); + static void Dump(lldb_private::Stream &s, const lldb_private::DWARFDataExtractor& 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: diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h index accd3446317a..2be5d90c37b2 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h @@ -54,7 +54,7 @@ public: } // Test operator - operator bool() const + explicit operator bool() const { return tag != 0; } diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDefines.h b/source/Plugins/SymbolFile/DWARF/DWARFDefines.h index e37aefb27a72..d47e6a350c93 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDefines.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFDefines.h @@ -11,7 +11,6 @@ #define SymbolFileDWARF_DWARFDefines_h_ #include <stdint.h> -#include <stdbool.h> #include "lldb/Core/dwarf.h" namespace lldb_private { diff --git a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp index 6113a146c93d..abd273770ddc 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -114,7 +114,7 @@ DWARFFormValue::DWARFFormValue(dw_form_t form) : } bool -DWARFFormValue::ExtractValue(const DataExtractor& data, lldb::offset_t* offset_ptr, const DWARFCompileUnit* cu) +DWARFFormValue::ExtractValue(const DWARFDataExtractor& data, lldb::offset_t* offset_ptr, const DWARFCompileUnit* cu) { bool indirect = false; bool is_block = false; @@ -183,13 +183,13 @@ DWARFFormValue::ExtractValue(const DataExtractor& data, lldb::offset_t* offset_p } bool -DWARFFormValue::SkipValue(const DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const +DWARFFormValue::SkipValue(const DWARFDataExtractor& 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, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) +DWARFFormValue::SkipValue(dw_form_t form, const DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) { switch (form) { @@ -278,7 +278,7 @@ DWARFFormValue::SkipValue(dw_form_t form, const DataExtractor& debug_info_data, void -DWARFFormValue::Dump(Stream &s, const DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const +DWARFFormValue::Dump(Stream &s, const DWARFDataExtractor* debug_str_data, const DWARFCompileUnit* cu) const { uint64_t uvalue = Unsigned(); bool cu_relative_offset = false; @@ -378,7 +378,7 @@ DWARFFormValue::Dump(Stream &s, const DataExtractor* debug_str_data, const DWARF } const char* -DWARFFormValue::AsCString(const DataExtractor* debug_str_data_ptr) const +DWARFFormValue::AsCString(const DWARFDataExtractor* debug_str_data_ptr) const { if (IsInlinedCStr()) return m_value.value.cstr; @@ -496,7 +496,7 @@ DWARFFormValue::IsDataForm(const dw_form_t form) } int -DWARFFormValue::Compare (const DWARFFormValue& a_value, const DWARFFormValue& b_value, const DWARFCompileUnit* a_cu, const DWARFCompileUnit* b_cu, const DataExtractor* debug_str_data_ptr) +DWARFFormValue::Compare (const DWARFFormValue& a_value, const DWARFFormValue& b_value, const DWARFCompileUnit* a_cu, const DWARFCompileUnit* b_cu, const DWARFDataExtractor* debug_str_data_ptr) { dw_form_t a_form = a_value.Form(); dw_form_t b_form = b_value.Form(); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h index 4c400b2df58e..fce995e4ff2e 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h @@ -11,6 +11,7 @@ #define SymbolFileDWARF_DWARFFormValue_h_ #include <stddef.h> // for NULL +#include "DWARFDataExtractor.h" class DWARFCompileUnit; @@ -48,8 +49,8 @@ public: dw_form_t Form() const { return m_form; } void SetForm(dw_form_t form) { m_form = form; } const ValueType& Value() const { return m_value; } - void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const; - bool ExtractValue(const lldb_private::DataExtractor& data, + void Dump(lldb_private::Stream &s, const lldb_private::DWARFDataExtractor* debug_str_data, const DWARFCompileUnit* cu) const; + bool ExtractValue(const lldb_private::DWARFDataExtractor& 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; } @@ -62,16 +63,16 @@ public: void SetUnsigned(uint64_t uval) { m_value.value.uval = uval; } 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, 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); + const char* AsCString(const lldb_private::DWARFDataExtractor* debug_str_data_ptr) const; + bool SkipValue(const lldb_private::DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const; + static bool SkipValue(const dw_form_t form, const lldb_private::DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu); +// static bool TransferValue(dw_form_t form, const lldb_private::DWARFDataExtractor& 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); static bool IsDataForm(const dw_form_t form); static const uint8_t * GetFixedFormSizesForAddressSize (uint8_t addr_size); - static int Compare (const DWARFFormValue& a, const DWARFFormValue& b, const DWARFCompileUnit* a_cu, const DWARFCompileUnit* b_cu, const lldb_private::DataExtractor* debug_str_data_ptr); + static int Compare (const DWARFFormValue& a, const DWARFFormValue& b, const DWARFCompileUnit* a_cu, const DWARFCompileUnit* b_cu, const lldb_private::DWARFDataExtractor* debug_str_data_ptr); protected: dw_form_t m_form; // Form for this value ValueType m_value; // Contains all data for the form diff --git a/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp b/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp index fdc07836b88d..d79ae79822b0 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp @@ -15,11 +15,11 @@ using namespace lldb_private; -static int print_dwarf_exp_op (Stream &s, const DataExtractor& data, lldb::offset_t *offset_ptr, int address_size, int dwarf_ref_size); +static int print_dwarf_exp_op (Stream &s, const DWARFDataExtractor& data, lldb::offset_t *offset_ptr, int address_size, int dwarf_ref_size); int print_dwarf_expression (Stream &s, - const DataExtractor& data, + const DWARFDataExtractor& data, int address_size, int dwarf_ref_size, bool location_expression) @@ -47,7 +47,7 @@ print_dwarf_expression (Stream &s, static int print_dwarf_exp_op (Stream &s, - const DataExtractor& data, + const DWARFDataExtractor& data, lldb::offset_t *offset_ptr, int address_size, int dwarf_ref_size) diff --git a/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h b/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h index ff7c907e921c..69cc0c15969c 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h @@ -14,7 +14,7 @@ int print_dwarf_expression (lldb_private::Stream &s, - const lldb_private::DataExtractor& data, + const lldb_private::DWARFDataExtractor& data, int address_size, int dwarf_ref_size, bool location_expression); diff --git a/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp b/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp index dad5691267df..26768f060ef1 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp +++ b/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, lldb::offset_t offset) +DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DWARFDataExtractor& debug_loc_data, lldb::offset_t offset) { uint64_t start_addr, end_addr; uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu); @@ -42,7 +42,7 @@ DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtract ": "); uint32_t loc_length = debug_loc_data.GetU16(&offset); - DataExtractor locationData(debug_loc_data, offset, loc_length); + DWARFDataExtractor locationData(debug_loc_data, offset, loc_length); // if ( dump_flags & DWARFDebugInfo::eDumpFlag_Verbose ) *ostrm_ptr << " ( "; print_dwarf_expression (s, locationData, addr_size, 4, false); offset += loc_length; @@ -52,7 +52,7 @@ DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtract } bool -DWARFLocationList::Extract(const DataExtractor& debug_loc_data, lldb::offset_t* offset_ptr, DataExtractor& location_list_data) +DWARFLocationList::Extract(const DWARFDataExtractor& debug_loc_data, lldb::offset_t* offset_ptr, DWARFDataExtractor& 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, lldb::offset_t* } size_t -DWARFLocationList::Size(const DataExtractor& debug_loc_data, lldb::offset_t offset) +DWARFLocationList::Size(const DWARFDataExtractor& debug_loc_data, lldb::offset_t offset) { const dw_offset_t debug_loc_offset = offset; diff --git a/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h b/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h index 85e11d90b36b..6dcc0d74e441 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h +++ b/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h @@ -18,16 +18,16 @@ public: static dw_offset_t Dump (lldb_private::Stream &s, const DWARFCompileUnit* cu, - const lldb_private::DataExtractor& debug_loc_data, + const lldb_private::DWARFDataExtractor& debug_loc_data, lldb::offset_t offset); static bool - Extract (const lldb_private::DataExtractor& debug_loc_data, + Extract (const lldb_private::DWARFDataExtractor& debug_loc_data, lldb::offset_t* offset_ptr, - lldb_private::DataExtractor& location_list_data); + lldb_private::DWARFDataExtractor& location_list_data); static size_t - Size (const lldb_private::DataExtractor& debug_loc_data, + Size (const lldb_private::DWARFDataExtractor& debug_loc_data, lldb::offset_t offset); }; diff --git a/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h b/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h index c31cbaf3ca20..44a24f2756ad 100644 --- a/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h +++ b/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h @@ -432,7 +432,7 @@ struct DWARFMappedHash } bool - Read (const lldb_private::DataExtractor &data, + Read (const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr, DIEInfo &hash_data) const { @@ -585,8 +585,8 @@ struct DWARFMappedHash { public: - MemoryTable (lldb_private::DataExtractor &table_data, - const lldb_private::DataExtractor &string_table, + MemoryTable (lldb_private::DWARFDataExtractor &table_data, + const lldb_private::DWARFDataExtractor &string_table, const char *name) : MappedHash::MemoryTable<uint32_t, Header, DIEInfoArray> (table_data), m_data (table_data), @@ -923,8 +923,8 @@ struct DWARFMappedHash } protected: - const lldb_private::DataExtractor &m_data; - const lldb_private::DataExtractor &m_string_table; + const lldb_private::DWARFDataExtractor &m_data; + const lldb_private::DWARFDataExtractor &m_string_table; std::string m_name; }; }; diff --git a/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp b/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp index 27fa261813bb..c9ffa9ec781f 100644 --- a/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp +++ b/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp @@ -174,10 +174,11 @@ LogChannelDWARF::ListCategories (Stream *strm) { strm->Printf ("Logging categories for '%s':\n" " all - turn on all available logging categories\n" - " info - log the parsing if .debug_info\n" - " line - log the parsing if .debug_line\n" - " pubnames - log the parsing if .debug_pubnames\n" - " pubtypes - log the parsing if .debug_pubtypes\n" + " info - log the parsing of .debug_info\n" + " line - log the parsing of .debug_line\n" + " pubnames - log the parsing of .debug_pubnames\n" + " pubtypes - log the parsing of .debug_pubtypes\n" + " aranges - log the parsing of .debug_aranges\n" " lookups - log any lookups that happen by name, regex, or address\n" " completion - log struct/unions/class type completions\n" " map - log insertions of object files into DWARF debug maps\n", diff --git a/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp b/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp index 5514469d0758..e4626900d816 100644 --- a/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp +++ b/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp @@ -9,7 +9,6 @@ #include "NameToDIE.h" #include "lldb/Core/ConstString.h" -#include "lldb/Core/DataExtractor.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamString.h" #include "lldb/Core/RegularExpression.h" diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index f265af837eef..09b50531b8a9 100644 --- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -70,7 +70,7 @@ #ifdef ENABLE_DEBUG_PRINTF #include <stdio.h> -#define DEBUG_PRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__) +#define DEBUG_PRINTF(fmt, ...) printf(fmt, __VA_ARGS__) #else #define DEBUG_PRINTF(fmt, ...) #endif @@ -699,8 +699,8 @@ SymbolFileDWARF::CalculateAbilities () return abilities; } -const DataExtractor& -SymbolFileDWARF::GetCachedSectionData (uint32_t got_flag, SectionType sect_type, DataExtractor &data) +const DWARFDataExtractor& +SymbolFileDWARF::GetCachedSectionData (uint32_t got_flag, SectionType sect_type, DWARFDataExtractor &data) { if (m_flags.IsClear (got_flag)) { @@ -728,73 +728,73 @@ SymbolFileDWARF::GetCachedSectionData (uint32_t got_flag, SectionType sect_type, return data; } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_abbrev_data() { return GetCachedSectionData (flagsGotDebugAbbrevData, eSectionTypeDWARFDebugAbbrev, m_data_debug_abbrev); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_aranges_data() { return GetCachedSectionData (flagsGotDebugArangesData, eSectionTypeDWARFDebugAranges, m_data_debug_aranges); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_frame_data() { return GetCachedSectionData (flagsGotDebugFrameData, eSectionTypeDWARFDebugFrame, m_data_debug_frame); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_info_data() { return GetCachedSectionData (flagsGotDebugInfoData, eSectionTypeDWARFDebugInfo, m_data_debug_info); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_line_data() { return GetCachedSectionData (flagsGotDebugLineData, eSectionTypeDWARFDebugLine, m_data_debug_line); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_loc_data() { return GetCachedSectionData (flagsGotDebugLocData, eSectionTypeDWARFDebugLoc, m_data_debug_loc); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_ranges_data() { return GetCachedSectionData (flagsGotDebugRangesData, eSectionTypeDWARFDebugRanges, m_data_debug_ranges); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_debug_str_data() { return GetCachedSectionData (flagsGotDebugStrData, eSectionTypeDWARFDebugStr, m_data_debug_str); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_apple_names_data() { return GetCachedSectionData (flagsGotAppleNamesData, eSectionTypeDWARFAppleNames, m_data_apple_names); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_apple_types_data() { return GetCachedSectionData (flagsGotAppleTypesData, eSectionTypeDWARFAppleTypes, m_data_apple_types); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_apple_namespaces_data() { return GetCachedSectionData (flagsGotAppleNamespacesData, eSectionTypeDWARFAppleNamespaces, m_data_apple_namespaces); } -const DataExtractor& +const DWARFDataExtractor& SymbolFileDWARF::get_apple_objc_data() { return GetCachedSectionData (flagsGotAppleObjCData, eSectionTypeDWARFAppleObjC, m_data_apple_objc); @@ -806,7 +806,7 @@ SymbolFileDWARF::DebugAbbrev() { if (m_abbr.get() == NULL) { - const DataExtractor &debug_abbrev_data = get_debug_abbrev_data(); + const DWARFDataExtractor &debug_abbrev_data = get_debug_abbrev_data(); if (debug_abbrev_data.GetByteSize() > 0) { m_abbr.reset(new DWARFDebugAbbrev()); @@ -1706,6 +1706,7 @@ SymbolFileDWARF::ParseChildMembers const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (dwarf_cu->GetAddressByteSize()); uint32_t member_idx = 0; BitfieldInfo last_field_info; + ModuleSP module = GetObjectFile()->GetModule(); for (die = parent_die->GetFirstChild(); die != NULL; die = die->GetSibling()) { @@ -1762,13 +1763,14 @@ SymbolFileDWARF::ParseChildMembers { Value initialValue(0); Value memberOffset(0); - const DataExtractor& debug_info_data = get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = get_debug_info_data(); uint32_t block_length = form_value.Unsigned(); uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart(); if (DWARFExpression::Evaluate(NULL, // ExecutionContext * NULL, // ClangExpressionVariableList * NULL, // ClangExpressionDeclMap * NULL, // RegisterContext * + module, debug_info_data, block_offset, block_length, @@ -2153,13 +2155,14 @@ SymbolFileDWARF::ParseChildMembers { Value initialValue(0); Value memberOffset(0); - const DataExtractor& debug_info_data = get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = get_debug_info_data(); uint32_t block_length = form_value.Unsigned(); uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart(); if (DWARFExpression::Evaluate (NULL, NULL, NULL, NULL, + module, debug_info_data, block_offset, block_length, @@ -2214,12 +2217,17 @@ SymbolFileDWARF::ParseChildMembers if (is_virtual) { - layout_info.vbase_offsets.insert(std::make_pair(class_clang_type.GetAsCXXRecordDecl(), - clang::CharUnits::fromQuantity(member_byte_offset))); + // Do not specify any offset for virtual inheritance. The DWARF produced by clang doesn't + // give us a constant offset, but gives us a DWARF expressions that requires an actual object + // in memory. the DW_AT_data_member_location for a virtual base class looks like: + // DW_AT_data_member_location( DW_OP_dup, DW_OP_deref, DW_OP_constu(0x00000018), DW_OP_minus, DW_OP_deref, DW_OP_plus ) + // Given this, there is really no valid response we can give to clang for virtual base + // class offsets, and this should eventually be removed from LayoutRecordType() in the external + // AST source in clang. } else { - layout_info.base_offsets.insert(std::make_pair(class_clang_type.GetAsCXXRecordDecl(), + layout_info.base_offsets.insert(std::make_pair(base_class_clang_type.GetAsCXXRecordDecl(), clang::CharUnits::fromQuantity(member_byte_offset))); } } @@ -2460,22 +2468,21 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) if (class_language == eLanguageTypeObjC) { - std::string class_str (clang_type.GetTypeName()); - if (!class_str.empty()) + ConstString class_name (clang_type.GetTypeName()); + if (class_name) { DIEArray method_die_offsets; if (m_using_apple_tables) { if (m_apple_objc_ap.get()) - m_apple_objc_ap->FindByName(class_str.c_str(), method_die_offsets); + m_apple_objc_ap->FindByName(class_name.GetCString(), method_die_offsets); } else { if (!m_indexed) Index (); - ConstString class_name (class_str.c_str()); m_objc_class_selectors_index.Find (class_name, method_die_offsets); } @@ -2497,7 +2504,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) if (m_using_apple_tables) { GetObjectFile()->GetModule()->ReportErrorIfModifyDetected ("the DWARF debug information has been modified (.apple_objc accelerator table had bad die 0x%8.8x for '%s')\n", - die_offset, class_str.c_str()); + die_offset, class_name.GetCString()); } } } @@ -2621,7 +2628,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) } } - return clang_type; + return (bool)clang_type; case DW_TAG_enumeration_type: clang_type.StartTagDeclarationDefinition (); @@ -2633,7 +2640,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) ParseChildEnumerators(sc, clang_type, is_signed, type->GetByteSize(), dwarf_cu, die); } clang_type.CompleteTagDeclarationDefinition (); - return clang_type; + return (bool)clang_type; default: assert(false && "not a forward clang type decl!"); @@ -2845,7 +2852,7 @@ SymbolFileDWARF::ResolveSymbolContext(const FileSpec& file_spec, uint32_t line, for (cu_idx = 0; (dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx)) != NULL; ++cu_idx) { CompileUnit *dc_cu = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx); - const bool full_match = file_spec.GetDirectory(); + const bool full_match = (bool)file_spec.GetDirectory(); bool file_spec_matches_cu_file_spec = dc_cu != NULL && FileSpec::Equal(file_spec, *dc_cu, full_match); if (check_inlines || file_spec_matches_cu_file_spec) { @@ -3096,7 +3103,7 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_privat } if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) - return 0; + return 0; DWARFDebugInfo* info = DebugInfo(); if (info == NULL) @@ -3553,7 +3560,7 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, sc_list.Clear(); if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) - return 0; + return 0; // If name is empty then we won't find anything. if (name.IsEmpty()) @@ -3691,22 +3698,30 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, { Type *type = sc.function->GetType(); - clang::DeclContext* decl_ctx = GetClangDeclContextContainingTypeUID (type->GetID()); - if (decl_ctx->isRecord()) + if (type) { - if (name_type_mask & eFunctionNameTypeBase) + clang::DeclContext* decl_ctx = GetClangDeclContextContainingTypeUID (type->GetID()); + if (decl_ctx->isRecord()) { - sc_list.RemoveContextAtIndex(sc_list.GetSize()-1); - keep_die = false; + if (name_type_mask & eFunctionNameTypeBase) + { + sc_list.RemoveContextAtIndex(sc_list.GetSize()-1); + keep_die = false; + } + } + else + { + if (name_type_mask & eFunctionNameTypeMethod) + { + sc_list.RemoveContextAtIndex(sc_list.GetSize()-1); + keep_die = false; + } } } else { - if (name_type_mask & eFunctionNameTypeMethod) - { - sc_list.RemoveContextAtIndex(sc_list.GetSize()-1); - keep_die = false; - } + GetObjectFile()->GetModule()->ReportWarning ("function at die offset 0x%8.8x had no function type", + die_offset); } } } @@ -3736,8 +3751,9 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, { FindFunctions (name, m_function_fullname_index, sc_list); - // Temporary workaround for global/anonymous namespace functions on linux -#if defined (__linux__) + // FIXME Temporary workaround for global/anonymous namespace + // functions on FreeBSD and Linux +#if defined (__FreeBSD__) || defined (__linux__) // If we didn't find any functions in the global namespace try // looking in the basename index but ignore any returned // functions that have a namespace (ie. mangled names starting with @@ -3930,7 +3946,7 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc, types.Clear(); if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) - return 0; + return 0; DIEArray die_offsets; @@ -4032,7 +4048,7 @@ SymbolFileDWARF::FindNamespace (const SymbolContext& sc, } if (!NamespaceDeclMatchesThisSymbolFile(parent_namespace_decl)) - return ClangNamespaceDecl(); + return ClangNamespaceDecl(); ClangNamespaceDecl namespace_decl; DWARFDebugInfo* info = DebugInfo(); @@ -4191,9 +4207,9 @@ SymbolFileDWARF::ParseChildParameters (const SymbolContext& sc, case DW_AT_location: // if (form_value.BlockData()) // { - // const DataExtractor& debug_info_data = debug_info(); + // const DWARFDataExtractor& debug_info_data = debug_info(); // uint32_t block_length = form_value.Unsigned(); - // DataExtractor location(debug_info_data, form_value.BlockData() - debug_info_data.GetDataStart(), block_length); + // DWARFDataExtractor location(debug_info_data, form_value.BlockData() - debug_info_data.GetDataStart(), block_length); // } // else // { @@ -4831,17 +4847,16 @@ SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE (const DWARFDebugInfoEntry if (try_resolving_type) { - if (must_be_implementation && type_cu->Supports_DW_AT_APPLE_objc_complete_type()) - try_resolving_type = type_die->GetAttributeValueAsUnsigned (this, type_cu, DW_AT_APPLE_objc_complete_type, 0); + if (must_be_implementation && type_cu->Supports_DW_AT_APPLE_objc_complete_type()) + try_resolving_type = type_die->GetAttributeValueAsUnsigned (this, type_cu, DW_AT_APPLE_objc_complete_type, 0); if (try_resolving_type) { Type *resolved_type = ResolveType (type_cu, type_die, false); if (resolved_type && resolved_type != DIE_IS_BEING_PARSED) { - DEBUG_PRINTF ("resolved 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ") from %s to 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ")\n", + DEBUG_PRINTF ("resolved 0x%8.8" PRIx64 " from %s to 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ")\n", MakeUserID(die->GetOffset()), - MakeUserID(dwarf_cu->GetOffset()), m_obj_file->GetFileSpec().GetFilename().AsCString(), MakeUserID(type_die->GetOffset()), MakeUserID(type_cu->GetOffset())); @@ -5117,7 +5132,7 @@ SymbolFileDWARF::FindDefinitionTypeForDIE (DWARFCompileUnit* cu, { DEBUG_PRINTF ("resolved 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ") from %s to 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ")\n", MakeUserID(die->GetOffset()), - MakeUserID(dwarf_cu->GetOffset()), + MakeUserID(cu->GetOffset()), m_obj_file->GetFileSpec().GetFilename().AsCString(), MakeUserID(type_die->GetOffset()), MakeUserID(type_cu->GetOffset())); @@ -5732,7 +5747,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } } - DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8x\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid); + DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8lx\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid); switch (tag) { @@ -5892,12 +5907,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, { case DW_AT_decl_file: if (dwarf_cu->DW_AT_decl_file_attributes_are_invalid()) - { - // llvm-gcc outputs invalid DW_AT_decl_file attributes that always - // point to the compile unit file, so we clear this invalid value - // so that we can still unique types efficiently. + { + // llvm-gcc outputs invalid DW_AT_decl_file attributes that always + // point to the compile unit file, so we clear this invalid value + // so that we can still unique types efficiently. decl.SetFile(FileSpec ("<invalid>", false)); - } + } else decl.SetFile(sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(form_value.Unsigned())); break; @@ -7255,6 +7270,7 @@ SymbolFileDWARF::ParseVariableDIE return var_sp; // Already been parsed! const dw_tag_t tag = die->Tag(); + ModuleSP module = GetObjectFile()->GetModule(); if ((tag == DW_TAG_variable) || (tag == DW_TAG_constant) || @@ -7298,13 +7314,13 @@ SymbolFileDWARF::ParseVariableDIE { location_is_const_value_data = true; // The constant value will be either a block, a data value or a string. - const DataExtractor& debug_info_data = get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = get_debug_info_data(); if (DWARFFormValue::IsBlockForm(form_value.Form())) { // Retrieve the value as a block expression. uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart(); uint32_t block_length = form_value.Unsigned(); - location.CopyOpcodeData(debug_info_data, block_offset, block_length); + location.CopyOpcodeData(module, debug_info_data, block_offset, block_length); } else if (DWARFFormValue::IsDataForm(form_value.Form())) { @@ -7312,7 +7328,7 @@ SymbolFileDWARF::ParseVariableDIE const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (dwarf_cu->GetAddressByteSize()); uint32_t data_offset = attributes.DIEOffsetAtIndex(i); uint32_t data_length = fixed_form_sizes[form_value.Form()]; - location.CopyOpcodeData(debug_info_data, data_offset, data_length); + location.CopyOpcodeData(module, debug_info_data, data_offset, data_length); } else { @@ -7322,14 +7338,14 @@ SymbolFileDWARF::ParseVariableDIE const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (dwarf_cu->GetAddressByteSize()); uint32_t data_offset = attributes.DIEOffsetAtIndex(i); uint32_t data_length = fixed_form_sizes[form_value.Form()]; - location.CopyOpcodeData(debug_info_data, data_offset, data_length); + location.CopyOpcodeData(module, debug_info_data, data_offset, data_length); } else { const char *str = form_value.AsCString(&debug_info_data); uint32_t string_offset = str - (const char *)debug_info_data.GetDataStart(); uint32_t string_length = strlen(str) + 1; - location.CopyOpcodeData(debug_info_data, string_offset, string_length); + location.CopyOpcodeData(module, debug_info_data, string_offset, string_length); } } } @@ -7340,21 +7356,21 @@ SymbolFileDWARF::ParseVariableDIE has_explicit_location = true; if (form_value.BlockData()) { - const DataExtractor& debug_info_data = get_debug_info_data(); + const DWARFDataExtractor& debug_info_data = get_debug_info_data(); uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart(); uint32_t block_length = form_value.Unsigned(); - location.CopyOpcodeData(get_debug_info_data(), block_offset, block_length); + location.CopyOpcodeData(module, get_debug_info_data(), block_offset, block_length); } else { - const DataExtractor& debug_loc_data = get_debug_loc_data(); + const DWARFDataExtractor& debug_loc_data = get_debug_loc_data(); const dw_offset_t debug_loc_offset = form_value.Unsigned(); size_t loc_list_length = DWARFLocationList::Size(debug_loc_data, debug_loc_offset); if (loc_list_length > 0) { - location.CopyOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length); + location.CopyOpcodeData(module, debug_loc_data, debug_loc_offset, loc_list_length); assert (func_low_pc != LLDB_INVALID_ADDRESS); location.SetLocationListSlide (func_low_pc - dwarf_cu->GetBaseAddress()); } diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index b6c6d94782db..55886572ada3 100644 --- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -28,7 +28,6 @@ #include "lldb/Core/ClangForward.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/dwarf.h" -#include "lldb/Core/DataExtractor.h" #include "lldb/Core/Flags.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Symbol/ClangASTContext.h" @@ -37,6 +36,7 @@ // Project includes #include "DWARFDefines.h" +#include "DWARFDataExtractor.h" #include "HashedNameToDIE.h" #include "NameToDIE.h" #include "UniqueDWARFASTType.h" @@ -199,18 +199,18 @@ public: //virtual size_t GetCompUnitCount() = 0; //virtual CompUnitSP GetCompUnitAtIndex(size_t cu_idx) = 0; - const lldb_private::DataExtractor& get_debug_abbrev_data (); - const lldb_private::DataExtractor& get_debug_aranges_data (); - const lldb_private::DataExtractor& get_debug_frame_data (); - const lldb_private::DataExtractor& get_debug_info_data (); - const lldb_private::DataExtractor& get_debug_line_data (); - const lldb_private::DataExtractor& get_debug_loc_data (); - const lldb_private::DataExtractor& get_debug_ranges_data (); - const lldb_private::DataExtractor& get_debug_str_data (); - const lldb_private::DataExtractor& get_apple_names_data (); - const lldb_private::DataExtractor& get_apple_types_data (); - const lldb_private::DataExtractor& get_apple_namespaces_data (); - const lldb_private::DataExtractor& get_apple_objc_data (); + const lldb_private::DWARFDataExtractor& get_debug_abbrev_data (); + const lldb_private::DWARFDataExtractor& get_debug_aranges_data (); + const lldb_private::DWARFDataExtractor& get_debug_frame_data (); + const lldb_private::DWARFDataExtractor& get_debug_info_data (); + const lldb_private::DWARFDataExtractor& get_debug_line_data (); + const lldb_private::DWARFDataExtractor& get_debug_loc_data (); + const lldb_private::DWARFDataExtractor& get_debug_ranges_data (); + const lldb_private::DWARFDataExtractor& get_debug_str_data (); + const lldb_private::DWARFDataExtractor& get_apple_names_data (); + const lldb_private::DWARFDataExtractor& get_apple_types_data (); + const lldb_private::DWARFDataExtractor& get_apple_namespaces_data (); + const lldb_private::DWARFDataExtractor& get_apple_objc_data (); DWARFDebugAbbrev* DebugAbbrev(); @@ -222,10 +222,10 @@ public: DWARFDebugRanges* DebugRanges(); const DWARFDebugRanges* DebugRanges() const; - const lldb_private::DataExtractor& + const lldb_private::DWARFDataExtractor& GetCachedSectionData (uint32_t got_flag, lldb::SectionType sect_type, - lldb_private::DataExtractor &data); + lldb_private::DWARFDataExtractor &data); static bool SupportedVersion(uint16_t version); @@ -560,23 +560,23 @@ protected: uint32_t type_mask, TypeSet &type_set); - lldb::ModuleWP m_debug_map_module_wp; - SymbolFileDWARFDebugMap * m_debug_map_symfile; - clang::TranslationUnitDecl * m_clang_tu_decl; - lldb_private::Flags m_flags; - lldb_private::DataExtractor m_dwarf_data; - lldb_private::DataExtractor m_data_debug_abbrev; - lldb_private::DataExtractor m_data_debug_aranges; - lldb_private::DataExtractor m_data_debug_frame; - lldb_private::DataExtractor m_data_debug_info; - lldb_private::DataExtractor m_data_debug_line; - lldb_private::DataExtractor m_data_debug_loc; - lldb_private::DataExtractor m_data_debug_ranges; - lldb_private::DataExtractor m_data_debug_str; - lldb_private::DataExtractor m_data_apple_names; - lldb_private::DataExtractor m_data_apple_types; - lldb_private::DataExtractor m_data_apple_namespaces; - lldb_private::DataExtractor m_data_apple_objc; + lldb::ModuleWP m_debug_map_module_wp; + SymbolFileDWARFDebugMap * m_debug_map_symfile; + clang::TranslationUnitDecl * m_clang_tu_decl; + lldb_private::Flags m_flags; + lldb_private::DWARFDataExtractor m_dwarf_data; + lldb_private::DWARFDataExtractor m_data_debug_abbrev; + lldb_private::DWARFDataExtractor m_data_debug_aranges; + lldb_private::DWARFDataExtractor m_data_debug_frame; + lldb_private::DWARFDataExtractor m_data_debug_info; + lldb_private::DWARFDataExtractor m_data_debug_line; + lldb_private::DWARFDataExtractor m_data_debug_loc; + lldb_private::DWARFDataExtractor m_data_debug_ranges; + lldb_private::DWARFDataExtractor m_data_debug_str; + lldb_private::DWARFDataExtractor m_data_apple_names; + lldb_private::DWARFDataExtractor m_data_apple_types; + lldb_private::DWARFDataExtractor m_data_apple_namespaces; + lldb_private::DWARFDataExtractor m_data_apple_objc; // The unique pointer items below are generated on demand if and when someone accesses // them through a non const version of this class. diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index a0430e3d52b6..856c42c2c9a6 100644 --- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -847,7 +847,7 @@ SymbolFileDWARFDebugMap::ResolveSymbolContext (const FileSpec& file_spec, uint32 if (GetFileSpecForSO (i, so_file_spec)) { // Match the full path if the incoming file_spec has a directory (not just a basename) - const bool full_match = file_spec.GetDirectory(); + const bool full_match = (bool)file_spec.GetDirectory(); resolve = FileSpec::Equal (file_spec, so_file_spec, full_match); } } |