llvm-dwarfdump: Add support for dumping the .debug_loc section

This is a basic implementation - we still don't have any support (that I
know of) for dumping DWARF expressions in a meaningful way, so the
location information itself is just printed as a sequence of bytes as we
do elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184361 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-06-19 21:37:13 +00:00
parent ba54bca472
commit 3df7d2f70b
11 changed files with 211 additions and 1 deletions

View File

@ -126,9 +126,13 @@ DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
Value.uval = data.getU16(offset_ptr);
break;
case DW_FORM_data4:
case DW_FORM_ref4:
case DW_FORM_ref4: {
RelocAddrMap::const_iterator AI = cu->getRelocMap()->find(*offset_ptr);
Value.uval = data.getU32(offset_ptr);
if (AI != cu->getRelocMap()->end())
Value.uval += AI->second.second;
break;
}
case DW_FORM_data8:
case DW_FORM_ref8:
Value.uval = data.getU64(offset_ptr);