From: Michael Snyder <msnyder@vmware.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: next/step after main() function's return
Date: Tue, 28 Dec 2010 23:02:00 -0000 [thread overview]
Message-ID: <4D1A6C99.6050202@vmware.com> (raw)
In-Reply-To: <20101228082324.GA29391@host0.dyn.jankratochvil.net>
Jan Kratochvil wrote:
> On Tue, 28 Dec 2010 06:20:55 +0100, Joel Brobecker wrote:
>>> when issuing a next or step after main() function's return statement,
>>> gdb drops to __libc_start_main() from libc on x86 (or
>>> generic_start_main() on ppc and so on, depending on the arch if I'm
>>> not mistaken). Is it considered a bug or it's just the expected
>>> behavior?
>> I'd say that this is expected behavior. `main' is called by
>> __libc_start_main, so "next"-ing out of main will land in that function.
>
> With default `set backtrace past-main off' the user may expect it to behave
> differently. Still the atexit functions could be "next"ed so GDB would have
> to identify somehow their calls.
I'm guessing this happens because libc_start_main is compiled with -g.
Otherwise, gdb would continue executing "in the woods" until exit.
next prev parent reply other threads:[~2010-12-28 23:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-27 22:34 Edjunior Barbosa Machado
2010-12-28 5:21 ` Joel Brobecker
2010-12-28 8:24 ` Jan Kratochvil
2010-12-28 23:02 ` Michael Snyder [this message]
2010-12-29 2:26 ` Joel Brobecker
2010-12-29 2:37 ` Jan Kratochvil
2010-12-29 2:49 ` Joel Brobecker
2010-12-29 3:07 ` Jan Kratochvil
2010-12-29 19:26 ` Michael Snyder
2010-12-28 23:05 ` Michael Snyder
2010-12-29 3:58 ` Edjunior Barbosa Machado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D1A6C99.6050202@vmware.com \
--to=msnyder@vmware.com \
--cc=brobecker@adacore.com \
--cc=emachado@linux.vnet.ibm.com \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox