From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13285 invoked by alias); 29 Dec 2010 02:37:29 -0000 Received: (qmail 13276 invoked by uid 22791); 29 Dec 2010 02:37:27 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Dec 2010 02:37:22 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBT2b0av025632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Dec 2010 21:37:00 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBT2avmN032533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Dec 2010 21:36:59 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id oBT2av4p010429; Wed, 29 Dec 2010 03:36:57 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id oBT2asgV010415; Wed, 29 Dec 2010 03:36:54 +0100 Date: Wed, 29 Dec 2010 02:37:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: Michael Snyder , Edjunior Barbosa Machado , "gdb@sourceware.org" Subject: Re: next/step after main() function's return Message-ID: <20101229023654.GA9738@host1.dyn.jankratochvil.net> References: <4D19144E.1030504@linux.vnet.ibm.com> <20101228052055.GY2618@adacore.com> <20101228082324.GA29391@host0.dyn.jankratochvil.net> <4D1A6C99.6050202@vmware.com> <20101229022609.GA2413@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101229022609.GA2413@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00085.txt.bz2 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
, argc=1, ubp_av=0x7fffffffdf08, init=, fini=, rtld_fini=, 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