public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/107154] New: GDB jumping to end of block when stepping over construction of local variable
@ 2022-10-04 20:43 redi at gcc dot gnu.org
  2022-10-04 20:44 ` [Bug debug/107154] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-04 20:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107154

            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 <initializer_list>
#include <string>

struct X {
  X(std::initializer_list<std::string>, 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 
[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) 
12      }
(gdb) 
11        return 0;
(gdb) 
__libc_start_call_main (main=main@entry=0x401226 <main()>, argc=argc@entry=1,
argv=argv@entry=0x7fffffffd7a8) at ../sysdeps/nptl/libc_start_call_main.h:74
74        exit (result);
(gdb) 
[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) 
310     }
(gdb) 
245       redi::ipstream in({"ldd", argv[arg]}, pstdout|pstderr);
(gdb) 
310     }
(gdb) 
245       redi::ipstream in({"ldd", argv[arg]}, pstdout|pstderr);
(gdb) 
[Detaching after fork from child process 845854]
310     }
(gdb)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-04-18 20:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 20:43 [Bug debug/107154] New: GDB jumping to end of block when stepping over construction of local variable redi at gcc dot gnu.org
2022-10-04 20:44 ` [Bug debug/107154] " redi at gcc dot gnu.org
2022-10-04 20:44 ` pinskia at gcc dot gnu.org
2022-10-04 20:48 ` [Bug debug/107154] [12/13 Regression] " jason at gcc dot gnu.org
2022-10-04 21:01 ` redi at gcc dot gnu.org
2022-10-04 22:54 ` cvs-commit at gcc dot gnu.org
2022-10-06 10:39 ` [Bug debug/107154] [12 " rguenth at gcc dot gnu.org
2023-04-18 20:45 ` cvs-commit at gcc dot gnu.org
2023-04-18 20:47 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).