diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-14 20:52:27 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-14 20:52:27 +0000 |
| commit | 3266493603b2e77d1fca273be6410a546262459e (patch) | |
| tree | 54d31942ef5e1ca3beca8db82588c9f1fb2a10b3 /llvm/lib/DebugInfo/DWARFDebugAranges.cpp | |
| parent | d48ed128e0f8d7745362a0120526db377f33e830 (diff) | |
| download | bcm5719-llvm-3266493603b2e77d1fca273be6410a546262459e.tar.gz bcm5719-llvm-3266493603b2e77d1fca273be6410a546262459e.zip | |
DWARF: Generate the address lookup table from the DIE tree if .debug_aranges is not available.
Ported from LLDB.
llvm-svn: 139732
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugAranges.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugAranges.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugAranges.cpp b/llvm/lib/DebugInfo/DWARFDebugAranges.cpp index b116f8f7d89..5053e19b71c 100644 --- a/llvm/lib/DebugInfo/DWARFDebugAranges.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugAranges.cpp @@ -83,6 +83,19 @@ bool DWARFDebugAranges::extract(DataExtractor debug_aranges_data) { return false; } +bool DWARFDebugAranges::generate(DWARFContext *ctx) { + clear(); + if (ctx) { + const uint32_t num_compile_units = ctx->getNumCompileUnits(); + for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) { + DWARFCompileUnit *cu = ctx->getCompileUnitAtIndex(cu_idx); + if (cu) + cu->buildAddressRangeTable(this, true); + } + } + return !isEmpty(); +} + void DWARFDebugAranges::dump(raw_ostream &OS) const { const uint32_t num_ranges = getNumRanges(); for (uint32_t i = 0; i < num_ranges; ++i) { |

