X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FDebugInfo%2FDWARFDebugAranges.cpp;h=576d37d7813a9d1ef6d52a8bcfa7a480d445b66b;hb=92ec8e1427e595d540f2238c7a1bb05fbd013013;hp=b116f8f7d89eb93fe92636896b3060b088ae9461;hpb=358f4fd9ee078b3c79597fc688855fb48bc1f356;p=oota-llvm.git diff --git a/lib/DebugInfo/DWARFDebugAranges.cpp b/lib/DebugInfo/DWARFDebugAranges.cpp index b116f8f7d89..576d37d7813 100644 --- a/lib/DebugInfo/DWARFDebugAranges.cpp +++ b/lib/DebugInfo/DWARFDebugAranges.cpp @@ -83,11 +83,24 @@ 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) { const Range &range = Aranges[i]; - OS << format("0x%8.8x: [0x%8.8llx - 0x%8.8llx)", range.Offset, + OS << format("0x%8.8x: [0x%8.8llx - 0x%8.8llx)\n", range.Offset, (uint64_t)range.LoPC, (uint64_t)range.HiPC()); } }