From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32280 invoked by alias); 8 Jan 2008 19:22:35 -0000 Received: (qmail 32270 invoked by uid 22791); 8 Jan 2008 19:22:35 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 Jan 2008 19:22:17 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m08JMFVw005297 for ; Tue, 8 Jan 2008 14:22:16 -0500 Received: from zebedee.littlepinkcloud.COM (vpn-14-83.rdu.redhat.com [10.11.14.83]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m08JMEvL031964; Tue, 8 Jan 2008 14:22:14 -0500 Received: from littlepinkcloud.COM (localhost.localdomain [127.0.0.1]) by zebedee.littlepinkcloud.COM (8.13.8/8.13.5) with ESMTP id m08JM7GS018808; Tue, 8 Jan 2008 19:22:10 GMT Received: (from aph@localhost) by littlepinkcloud.COM (8.13.8/8.13.5/Submit) id m08JM62B018805; Tue, 8 Jan 2008 19:22:06 GMT MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18307.52574.801980.775823@zebedee.pink> Date: Wed, 09 Jan 2008 14:08:00 -0000 From: Andrew Haley To: David Daney Cc: PRC , gcc-help Subject: Re: How to traceback call stack on MIPS arch? In-Reply-To: <4783CC42.2040807@avtrex.com> References: <200801081007106802280@gmail.com> <18307.21985.888303.875264@zebedee.pink> <4783CC42.2040807@avtrex.com> X-Mailer: VM 7.19 under Emacs 22.0.93.1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00077.txt.bz2 David Daney writes: > Andrew Haley wrote: > > PRC writes: > > > > > Gcc saves the frame pointer to fp(s8) register at the beginning of > > > each function if compiling source with -O0. But it won't do so if > > > compiling source with -O2. Without frame pointers, can I trace back > > > call stacks in current function context? Or is there any option > > > which forces gcc to save frame pointers for MIPS arch? > > > > You need to use the unwinder. > > > For that to work, you must compile all the code with -fexceptions. Or just -funwind-tables. Yes, I should have mentioned that. It's kinda lame that we break the old way of doing backtraces but don't compile the minimum unwinder data by default. Sigh. > You could also try compiling all the code with -fno-omit-framepointer > and writing your own unwinder. I posted such an unwinder to > java-patches@gcc.gnu.org several years ago. Later versions of GCC are > starting to do optimizations in the function prolog that make unwinding > without the unwinder meta-data very difficult. Right, which as far as I can see is the OP's problem. Andrew. -- Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK Registered in England and Wales No. 3798903