From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31310 invoked by alias); 7 Sep 2004 12:27:52 -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 31233 invoked from network); 7 Sep 2004 12:27:42 -0000 Received: from unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sourceware.org with SMTP; 7 Sep 2004 12:27:42 -0000 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.12.10/8.12.10) with ESMTP id i87CRQxm010406; Tue, 7 Sep 2004 13:27:26 +0100 (BST) Received: from pc960.cambridge.arm.com (localhost.localdomain [127.0.0.1]) by pc960.cambridge.arm.com (8.12.8/8.12.8) with ESMTP id i87CRfvv029038; Tue, 7 Sep 2004 13:27:41 +0100 Received: (from rearnsha@localhost) by pc960.cambridge.arm.com (8.12.8/8.12.8/Submit) id i87CRd3c029036; Tue, 7 Sep 2004 13:27:39 +0100 X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha set sender to rearnsha@gcc.gnu.org using -f Subject: Re: GDB 6.2 for ARM: bug in backtrace when in Thumb mode From: Richard Earnshaw To: Thierry Cc: gdb@sources.redhat.com In-Reply-To: <20040907120204.43421.qmail@web61204.mail.yahoo.com> References: <20040907120204.43421.qmail@web61204.mail.yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: GNU Message-Id: <1094560059.8831.9.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 Date: Tue, 07 Sep 2004 12:27:00 -0000 X-SW-Source: 2004-09/txt/msg00050.txt.bz2 On Tue, 2004-09-07 at 13:02, Thierry wrote: > Hi there, > > I'm trying to debug an application compiled for the > ARM in Thumb mode. The 'backtrace' command seems buggy > as soon as there are more than 4 levels in the stack. > Besides, with the same code compiled in ARM mode, it > works perfectly. > > Here's an example: > > void dummy2(int a) > { > int b; > b = a; > } > > void dummy1(void) > { > dummy2(4); > } > > void dummy(void) > { > dummy1(); > } > > In my 'main', I call 'dummy()'. > > When I go step-by-step until I step into 'dummy2', the > 'bt' command gives the following result: > #0 dummy2 (a=4) at MainModule/src/dummy.c:4 > #1 0xc000039c in dummy1 () at > MainModule/src/dummy.c:9 > #2 0x00000000 in ?? () > > which is wrong! > > The files have been compiled with arm-elf-gcc with the > following options: > -ggdb -gdwarf-2 -c -mapcs -fomit-frame-pointer -mthumb > -mthumb-interwork -mlong-calls > -fsigned-char -mstructure-size-boundary=8 > -fshort-enums > > When I remove the option '-fomit-frame-pointer', it > works. > > Any idea? > Most (all?) Released versions of gcc don't generate unwind information for Thumb functions, so the unwinder gets confused if there's no frame pointer. It will be fixed in gcc-3.5, but I don't think it was fixed in time for gcc-3.4. R.