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/SymbolFileDWARFDebugMap.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/SymbolFileDWARFDebugMap.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 8816b3ea925..fbfbf5cdd3f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -9,6 +9,9 @@ #include "SymbolFileDWARFDebugMap.h" +#include "DWARFDebugAranges.h" + +#include "lldb/Core/RangeMap.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/PluginManager.h" @@ -1542,4 +1545,30 @@ SymbolFileDWARFDebugMap::LinkOSOLineTable (SymbolFileDWARF *oso_dwarf, LineTable return NULL; } +size_t +SymbolFileDWARFDebugMap::AddOSOARanges (SymbolFileDWARF* dwarf2Data, DWARFDebugAranges* debug_aranges) +{ + size_t num_line_entries_added = 0; + if (debug_aranges && dwarf2Data) + { + CompileUnitInfo *compile_unit_info = GetCompileUnitInfo(dwarf2Data); + if (compile_unit_info) + { + const FileRangeMap &file_range_map = compile_unit_info->GetFileRangeMap(this); + for (size_t idx = 0; + idx < file_range_map.GetSize(); + idx++) + { + const FileRangeMap::Entry* entry = file_range_map.GetEntryAtIndex(idx); + if (entry) + { + printf ("[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n", entry->GetRangeBase(), entry->GetRangeEnd()); + debug_aranges->AppendRange(dwarf2Data->GetID(), entry->GetRangeBase(), entry->GetRangeEnd()); + num_line_entries_added++; + } + } + } + } + return num_line_entries_added; +} |