Skip to content

[LLDB] Finish implementing support for DW_FORM_data16 #113508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ bool DWARFFormValue::SkipValue(dw_form_t form,
*offset_ptr += 8;
return true;

// 16 byte values
case DW_FORM_data16:
*offset_ptr += 16;
return true;

// signed or unsigned LEB 128 values
case DW_FORM_addrx:
case DW_FORM_loclistx:
Expand Down Expand Up @@ -578,6 +583,7 @@ bool DWARFFormValue::IsBlockForm(const dw_form_t form) {
case DW_FORM_block1:
case DW_FORM_block2:
case DW_FORM_block4:
case DW_FORM_data16:
return true;
default:
return false;
Expand Down Expand Up @@ -611,6 +617,7 @@ bool DWARFFormValue::FormIsSupported(dw_form_t form) {
case DW_FORM_data2:
case DW_FORM_data4:
case DW_FORM_data8:
case DW_FORM_data16:
case DW_FORM_string:
case DW_FORM_block:
case DW_FORM_block1:
Expand Down
15 changes: 15 additions & 0 deletions lldb/test/Shell/SymbolFile/DWARF/x86/DW_AT_const_value.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t
# RUN: %lldb %t \
# RUN: -o "target variable udata data1 data2 data4 data8 string strp ref4 udata_ptr" \
# RUN: -o "target variable --format x data16" \
# RUN: -o exit | FileCheck %s

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


.section .debug_abbrev,"",@progbits
.byte 1 # Abbreviation Code
Expand Down Expand Up @@ -88,6 +91,7 @@
var 15, 0x8 # DW_FORM_string
var 16, 0xe # DW_FORM_strp
var 17, 0x13 # DW_FORM_ref4
var 18, 0x1e # DW_FORM_data16
.byte 0 # EOM(3)
.section .debug_info,"",@progbits
.Lcu_begin0:
Expand Down Expand Up @@ -119,6 +123,11 @@
.Lulong_ptr:
.byte 2 # Abbrev DW_TAG_pointer_type
.long .Lulong-.Lcu_begin0 # DW_AT_type
.Lu128:
.byte 6 # Abbrev DW_TAG_base_type
.asciz "Lu128" # DW_AT_name
.byte 16 # DW_AT_byte_size
.byte 7 # DW_AT_encoding

.byte 10 # Abbrev DW_TAG_variable
.asciz "udata" # DW_AT_name
Expand Down Expand Up @@ -165,6 +174,12 @@
.long .Lulong_ptr-.Lcu_begin0 # DW_AT_type
.uleb128 0xdeadbeefbaadf00d # DW_AT_const_value

.byte 18 # Abbrev DW_TAG_variable
.asciz "data16" # DW_AT_name
.long .Lu128-.Lcu_begin0 # DW_AT_type
.quad 0xdeadbeefbaadf00d # DW_AT_const_value
.quad 0xdeadbeefbaadf00d # DW_AT_const_value

.byte 0 # End Of Children Mark
.Ldebug_info_end0:

Expand Down
Loading