summaryrefslogtreecommitdiff
path: root/lib/DebugInfo
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-01-17 03:00:04 +0000
committerEric Christopher <echristo@gmail.com>2013-01-17 03:00:04 +0000
commit446b88fb81e14f5fa6f98ca924c83edc856cade7 (patch)
treeea74cd51a4d1a7baca69aeaf696a630a15796052 /lib/DebugInfo
parentd96c72a14cf327af98cbc7d3491f7a2248f5137d (diff)
downloadllvm-446b88fb81e14f5fa6f98ca924c83edc856cade7.tar.gz
llvm-446b88fb81e14f5fa6f98ca924c83edc856cade7.tar.bz2
llvm-446b88fb81e14f5fa6f98ca924c83edc856cade7.tar.xz
Fix the assembly and dissassembly of DW_FORM_sec_offset. Found this by
changing both the string of the dwo_name to be correct and the type of the statement list. Testcases all around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r--lib/DebugInfo/DWARFDebugInfoEntry.cpp12
-rw-r--r--lib/DebugInfo/DWARFFormValue.cpp15
2 files changed, 9 insertions, 18 deletions
diff --git a/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/lib/DebugInfo/DWARFDebugInfoEntry.cpp
index bb118501c1..02b15d6904 100644
--- a/lib/DebugInfo/DWARFDebugInfoEntry.cpp
+++ b/lib/DebugInfo/DWARFDebugInfoEntry.cpp
@@ -203,11 +203,9 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFCompileUnit *cu,
form = debug_info_data.getULEB128(&offset);
break;
+ // FIXME: 64-bit for DWARF64
case DW_FORM_sec_offset:
- if (cu->getAddressByteSize() == 4)
- debug_info_data.getU32(offset_ptr);
- else
- debug_info_data.getU64(offset_ptr);
+ debug_info_data.getU32(offset_ptr);
break;
default:
@@ -344,11 +342,9 @@ DWARFDebugInfoEntryMinimal::extract(const DWARFCompileUnit *cu,
form_is_indirect = true;
break;
+ // FIXME: 64-bit for DWARF64.
case DW_FORM_sec_offset:
- if (cu->getAddressByteSize() == 4)
- debug_info_data.getU32(offset_ptr);
- else
- debug_info_data.getU64(offset_ptr);
+ debug_info_data.getU32(offset_ptr);
break;
default:
diff --git a/lib/DebugInfo/DWARFFormValue.cpp b/lib/DebugInfo/DWARFFormValue.cpp
index ea59c1d780..9f807aac5f 100644
--- a/lib/DebugInfo/DWARFFormValue.cpp
+++ b/lib/DebugInfo/DWARFFormValue.cpp
@@ -72,7 +72,7 @@ static const uint8_t form_sizes_addr8[] = {
8, // 0x14 DW_FORM_ref8
0, // 0x15 DW_FORM_ref_udata
0, // 0x16 DW_FORM_indirect
- 8, // 0x17 DW_FORM_sec_offset
+ 4, // 0x17 DW_FORM_sec_offset
0, // 0x18 DW_FORM_exprloc
0, // 0x19 DW_FORM_flag_present
8, // 0x20 DW_FORM_ref_sig8
@@ -299,12 +299,9 @@ DWARFFormValue::skipValue(uint16_t form, DataExtractor debug_info_data,
form = debug_info_data.getULEB128(offset_ptr);
break;
- // 4 for DWARF32, 8 for DWARF64.
+ // FIXME: 4 for DWARF32, 8 for DWARF64.
case DW_FORM_sec_offset:
- if (cu->getAddressByteSize() == 4)
- *offset_ptr += 4;
- else
- *offset_ptr += 8;
+ *offset_ptr += 4;
return true;
default:
@@ -427,11 +424,9 @@ DWARFFormValue::dump(raw_ostream &OS, const DWARFCompileUnit *cu) const {
OS << "DW_FORM_indirect";
break;
+ // Should be formatted to 64-bit for DWARF64.
case DW_FORM_sec_offset:
- if (cu->getAddressByteSize() == 4)
- OS << format("0x%08x", (uint32_t)uvalue);
- else
- OS << format("0x%016" PRIx64, uvalue);
+ OS << format("0x%08x", (uint32_t)uvalue);
break;
default: