[Bug runtime/29984] New: systemtap can not parse DWARF-5 .debug_line
lijunlong at openresty dot com
sourceware-bugzilla@sourceware.org
Tue Jan 10 15:20:00 GMT 2023
https://sourceware.org/bugzilla/show_bug.cgi?id=29984
Bug ID: 29984
Summary: systemtap can not parse DWARF-5 .debug_line
Product: systemtap
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: runtime
Assignee: systemtap at sourceware dot org
Reporter: lijunlong at openresty dot com
Target Milestone: ---
on fedora34 aarch64, the dwarf version is 5.
the tapset function print_ubacktrace_fileline failed to get the line number.
I stap translater did not generate the .debug_line to the C code.
I found it the following patch will add the .debug_line data to the c code.
But the stap runtime does not support dwarf-5 also.
>
>@@ -7305,6 +7305,12 @@ dump_line_tables_check (void *data, size_t data_len)
>
> version = *((uint16_t *)ptr);
> ptr += 2;
>+ if (version > 4)
>+ {
>+ if (ptr + 2 > (uint8_t *)data + data_len)
>+ return DWARF_CB_ABORT;
>+ ptr += 2; /* address_size(1byte) and segment_selector_size(1byte)*/
>+ }
Below is my test data of the .debug_line dump by eu-readelf.
```
DWARF section [30] '.debug_line' at offset 0x1191e:
Table at offset 0:
Length: 76
DWARF version: 5
Prologue length: 42
Address size: 8
Segment selector size: 0
Min instruction length: 4
Max operations per instruction: 1
Initial value if 'is_stmt': 1
Line base: -5
Line range: 14
Opcode base: 13
Opcodes:
[ 1] 0 arguments
[ 2] 1 argument
[ 3] 1 argument
[ 4] 1 argument
[ 5] 1 argument
[ 6] 0 arguments
[ 7] 0 arguments
[ 8] 0 arguments
[ 9] 1 argument
[10] 0 arguments
[11] 0 arguments
[12] 1 argument
Directory table:
[path(line_strp)]
0 /tmp/t_stap_lS_In4M (7)
File name table:
[path(line_strp), directory_index(udata)]
0 test.c (0), 0
1 test.c (0), 0
Line number statements:
[ 36] set column to 16
[ 38] extended opcode 2: set address to 0x4005a8 <main>
[ 43] copy
[ 44] set column to 5
[ 46] special opcode 19: address+0 = 0x4005a8 <main>, line+1 = 2
[ 47] set column to 1
[ 49] set 'is_stmt' to 0
[ 4a] special opcode 19: address+0 = 0x4005a8 <main>, line+1 = 3
[ 4b] advance address by 8 to 0x4005b0 <__libc_csu_init>
[ 4d] extended opcode 1: end of sequence
```
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Systemtap
mailing list