From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Michael Snyder <msnyder@vmware.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: Wed, 29 Dec 2010 02:37:00 -0000 [thread overview]
Message-ID: <20101229023654.GA9738@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <20101229022609.GA2413@adacore.com>
On Wed, 29 Dec 2010 03:26:09 +0100, Joel Brobecker wrote:
> > I'm guessing this happens because libc_start_main is compiled with -g.
> > Otherwise, gdb would continue executing "in the woods" until exit.
>
> Actually, off-by-one error :-). __libc_start_main is not compiled with
> debugging info,
It can be, depending on the OS:
7 return 0;
(gdb) next
8 }
(gdb) next
__libc_start_main (main=0x4004c4 <main>, argc=1, ubp_av=0x7fffffffdf08, init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fffffffdef8) at libc-start.c:258
258 exit (result);
(gdb) list
253 #else
254 /* Nothing fancy, just call the function. */
255 result = main (argc, argv, __environ MAIN_AUXVEC_PARAM);
256 #endif
257
258 exit (result);
259 }
(gdb) info source
Current source file is libc-start.c
Compilation directory is /usr/src/debug/glibc-2.12-232-gdbb0472/csu
Located in /usr/src/debug/glibc-2.12-232-gdbb0472/csu/libc-start.c
Contains 259 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
(gdb) _
fedora-release-14-1.noarch
glibc-debuginfo-2.12.90-21.x86_64
Regards,
Jan
next prev parent reply other threads:[~2010-12-29 2:37 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
2010-12-29 2:26 ` Joel Brobecker
2010-12-29 2:37 ` Jan Kratochvil [this message]
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=20101229023654.GA9738@host1.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=brobecker@adacore.com \
--cc=emachado@linux.vnet.ibm.com \
--cc=gdb@sourceware.org \
--cc=msnyder@vmware.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