aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/DWARFFormValue.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-09-15 16:57:13 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-09-15 16:57:13 +0000
commit07d4b1c455e822c04dfebf8c199f2323eeae2a8f (patch)
tree0989ce630229dd91bbbed6c66f3be757602ec0b6 /llvm/lib/DebugInfo/DWARFFormValue.cpp
parenta9aa3c18e35ded0d10e16bef2a774989cbd5162f (diff)
downloadllvm-07d4b1c455e822c04dfebf8c199f2323eeae2a8f.zip
llvm-07d4b1c455e822c04dfebf8c199f2323eeae2a8f.tar.gz
llvm-07d4b1c455e822c04dfebf8c199f2323eeae2a8f.tar.bz2
DWARF: wire up .debug_str dumping.
llvm-svn: 139799
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFFormValue.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFFormValue.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/llvm/lib/DebugInfo/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARFFormValue.cpp
index 506aab8..705efe5 100644
--- a/llvm/lib/DebugInfo/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARFFormValue.cpp
@@ -9,6 +9,7 @@
#include "DWARFFormValue.h"
#include "DWARFCompileUnit.h"
+#include "DWARFContext.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
@@ -256,8 +257,8 @@ DWARFFormValue::skipValue(uint16_t form, DataExtractor debug_info_data,
}
void
-DWARFFormValue::dump(raw_ostream &OS, const DataExtractor *debug_str_data,
- const DWARFCompileUnit *cu) const {
+DWARFFormValue::dump(raw_ostream &OS, const DWARFCompileUnit *cu) const {
+ DataExtractor debug_str_data(cu->getContext().getStringSection(), true, 0);
uint64_t uvalue = getUnsigned();
bool cu_relative_offset = false;
@@ -302,19 +303,16 @@ DWARFFormValue::dump(raw_ostream &OS, const DataExtractor *debug_str_data,
case DW_FORM_sdata: OS << getSigned(); break;
case DW_FORM_udata: OS << getUnsigned(); break;
- case DW_FORM_strp:
- if (debug_str_data) {
- OS << format(" .debug_str[0x%8.8x] = ", (uint32_t)uvalue);
- const char* dbg_str = getAsCString(debug_str_data);
- if (dbg_str) {
- OS << '"';
- OS.write_escaped(dbg_str);
- OS << '"';
- }
- } else {
- OS << format("0x%08x", uvalue);
+ case DW_FORM_strp: {
+ OS << format(" .debug_str[0x%8.8x] = ", (uint32_t)uvalue);
+ const char* dbg_str = getAsCString(&debug_str_data);
+ if (dbg_str) {
+ OS << '"';
+ OS.write_escaped(dbg_str);
+ OS << '"';
}
break;
+ }
case DW_FORM_ref_addr:
OS << format("0x%016x", uvalue);
break;