diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-15 16:57:13 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-15 16:57:13 +0000 |
commit | 34f864fd382156331c61fbb6b7ae4828108b9d69 (patch) | |
tree | 1f1263c4821c34ae7e4e41f6fe5268ee21abca9d /lib/DebugInfo/DWARFContext.cpp | |
parent | 70796ca867132fd8c767301061afb9760cd69167 (diff) | |
download | external_llvm-34f864fd382156331c61fbb6b7ae4828108b9d69.zip external_llvm-34f864fd382156331c61fbb6b7ae4828108b9d69.tar.gz external_llvm-34f864fd382156331c61fbb6b7ae4828108b9d69.tar.bz2 |
DWARF: wire up .debug_str dumping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFContext.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index 68f58d9..215effa 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "DWARFContext.h" +#include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -27,8 +28,18 @@ void DWARFContext::dump(raw_ostream &OS) { set.dump(OS); OS << "\n.debug_lines contents:\n"; - DataExtractor lineData(getLineSection(), isLittleEndian(), 8); + // FIXME: must be done per CU. + DataExtractor lineData(getLineSection(), isLittleEndian(), /*FIXME*/8); DWARFDebugLine::dump(lineData, OS); + + OS << "\n.debug_str contents:\n"; + DataExtractor strData(getStringSection(), isLittleEndian(), 0); + offset = 0; + uint32_t lastOffset = 0; + while (const char *s = strData.getCStr(&offset)) { + OS << format("0x%8.8x: \"%s\"\n", lastOffset, s); + lastOffset = offset; + } } const DWARFDebugAbbrev *DWARFContext::getDebugAbbrev() { |