From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12392 invoked by alias); 11 Feb 2008 17:29:01 -0000 Received: (qmail 12383 invoked by uid 22791); 11 Feb 2008 17:29:00 -0000 X-Spam-Check-By: sourceware.org Received: from mx-1.enea.se (HELO mx-1.enea.se) (192.36.1.70) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 11 Feb 2008 17:28:35 +0000 Received: from mx-2.enea.se ([172.21.1.82]) by mx-1.enea.se with Microsoft SMTPSVC(6.0.3790.1830); Mon, 11 Feb 2008 18:28:31 +0100 Received: from [127.0.0.1] ([172.16.140.117]) by mx-2.enea.se over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 11 Feb 2008 18:28:32 +0100 Message-ID: <47B085BF.7090909@enea.se> Date: Mon, 11 Feb 2008 17:29:00 -0000 From: Stefan Bylund User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: gdb@sourceware.org Subject: Re: Does GDB 6.7.1 for PowerPC require the framepointer register for backtracing? References: <47B02B7D.40204@enea.se> <20080211130757.GB7796@caradoc.them.org> In-Reply-To: <20080211130757.GB7796@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2008-02/txt/msg00059.txt.bz2 Hi Daniel, Thanks for your information. We use GCC 3.4.4, and when debugging we use the compiler options -g -O0. I tried to add the compiler option -fomit-frame-pointer (which seems to be included by -O1 and higher but not by -O0) and then it works!!! So, my conclusion is that GDB 6.7.1 for PowerPC tries to take advantage of frame pointer information in the DWARF-2 debug information while GDB 6.3 does not. Is that correct? Is it always safe to use -fomit-frame-pointer on PowerPC, i.e. will it not make some type of C/C++ code undebuggable? Regards, Stefan Daniel Jacobowitz wrote: >On Mon, Feb 11, 2008 at 12:03:25PM +0100, Stefan Bylund wrote: > > >>Hi, >> >>We recently upgraded from GDB 6.3 to GDB 6.7.1 and noticed that for >>PowerPC we can longer get a backtrace in certain cases. The problem is >>that when we initially attach to an existing process on a remote target, >>only the PC and SP registers are available. This worked fine with GDB 6.3 >>when doing a backtrace. However, GDB 6.7.1 fails when doing a backtrace in >>this case, and it seems that it tries to use the framepointer register >>(R31) for doing the backtrace and since this register is not available >>(i.e. it has value 0 in GDB's perspective), the backtrace fails. >> >>Does GDB 6.7.1 requires the framepoint register (R31) for doing a backtrace? >> >> > >It depends on your program and the available symbols and unwind >information. For instance, it will use DWARF unwind tables if >they are provided. > > > >>I have also noticed that if I don't install the dwarf2_frame_sniffer() >>and rs6000_adjust_frame_regnum() functions in rs6000_gdbarch_init() in >>rs6000-tdep.c, the backtrace works again even if the framepointer >>register is not available. However, I'm not sure exactly why... Is it >>safe to omit these two functions? >> >> > >It sounds to me like you have DWARF information that says to use the >frame pointer. Do you know if that's true? > > > -- --------------------------------- Stefan Bylund Senior Software Engineer Enea Skalholtsgatan 9, Box 1033, SE-164 21 Kista, Sweden Direct: +46 8 50 71 43 25 Mobile: +46 709 71 43 25 stefan.bylund@enea.com www.enea.com --------------------------------- Enea - Embedded for Leaders ---------------------------------