diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2013-02-12 16:20:28 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2013-02-12 16:20:28 +0000 |
commit | e38825f490b898644089d5cd9cb90cec681bded8 (patch) | |
tree | 87b39ccb7224094c429ce281a014b9104d94223b /lib/DebugInfo/DWARFContext.cpp | |
parent | de53477c915105cb7828f9355ae5b3fc0cac4e04 (diff) | |
download | external_llvm-e38825f490b898644089d5cd9cb90cec681bded8.zip external_llvm-e38825f490b898644089d5cd9cb90cec681bded8.tar.gz external_llvm-e38825f490b898644089d5cd9cb90cec681bded8.tar.bz2 |
Add support for the pubnames section to llvm-dwarfdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFContext.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index d061f4e..9e19310 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -88,6 +88,24 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) { rangeList.dump(OS); } + if (DumpType == DIDT_All || DumpType == DIDT_Pubnames) { + OS << "\n.debug_pubnames contents:\n"; + DataExtractor pubNames(getPubNamesSection(), isLittleEndian(), 0); + offset = 0; + OS << "Length: " << pubNames.getU32(&offset) << "\n"; + OS << "Version: " << pubNames.getU16(&offset) << "\n"; + OS << "Offset in .debug_info: " << pubNames.getU32(&offset) << "\n"; + OS << "Size: " << pubNames.getU32(&offset) << "\n"; + OS << "\n Offset Name\n"; + while (offset < getPubNamesSection().size()) { + uint32_t n = pubNames.getU32(&offset); + if (n == 0) + break; + OS << format("%8x ", n); + OS << pubNames.getCStr(&offset) << "\n"; + } + } + if (DumpType == DIDT_All || DumpType == DIDT_AbbrevDwo) { OS << "\n.debug_abbrev.dwo contents:\n"; getDebugAbbrevDWO()->dump(OS); @@ -494,6 +512,8 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) : RangeDWOSection = data; RangeSection = data; } + else if (name == "debug_pubnames") + PubNamesSection = data; else if (name == "debug_info.dwo") InfoDWOSection = data; else if (name == "debug_abbrev.dwo") |