From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A1653857709; Wed, 12 Apr 2023 13:12:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A1653857709 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681305171; bh=DxyLNN+XpcYR0GFxMrI+8+9jQ29eOcqvFGyU+7TJ6To=; h=From:To:Subject:Date:From; b=QuDkNZ7zky1ynNfOy1lSC61otnsikqS+TpLiVOH70lEZxvz7stdu+CL74t1dZ+YTK yBXZrEqMGV9ZWVxw4Vs9Q+wWNBwZdCI2UC0K5Xctn/s2kn8mKr1/mJs3H8gVzdfIsF 8YAnZ3ei1tbPpk91asYUMrfp4xsPwaMgMnZlj08E= From: "hluaw at connect dot ust.hk" To: gdb-prs@sourceware.org Subject: [Bug gdb/30338] New: GDB skips line when using "stepi" but keeps line when using "step". Date: Wed, 12 Apr 2023 13:12:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 13.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hluaw at connect dot ust.hk X-Bugzilla-Status: UNCONFIRMED 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=3D30338 Bug ID: 30338 Summary: GDB skips line when using "stepi" but keeps line when using "step". Product: gdb Version: 13.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: hluaw at connect dot ust.hk Target Milestone: --- Given the code: int a, b; int c(void) { a =3D b & 5; } int d() { c(); } int func_1() { char e; for (; e;); } int main() { int f; func_1(); for (; f < 10; f++) d(); } Compile with GCC 12.2.0 -O1 Break at func_1, using step and stepi yield different result. Specifically, step will stop at line 12, while stepi skips line 12. step 6 for (; e;); (gdb) s main () at r.c:11 11 for (; f < 10; f++) (gdb) s 12 d(); (gdb) s d () at r.c:3 3 int d() { c(); } stepi 6 for (; e;); (gdb) si main () at r.c:11 11 for (; f < 10; f++) (gdb) d () at r.c:3 3 int d() { c(); } readelf yields this. [0x0000007c] Special opcode 76: advance Address by 5 to 0x40112d and Line = by 1 to 12 [0x0000007d] Advance Line by -9 to 3 It seems that line 12 contains no code? Is it expected that stepi and step diverges? --=20 You are receiving this mail because: You are on the CC list for the bug.=