Skip to content

Commit e1986e8

Browse files
author
walter erquinigo
committed
[LLDB] Finish implementing support for DW_FORM_data16
This FORM already has support within LLDB to be parsed as a 16-byte BLOCK, and all that is left to properly support it in the DWARFParser is to add it to some enums. With this, I can debug programs that use libstdc++.so.6.0.33 built with GCC.
1 parent a91ebcd commit e1986e8

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ bool DWARFFormValue::SkipValue(dw_form_t form,
306306
*offset_ptr += 8;
307307
return true;
308308

309+
// 16 byte values
310+
case DW_FORM_data16:
311+
*offset_ptr += 16;
312+
return true;
313+
309314
// signed or unsigned LEB 128 values
310315
case DW_FORM_addrx:
311316
case DW_FORM_loclistx:
@@ -578,6 +583,7 @@ bool DWARFFormValue::IsBlockForm(const dw_form_t form) {
578583
case DW_FORM_block1:
579584
case DW_FORM_block2:
580585
case DW_FORM_block4:
586+
case DW_FORM_data16:
581587
return true;
582588
default:
583589
return false;
@@ -611,6 +617,7 @@ bool DWARFFormValue::FormIsSupported(dw_form_t form) {
611617
case DW_FORM_data2:
612618
case DW_FORM_data4:
613619
case DW_FORM_data8:
620+
case DW_FORM_data16:
614621
case DW_FORM_string:
615622
case DW_FORM_block:
616623
case DW_FORM_block1:

lldb/test/Shell/SymbolFile/DWARF/x86/DW_AT_const_value.s

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t
55
# RUN: %lldb %t \
6-
# RUN: -o "target variable udata data1 data2 data4 data8 string strp ref4 udata_ptr" \
6+
# RUN: -o "target variable udata data1 data2 data4 data8 data16 string strp ref4 udata_ptr" \
77
# RUN: -o exit | FileCheck %s
88

99
# CHECK-LABEL: target variable
@@ -14,6 +14,7 @@
1414
# CHECK: (unsigned long) data2 = 4742
1515
# CHECK: (unsigned long) data4 = 47424742
1616
# CHECK: (unsigned long) data8 = 4742474247424742
17+
# CHECK: (unsigned __int128) data16 = 129440743495415807670381713415221633377
1718
## Variables specified using string forms. This behavior purely speculative -- I
1819
## don't know of any compiler that would represent character strings this way.
1920
# CHECK: (char[7]) string = "string"
@@ -88,6 +89,7 @@
8889
var 15, 0x8 # DW_FORM_string
8990
var 16, 0xe # DW_FORM_strp
9091
var 17, 0x13 # DW_FORM_ref4
92+
var 18, 0x1e # DW_FORM_data16
9193
.byte 0 # EOM(3)
9294
.section .debug_info,"",@progbits
9395
.Lcu_begin0:
@@ -119,6 +121,11 @@
119121
.Lulong_ptr:
120122
.byte 2 # Abbrev DW_TAG_pointer_type
121123
.long .Lulong-.Lcu_begin0 # DW_AT_type
124+
.Lu128:
125+
.byte 6 # Abbrev DW_TAG_base_type
126+
.asciz "Lu128" # DW_AT_name
127+
.byte 16 # DW_AT_byte_size
128+
.byte 7 # DW_AT_encoding
122129

123130
.byte 10 # Abbrev DW_TAG_variable
124131
.asciz "udata" # DW_AT_name
@@ -165,6 +172,11 @@
165172
.long .Lulong_ptr-.Lcu_begin0 # DW_AT_type
166173
.uleb128 0xdeadbeefbaadf00d # DW_AT_const_value
167174

175+
.byte 18 # Abbrev DW_TAG_variable
176+
.asciz "data16" # DW_AT_name
177+
.long .Lu128-.Lcu_begin0 # DW_AT_type
178+
.asciz "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # DW_AT_const_value
179+
168180
.byte 0 # End Of Children Mark
169181
.Ldebug_info_end0:
170182

0 commit comments

Comments
 (0)