From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E3CDF3858C83; Wed, 11 Jan 2023 10:03:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3CDF3858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673431417; bh=Dhz0jCASyaCRu5xcF3dnMlDs1gYWIikbnJDjNdWCXT0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TMsZFeuU/HjfYTa6uuxrzTQ70ykdFwyrBxOfxsboNs+Wc58IWlAHSkuehIJth7qSx LMKQ3fx9XILpYTD+XysKVPxuOOfa/XdM8/9V4X6zcIFOLXfuhixoHavU2HglAm+Qr2 0qw01R9j4BMGrOWBwFIwZtnFvjPcgcNJw9Rad0Ac= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/29962] FAIL: gdb.reverse/step-reverse.exp: reverse step into fn call Date: Wed, 11 Jan 2023 10:03:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: unknown 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: Message-ID: In-Reply-To: References: 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=3D29962 --- Comment #4 from Tom de Vries --- (In reply to Tom de Vries from comment #3) > As mentioned before, this failure shows up with gcc 9.4.0. >=20 > It doesn't show up with gcc 12.2.1, because of a difference in generated > code. >=20 > In the 12.2.1 case we have 4 insns: > ... > 401208: 8b 55 cc mov -0x34(%rbp),%edx > 40120b: 8b 45 d0 mov -0x30(%rbp),%eax > 40120e: 29 c2 sub %eax,%edx > 401210: 89 55 d4 mov %edx,-0x2c(%rbp) > ... > each with their line number entry: > ...=20 > step-reverse.c 78 0x401208 x > step-reverse.c 78 0x40120b x > step-reverse.c 78 0x40120e x > step-reverse.c 78 0x401210 x > ... In the gcc 9.4.0 case, we have 5 insns: ... 401228: 8b 55 cc mov -0x34(%rbp),%edx 40122b: 8b 45 d0 mov -0x30(%rbp),%eax 40122e: 29 c2 sub %eax,%edx 401230: 89 d0 mov %edx,%eax 401232: 89 45 d4 mov %eax,-0x2c(%rbp) ... but still 4 line number entries: ... step-reverse.c 78 0x401228 x step-reverse.c 78 0x40122b x step-reverse.c 78 0x40122e x step-reverse.c 78 0x401232 x ... Note that the insn at 0x401230 doesn't have it's own line number entry. So, we are at line 79: ... (gdb) stepi^M 79 callee(); /* STEPI TEST */^M ... and do a stepi, which lands us, as expected at insn 0x401232: ... stepi^M 78 a[5] =3D a[3] - a[4]; /* FINISH TEST */^M (gdb) PASS: gdb.reverse/step-reverse.exp: simple reverse stepi print /x $pc^M $2 =3D 0x401232^M (gdb) PASS: gdb.reverse/step-reverse.exp: print /x $pc ... Then we do a step, which lands us, unexpectedly, at insn 0x40122e: ... step^M 78 a[5] =3D a[3] - a[4]; /* FINISH TEST */^M (gdb) FAIL: gdb.reverse/step-reverse.exp: reverse step into fn call print /x $pc^M $3 =3D 0x40122e^M (gdb) PASS: gdb.reverse/step-reverse.exp: print /x $pc ... It's stepping over the 0x401230 insn without line number entry that triggers the problem. --=20 You are receiving this mail because: You are on the CC list for the bug.=