diff options
author | Eric Christopher <echristo@apple.com> | 2012-08-24 01:14:23 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-08-24 01:14:23 +0000 |
commit | d999bb7ff42fdd6204a7156647f76c55f4dbd1a5 (patch) | |
tree | 6dea97d65e34b1abf398dd4ef35bbe53f29936be /llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp | |
parent | 67942acc6b3959a19d83948db555127f33412d44 (diff) | |
download | bcm5719-llvm-d999bb7ff42fdd6204a7156647f76c55f4dbd1a5.tar.gz bcm5719-llvm-d999bb7ff42fdd6204a7156647f76c55f4dbd1a5.zip |
Add support for some missing DW_FORM_*.
TODO: Fix code duplication and coding style.
llvm-svn: 162525
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp index f58a147d33b..b5a4f9450ac 100644 --- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp @@ -126,6 +126,7 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFCompileUnit *cu, switch (form) { // Blocks if inlined data that have a length field and the data bytes // inlined in the .debug_info. + case DW_FORM_exprloc: case DW_FORM_block: form_size = debug_info_data.getULEB128(&offset); break; @@ -150,6 +151,11 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFCompileUnit *cu, form_size = cu->getAddressByteSize(); break; + // 0 sized form. + case DW_FORM_flag_present: + form_size = 0; + break; + // 1 byte values case DW_FORM_data1: case DW_FORM_flag: @@ -173,6 +179,7 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFCompileUnit *cu, // 8 byte values case DW_FORM_data8: case DW_FORM_ref8: + case DW_FORM_ref_sig8: form_size = 8; break; @@ -188,6 +195,13 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFCompileUnit *cu, form = debug_info_data.getULEB128(&offset); break; + case DW_FORM_sec_offset: + if (cu->getAddressByteSize() == 4) + debug_info_data.getU32(offset_ptr); + else + debug_info_data.getU64(offset_ptr); + break; + default: *offset_ptr = Offset; return false; @@ -249,6 +263,7 @@ DWARFDebugInfoEntryMinimal::extract(const DWARFCompileUnit *cu, switch (form) { // Blocks if inlined data that have a length field and the data // bytes // inlined in the .debug_info + case DW_FORM_exprloc: case DW_FORM_block: form_size = debug_info_data.getULEB128(&offset); break; @@ -273,6 +288,11 @@ DWARFDebugInfoEntryMinimal::extract(const DWARFCompileUnit *cu, form_size = cu_addr_size; break; + // 0 byte value + case DW_FORM_flag_present: + form_size = 0; + break; + // 1 byte values case DW_FORM_data1: case DW_FORM_flag: @@ -299,6 +319,7 @@ DWARFDebugInfoEntryMinimal::extract(const DWARFCompileUnit *cu, // 8 byte values case DW_FORM_data8: case DW_FORM_ref8: + case DW_FORM_ref_sig8: form_size = 8; break; @@ -314,6 +335,13 @@ DWARFDebugInfoEntryMinimal::extract(const DWARFCompileUnit *cu, form_is_indirect = true; break; + case DW_FORM_sec_offset: + if (cu->getAddressByteSize() == 4) + debug_info_data.getU32(offset_ptr); + else + debug_info_data.getU64(offset_ptr); + break; + default: *offset_ptr = offset; return false; |