From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13530 invoked by alias); 29 Dec 2010 19:26:00 -0000 Received: (qmail 13522 invoked by uid 22791); 29 Dec 2010 19:26:00 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Dec 2010 19:25:56 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 28EA249000; Wed, 29 Dec 2010 11:25:53 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id 21A97CD946; Wed, 29 Dec 2010 11:25:53 -0800 (PST) Message-ID: <4D1B8B40.5030509@vmware.com> Date: Wed, 29 Dec 2010 19:26:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: Joel Brobecker CC: Jan Kratochvil , Edjunior Barbosa Machado , "gdb@sourceware.org" Subject: Re: next/step after main() function's return 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> In-Reply-To: <20101229022609.GA2413@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00090.txt.bz2 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, but main is. When you do a "next" in main, GDB takes > the debugging info, and computes the address range that we need to > step out of. So, when main returns back to __libc_start_main, we're > done, and tell the user where we are. What you are describing, however, > happens once we land inside __libc_start_main, since there is no line > info to help us compute the next/step range. > Hmm, yes, and that's when I would expect us to keep stepping, looking for a line range, until eventually we exit.