From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 658DF3858D28; Tue, 2 Apr 2024 06:37:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 658DF3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712039825; bh=kZUAYgPRy+D7/c3/jfZiGFnysc0K82XF8yCYu60YR4I=; h=From:To:Subject:Date:From; b=Jsy7s9ziGxJunVInqgqnz+lbUVn1YGpTfg0Al/NCC0rvVHtxYGTkQdzRZ3lKoT8Ts WwGc/kbgIuK6MZDbQj5qTOl3tXtBqGyy15+CrSsMHs/e8Ky4qc7ERbpTZ+7ApziBPg qWwHQiaU9NPD7+POwezyYJ6SETTAqjgtD7W+c4H4= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/31592] New: [gdb/testsuite] gdb.dwarf2/dw2-epilogue-begin.exp drops epilogue_begin entry Date: Tue, 02 Apr 2024 06:37:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned 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=3D31592 Bug ID: 31592 Summary: [gdb/testsuite] gdb.dwarf2/dw2-epilogue-begin.exp drops epilogue_begin entry Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: testsuite Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- In https://sourceware.org/pipermail/gdb-patches/2024-March/207709.html it w= as mentioned that test-case gdb.dwarf2/dw2-epilogue-begin.exp exercises corner= case behaviour, so I investigated and found the following. Test-case gdb.dwarf2/dw2-epilogue-begin.exp contains the following dwarf assembly: ... DW_LNE_set_address main_epilogue line $main_epilogue DW_LNS_set_epilogue_begin DW_LNS_copy DW_LNE_end_sequence ... which translates into the following decoded linetable with readelf -wL: ... dw2-epilogue-begin.c: File name Line number Starting address View=20= =20=20 Stmt /data/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-epilogue-begin.c: dw2-epilogue-begin.c 20 0x4004b7=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c 27 0x4004be=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c 34 0x4004d0=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c 37 0x4004de=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c 38 0x4004ec=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c 43 0x4004ef=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c 47 0x4004fa=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c 50 0x4004ff=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 x dw2-epilogue-begin.c - 0x4004ff ... or alternatively, with llvm-dwarfdump --debug-line: ... Address Line Column File ISA Discriminator Flags ------------------ ------ ------ ------ --- ------------- ------------- 0x00000000004004b7 20 0 0 0 0 is_stmt prologue= _end epilogue_begin 0x00000000004004be 27 0 0 0 0 is_stmt 0x00000000004004d0 34 0 0 0 0 is_stmt prologue= _end 0x00000000004004de 37 0 0 0 0 is_stmt epilogue_begin 0x00000000004004ec 38 0 0 0 0 is_stmt 0x00000000004004ef 43 0 0 0 0 is_stmt prologue= _end 0x00000000004004fa 47 0 0 0 0 is_stmt 0x00000000004004ff 50 0 0 0 0 is_stmt epilogue_begin 0x00000000004004ff 50 0 0 0 0 is_stmt end_sequ= ence ... Note that the end of sequence is at 0x4004ff, which excludes the entry at l= ine 50 with the same address from that sequence, which gdb indeed does: ... $ gdb -q -batch outputs/gdb.dwarf2/dw2-epilogue-begin/dw2-epilogue-begin -ex start -ex "maint info line-tab" Temporary breakpoint 1 at 0x4004ef: file /data/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-epilogue-begin.c, line 43. Temporary breakpoint 1, main () at /data/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-epilogue-begin.c:43 43 { /* main prologue */ objfile: /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-epilog= ue-begin/dw2-epilogue-begin ((struct objfile *) 0x3ed4570) compunit_symtab: dw2-prologue-end.c ((struct compunit_symtab *) 0x3ebec70) symtab: dw2-prologue-end.c ((struct symtab *) 0x3ebf370) linetable: ((struct linetable *) 0x0): No line table. objfile: /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-epilog= ue-begin/dw2-epilogue-begin ((struct objfile *) 0x3ed4570) compunit_symtab: dw2-prologue-end.c ((struct compunit_symtab *) 0x3ebec70) symtab: /data/vries/gdb/binutils-gdb.git/gdb/testsuite/gdb.dwarf2/dw2-epilogue-begi= n.c ((struct symtab *) 0x3ebed00) linetable: ((struct linetable *) 0x3ebf2d0): INDEX LINE REL-ADDRESS UNREL-ADDRESS IS-STMT PROLOGUE-END EPILOGUE-BEGIN=20 0 20 0x00000000004004b7 0x00000000004004b7 Y Y Y= =20=20=20=20=20=20 1 27 0x00000000004004be 0x00000000004004be Y=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 2 34 0x00000000004004d0 0x00000000004004d0 Y Y=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 3 37 0x00000000004004de 0x00000000004004de Y Y= =20=20=20=20=20=20 4 38 0x00000000004004ec 0x00000000004004ec Y=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 5 43 0x00000000004004ef 0x00000000004004ef Y Y=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 6 47 0x00000000004004fa 0x00000000004004fa Y=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 7 END 0x00000000004004ff 0x00000000004004ff Y=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ... So, either this is intended behaviour and the test-case requires a comment,= or the test-case needs fixing. Anyway the test-case passes in the current form, so it's not clear if the dropped entry is actually needed. Note that dropping the entry explicitly in the dwarf assembly like so: ... @@ -130,10 +130,6 @@ Dwarf::assemble $asm_file { DW_LNS_copy DW_LNE_set_address main_epilogue - line $main_epilogue - DW_LNS_set_epilogue_begin - DW_LNS_copy - DW_LNE_end_sequence } } ... still exercises the same cornercase. --=20 You are receiving this mail because: You are on the CC list for the bug.=