summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/DWARFContext.cpp')
-rw-r--r--lib/DebugInfo/DWARFContext.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp
index 68f58d9031..215effac41 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() {