diff options
author | Greg Clayton <gclayton@apple.com> | 2012-12-12 17:30:52 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-12-12 17:30:52 +0000 |
commit | 6ab801394fe98c6b1c78a7f217351c56ee1e7382 (patch) | |
tree | 3a10e6516ab707fe92a1a8308d452f08e7fc5f06 /lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | |
parent | 3fa700f17df11800dc29465a21f95a112d98d46a (diff) | |
download | bcm5719-llvm-6ab801394fe98c6b1c78a7f217351c56ee1e7382.tar.gz bcm5719-llvm-6ab801394fe98c6b1c78a7f217351c56ee1e7382.zip |
Allow LLDB to work with dSYM files that have a DWARF compile unit with nothing else to support clang's new -gline-tables-only mode of compiling.
llvm-svn: 169994
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 9f594d45e8f..08a022f8e68 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -13,6 +13,8 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" +#include "lldb/Symbol/CompileUnit.h" +#include "lldb/Symbol/LineTable.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/ObjCLanguageRuntime.h" @@ -393,6 +395,31 @@ DWARFCompileUnit::BuildAddressRangeTable (SymbolFileDWARF* dwarf2Data, if (die) die->BuildAddressRangeTable(dwarf2Data, this, debug_aranges); + if (debug_aranges->IsEmpty()) + { + // We got nothing from the functions, maybe we have a line tables only + // situation. Check the line tables and build the arange table from this. + SymbolContext sc; + sc.comp_unit = dwarf2Data->GetCompUnitForDWARFCompUnit(this); + if (sc.comp_unit) + { + LineTable *line_table = sc.comp_unit->GetLineTable(); + + if (line_table) + { + 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.16llx - 0x%16.16llx)\n", GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); + } + } + } + } + // Keep memory down by clearing DIEs if this generate function // caused them to be parsed if (clear_dies) |