Skip to content

Commit c1df376

Browse files
[LLDB] Finish implementing support for DW_FORM_data16 (#113508)
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 f54cdc5 commit c1df376

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t
55
# RUN: %lldb %t \
66
# RUN: -o "target variable udata data1 data2 data4 data8 string strp ref4 udata_ptr" \
7+
# RUN: -o "target variable --format x data16" \
78
# RUN: -o exit | FileCheck %s
89

910
# CHECK-LABEL: target variable
@@ -22,6 +23,8 @@
2223
# CHECK: (char[7]) ref4 = <empty constant data>
2324
## A variable of pointer type.
2425
# CHECK: (unsigned long *) udata_ptr = 0xdeadbeefbaadf00d
26+
# CHECK: (unsigned __int128) data16 = 0xdeadbeefbaadf00ddeadbeefbaadf00d
27+
2528

2629
.section .debug_abbrev,"",@progbits
2730
.byte 1 # Abbreviation Code
@@ -88,6 +91,7 @@
8891
var 15, 0x8 # DW_FORM_string
8992
var 16, 0xe # DW_FORM_strp
9093
var 17, 0x13 # DW_FORM_ref4
94+
var 18, 0x1e # DW_FORM_data16
9195
.byte 0 # EOM(3)
9296
.section .debug_info,"",@progbits
9397
.Lcu_begin0:
@@ -119,6 +123,11 @@
119123
.Lulong_ptr:
120124
.byte 2 # Abbrev DW_TAG_pointer_type
121125
.long .Lulong-.Lcu_begin0 # DW_AT_type
126+
.Lu128:
127+
.byte 6 # Abbrev DW_TAG_base_type
128+
.asciz "Lu128" # DW_AT_name
129+
.byte 16 # DW_AT_byte_size
130+
.byte 7 # DW_AT_encoding
122131

123132
.byte 10 # Abbrev DW_TAG_variable
124133
.asciz "udata" # DW_AT_name
@@ -165,6 +174,12 @@
165174
.long .Lulong_ptr-.Lcu_begin0 # DW_AT_type
166175
.uleb128 0xdeadbeefbaadf00d # DW_AT_const_value
167176

177+
.byte 18 # Abbrev DW_TAG_variable
178+
.asciz "data16" # DW_AT_name
179+
.long .Lu128-.Lcu_begin0 # DW_AT_type
180+
.quad 0xdeadbeefbaadf00d # DW_AT_const_value
181+
.quad 0xdeadbeefbaadf00d # DW_AT_const_value
182+
168183
.byte 0 # End Of Children Mark
169184
.Ldebug_info_end0:
170185

0 commit comments

Comments
 (0)