From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 08B6D3858C50; Tue, 4 Oct 2022 20:43:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08B6D3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664916216; bh=F9UWydApsCZtVXq5VHkNkeC1AFsDA+R476+dtAfGmSE=; h=From:To:Subject:Date:From; b=RdD7nRrEwRo+jpNU+r6BVMvCD91rN3aiMeEnuISzFHL+1igln3vvfnem5PFciveR9 n+aVG6+UVZsUVtqvS8oeoHT8DGRlXltWUex7cgdEFD6otpEw9gz5OacXNq3yyUTun4 ds7FfghUqkPVjlJ+puxT0n7Av2f7g56mjDZBrhWI= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/107154] New: GDB jumping to end of block when stepping over construction of local variable Date: Tue, 04 Oct 2022 20:43:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107154 Bug ID: 107154 Summary: GDB jumping to end of block when stepping over construction of local variable Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- #include #include struct X { X(std::initializer_list, int) { } }; int main() { X x( {"", "", "", ""}, 1|4 ); return 0; } tmp$ g++ -g debug.C -o debug tmp$ gdb -q debug Reading symbols from debug... (gdb) start Temporary breakpoint 1 at 0x40123a: file debug.C, line 12. Starting program: /tmp/debug=20 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Temporary breakpoint 1, main () at debug.C:12 12 } (gdb) n 10 X x( {"", "", "", ""}, 1|4 ); (gdb)=20 12 } (gdb)=20 11 return 0; (gdb)=20 __libc_start_call_main (main=3Dmain@entry=3D0x401226 , argc=3Dargc@= entry=3D1, argv=3Dargv@entry=3D0x7fffffffd7a8) at ../sysdeps/nptl/libc_start_call_main= .h:74 74 exit (result); (gdb)=20 [Inferior 1 (process 577012) exited normally] Why does "start" break on the closing brace of main(), and then the construction of 'x' also jumps to the closing brace? In less trivial examples I've seen it jump back and forth multiple times: 243 libmap libs; (gdb) n 245 redi::ipstream in({"ldd", argv[arg]}, pstdout|pstderr); (gdb)=20 310 } (gdb)=20 245 redi::ipstream in({"ldd", argv[arg]}, pstdout|pstderr); (gdb)=20 310 } (gdb)=20 245 redi::ipstream in({"ldd", argv[arg]}, pstdout|pstderr); (gdb)=20 [Detaching after fork from child process 845854] 310 } (gdb)=