From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC797396E062; Tue, 10 Jan 2023 15:20:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC797396E062 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673364000; bh=mcfdvCxovstCzsIYK+0SkYJ34GGpXsaOnQd3ecxr9zw=; h=From:To:Subject:Date:From; b=goByMQzzmugD4Cg7YgxcSDHenx4srPkoaObtamReKZniI68isoo6T4Xludjt3dx1A tBXUsIxZ3IU8RCs/Gy/PLd6KA6n4ihO21sIuyL6SizkBS5m4oUicYSPjeGpnFxufNo dik7ArlGBeMfvC5H/gJEogFZoKZe9aIc3sfAULKw= From: "lijunlong at openresty dot com" To: systemtap@sourceware.org Subject: [Bug runtime/29984] New: systemtap can not parse DWARF-5 .debug_line Date: Tue, 10 Jan 2023 15:20:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lijunlong at openresty dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29984 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) >=20 > version =3D *((uint16_t *)ptr); > ptr +=3D 2; >+ if (version > 4) >+ { >+ if (ptr + 2 > (uint8_t *)data + data_len) >+ return DWARF_CB_ABORT; >+ ptr +=3D 2; /* address_size(1byte) and segment_selector_size(1b= yte)*/ >+ } 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
[ 43] copy [ 44] set column to 5 [ 46] special opcode 19: address+0 =3D 0x4005a8
, line+1 =3D 2 [ 47] set column to 1 [ 49] set 'is_stmt' to 0 [ 4a] special opcode 19: address+0 =3D 0x4005a8
, line+1 =3D 3 [ 4b] advance address by 8 to 0x4005b0 <__libc_csu_init> [ 4d] extended opcode 1: end of sequence ``` --=20 You are receiving this mail because: You are the assignee for the bug.=