diff options
author | Enrico Granata <egranata@apple.com> | 2013-06-27 01:43:09 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-06-27 01:43:09 +0000 |
commit | c76e60b012dde7b7e577ecd96f6de77b2313e639 (patch) | |
tree | 1b3159fad04e661a02470c155ce82cb531ab110d /lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | |
parent | ffae944a3994e9d78d1d1501b1532a728c333308 (diff) | |
download | bcm5719-llvm-c76e60b012dde7b7e577ecd96f6de77b2313e639.tar.gz bcm5719-llvm-c76e60b012dde7b7e577ecd96f6de77b2313e639.zip |
Adding support for extracting line table information from .o files that do not have aranges
llvm-svn: 185055
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index ed615c42a90..493b3af6ecd 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -26,6 +26,7 @@ #include "LogChannelDWARF.h" #include "NameToDIE.h" #include "SymbolFileDWARF.h" +#include "SymbolFileDWARFDebugMap.h" using namespace lldb; using namespace lldb_private; @@ -403,20 +404,26 @@ DWARFCompileUnit::BuildAddressRangeTable (SymbolFileDWARF* dwarf2Data, sc.comp_unit = dwarf2Data->GetCompUnitForDWARFCompUnit(this); if (sc.comp_unit) { - LineTable *line_table = sc.comp_unit->GetLineTable(); - - if (line_table) + SymbolFileDWARFDebugMap *debug_map_sym_file = m_dwarf2Data->GetDebugMapSymfile(); + if (debug_map_sym_file == NULL) { - LineTable::FileAddressRanges file_ranges; - const bool append = true; - const size_t num_ranges = line_table->GetContiguousFileAddressRanges (file_ranges, append); - for (uint32_t idx=0; idx<num_ranges; ++idx) + LineTable *line_table = sc.comp_unit->GetLineTable(); + + if (line_table) { - const LineTable::FileAddressRanges::Entry &range = file_ranges.GetEntryRef(idx); - debug_aranges->AppendRange(GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); - printf ("0x%8.8x: [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n", GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); + LineTable::FileAddressRanges file_ranges; + const bool append = true; + const size_t num_ranges = line_table->GetContiguousFileAddressRanges (file_ranges, append); + for (uint32_t idx=0; idx<num_ranges; ++idx) + { + const LineTable::FileAddressRanges::Entry &range = file_ranges.GetEntryRef(idx); + debug_aranges->AppendRange(GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); + printf ("0x%8.8x: [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n", GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); + } } } + else + debug_map_sym_file->AddOSOARanges(dwarf2Data,debug_aranges); } } |