From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30537 invoked by alias); 28 Dec 2010 08:24:01 -0000 Received: (qmail 30528 invoked by uid 22791); 28 Dec 2010 08:24:00 -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; Tue, 28 Dec 2010 08:23:55 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBS8NT9E014087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Dec 2010 03:23:29 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBS8NRJk028343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Dec 2010 03:23:28 -0500 Received: from host0.dyn.jankratochvil.net (host0.dyn.jankratochvil.net [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id oBS8NQkL029456; Tue, 28 Dec 2010 09:23:26 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id oBS8NPr9029455; Tue, 28 Dec 2010 09:23:25 +0100 Date: Tue, 28 Dec 2010 08:24:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: Edjunior Barbosa Machado , gdb@sourceware.org Subject: Re: next/step after main() function's return Message-ID: <20101228082324.GA29391@host0.dyn.jankratochvil.net> References: <4D19144E.1030504@linux.vnet.ibm.com> <20101228052055.GY2618@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101228052055.GY2618@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/msg00081.txt.bz2 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. Regards, Jan