[Lldb-commits] [lldb] r164779 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
Greg Clayton
gclayton at apple.com
Thu Sep 27 09:48:25 PDT 2012
Author: gclayton
Date: Thu Sep 27 11:48:25 2012
New Revision: 164779
URL: http://llvm.org/viewvc/llvm-project?rev=164779&view=rev
Log:
Ashok Thirumurthi patch to enable the latest and greatest DWARF forms from the DWARF 4 specification.
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=164779&r1=164778&r2=164779&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Thu Sep 27 11:48:25 2012
@@ -171,60 +171,74 @@
{
// Blocks if inlined data that have a length field and the data bytes
// inlined in the .debug_info
- case DW_FORM_block : form_size = debug_info_data.GetULEB128 (&offset); break;
- case DW_FORM_block1 : form_size = debug_info_data.GetU8_unchecked (&offset); break;
- case DW_FORM_block2 : form_size = debug_info_data.GetU16_unchecked (&offset);break;
- case DW_FORM_block4 : form_size = debug_info_data.GetU32_unchecked (&offset);break;
+ case DW_FORM_exprloc :
+ case DW_FORM_block : form_size = debug_info_data.GetULEB128 (&offset); break;
+ case DW_FORM_block1 : form_size = debug_info_data.GetU8_unchecked (&offset); break;
+ case DW_FORM_block2 : form_size = debug_info_data.GetU16_unchecked (&offset);break;
+ case DW_FORM_block4 : form_size = debug_info_data.GetU32_unchecked (&offset);break;
// Inlined NULL terminated C-strings
- case DW_FORM_string :
+ case DW_FORM_string :
debug_info_data.GetCStr (&offset);
break;
// Compile unit address sized values
- case DW_FORM_addr :
- case DW_FORM_ref_addr :
+ case DW_FORM_addr :
+ case DW_FORM_ref_addr :
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 :
- case DW_FORM_ref1 :
+ case DW_FORM_data1 :
+ case DW_FORM_flag :
+ case DW_FORM_ref1 :
form_size = 1;
break;
// 2 byte values
- case DW_FORM_data2 :
- case DW_FORM_ref2 :
+ case DW_FORM_data2 :
+ case DW_FORM_ref2 :
form_size = 2;
break;
// 4 byte values
- case DW_FORM_strp :
- case DW_FORM_data4 :
- case DW_FORM_ref4 :
+ case DW_FORM_strp :
+ case DW_FORM_data4 :
+ case DW_FORM_ref4 :
form_size = 4;
break;
// 8 byte values
- case DW_FORM_data8 :
- case DW_FORM_ref8 :
+ case DW_FORM_data8 :
+ case DW_FORM_ref8 :
+ case DW_FORM_ref_sig8 :
form_size = 8;
break;
// signed or unsigned LEB 128 values
- case DW_FORM_sdata :
- case DW_FORM_udata :
- case DW_FORM_ref_udata :
+ case DW_FORM_sdata :
+ case DW_FORM_udata :
+ case DW_FORM_ref_udata :
debug_info_data.Skip_LEB128 (&offset);
break;
- case DW_FORM_indirect :
+ case DW_FORM_indirect :
form_is_indirect = true;
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 = m_offset;
return false;
@@ -318,61 +332,75 @@
{
// Blocks if inlined data that have a length field and the data bytes
// inlined in the .debug_info
- case DW_FORM_block : form_size = debug_info_data.GetULEB128(&offset); break;
- case DW_FORM_block1 : form_size = debug_info_data.GetU8(&offset); break;
- case DW_FORM_block2 : form_size = debug_info_data.GetU16(&offset); break;
- case DW_FORM_block4 : form_size = debug_info_data.GetU32(&offset); break;
+ case DW_FORM_exprloc :
+ case DW_FORM_block : form_size = debug_info_data.GetULEB128(&offset); break;
+ case DW_FORM_block1 : form_size = debug_info_data.GetU8(&offset); break;
+ case DW_FORM_block2 : form_size = debug_info_data.GetU16(&offset); break;
+ case DW_FORM_block4 : form_size = debug_info_data.GetU32(&offset); break;
// Inlined NULL terminated C-strings
- case DW_FORM_string : debug_info_data.GetCStr(&offset); break;
+ case DW_FORM_string : debug_info_data.GetCStr(&offset); break;
// Compile unit address sized values
- case DW_FORM_addr :
- case DW_FORM_ref_addr :
+ case DW_FORM_addr :
+ case DW_FORM_ref_addr :
form_size = cu_addr_size;
break;
+ // 0 sized form
+ case DW_FORM_flag_present:
+ form_size = 0;
+ break;
+
// 1 byte values
- case DW_FORM_data1 :
- case DW_FORM_flag :
- case DW_FORM_ref1 :
+ case DW_FORM_data1 :
+ case DW_FORM_flag :
+ case DW_FORM_ref1 :
form_size = 1;
break;
// 2 byte values
- case DW_FORM_data2 :
- case DW_FORM_ref2 :
+ case DW_FORM_data2 :
+ case DW_FORM_ref2 :
form_size = 2;
break;
// 4 byte values
- case DW_FORM_strp :
+ case DW_FORM_strp :
form_size = 4;
break;
- case DW_FORM_data4 :
- case DW_FORM_ref4 :
+ case DW_FORM_data4 :
+ case DW_FORM_ref4 :
form_size = 4;
break;
// 8 byte values
- case DW_FORM_data8 :
- case DW_FORM_ref8 :
+ case DW_FORM_data8 :
+ case DW_FORM_ref8 :
+ case DW_FORM_ref_sig8 :
form_size = 8;
break;
// signed or unsigned LEB 128 values
- case DW_FORM_sdata :
- case DW_FORM_udata :
- case DW_FORM_ref_udata :
+ case DW_FORM_sdata :
+ case DW_FORM_udata :
+ case DW_FORM_ref_udata :
debug_info_data.Skip_LEB128(&offset);
break;
- case DW_FORM_indirect :
+ case DW_FORM_indirect :
form = debug_info_data.GetULEB128(&offset);
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;
More information about the lldb-commits
mailing list