From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31919 invoked by alias); 15 Jun 2005 15:14:33 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31910 invoked by uid 22791); 15 Jun 2005 15:14:30 -0000 Received: from mail02.syd.optusnet.com.au (HELO mail02.syd.optusnet.com.au) (211.29.132.183) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 15 Jun 2005 15:14:30 +0000 Received: from localhost.localdomain (c220-237-160-143.lowrp1.vic.optusnet.com.au [220.237.160.143]) by mail02.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id j5FFEAQ0026237; Thu, 16 Jun 2005 01:14:11 +1000 From: Hamish Rodda To: Daniel Jacobowitz Subject: Re: Unwinding stack past main() when it has another name Date: Wed, 15 Jun 2005 15:14:00 -0000 User-Agent: KMail/1.7.2 Cc: gdb@sources.redhat.com References: <200506152247.07232.rodda@kde.org> <20050615141624.GB14209@nevyn.them.org> In-Reply-To: <20050615141624.GB14209@nevyn.them.org> MIME-Version: 1.0 Message-Id: <200506160112.58152.rodda@kde.org> Content-Type: multipart/signed; boundary="nextPart2779692.Nu1zizPnl4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-06/txt/msg00159.txt.bz2 --nextPart2779692.Nu1zizPnl4 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 1575 On Thu, 16 Jun 2005 12:16 am, Daniel Jacobowitz wrote: > On Wed, Jun 15, 2005 at 10:46:37PM +1000, Hamish Rodda wrote: > > Hi, > > > > I'm just curious if there's a better solution for a problem I've come up > > against recently. I have been using gdb 6.3 and finding that all of my > > kde program backtraces contain hundreds of irrelevant and corrupt-looki= ng > > frames. Upgrading to cvs fixed most of the problem (the corrupt looking > > frames), but some frames still remain before the main function, which in > > kde programs is called kdemain(). > > > > Is there something the kde sources can do to have gdb recognise kdemain= () > > as the replacement main() function, and thus prevent gdb from unwinding > > past it? > > Is there really no main() on the backtrace? There's no easy way in C > to mark another function as main or as not-backtraceable. Yep... here's a snippet: #21 0x00002aaaacab22fa in QApplication::exec () at=20 kernel/qapplication.cpp:2522 #22 0x00002aaaaabd0a84 in kdemain (argc=3D,=20 argv=3D0x7fffffbd8ce8) at /opt/kde4/src/kdebase/kate/app/kwritemain.cpp:696 #23 0x00002aaaaf227d95 in __libc_start_main () from /lib/libc.so.6 #24 0x00000000004007ea in _start () at ../sysdeps/x86_64/elf/start.S:113 In gdb 6.3 on amd64, this trace would be follwed by approx 800 - 1000 usele= ss=20 "frames". I don't exactly know why or how the kdemain() function works, but I know it= =20 has something to do with kdeinit... there's some comments in the source in= =20 the kde svn repository, under kdelibs/kinit/* Cheers, Hamish. --nextPart2779692.Nu1zizPnl4 Content-Type: application/pgp-signature Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBCsEV6H8BtnSmIlUYRAtqOAJ9yd937aLuz6neR+iQYM5zqcHz+4QCgz8OR ptn84shVc8rRnRmL4eJ3K6o= =+r/d -----END PGP SIGNATURE----- --nextPart2779692.Nu1zizPnl4--