This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: GDB is stepping past main()
- From: "Nathan J. Williams" <nathanw at wasabisystems dot com>
- To: Konstantin Karganov <kostik at ispras dot ru>
- Cc: Daniel Jacobowitz <drow at false dot org>, gdb at sources dot redhat dot com
- Date: 13 Jul 2005 09:39:05 -0400
- Subject: Re: GDB is stepping past main()
- References: <Pine.LNX.4.44.0507131654350.6056-100000@ispserv.ispras.ru>
Konstantin Karganov <kostik@ispras.ru> writes:
> > Because the user (in your example) has asked it to step out of main.
> I asked to step and started waiting for the program termination message.
> And get that stopped somewhere "don't know where"...
>
> > If you want to handle this in a debugger, try detecting when you're in
> > main, step, are no longer in main, and main is no longer in the
> > backtrace.
> Don't you think all this detecting is a debugger's task???
>
> Or else it turns out that the "step" in gdb is broken and has no
> defined semantics and needs to be carefully controlled from outside
> (whether it made the stepping or not and where it happened to stop)!
"step" is a command that's closely linked to the notion of a source
code line. When you're outside of the region where you have source
(such as the startup code around main()), you're in less-defined
territory.
You might find the "stepi" command better suits your needs, though I'm
not at all sure from your messages what, exactly, you think is
supposed to happen.
- Nathan