From: Richard Earnshaw <rearnsha@gcc.gnu.org>
To: Thierry <goldy_gnu@yahoo.com>
Cc: gdb@sources.redhat.com
Subject: Re: GDB 6.2 for ARM: bug in backtrace when in Thumb mode
Date: Tue, 07 Sep 2004 12:27:00 -0000 [thread overview]
Message-ID: <1094560059.8831.9.camel@pc960.cambridge.arm.com> (raw)
In-Reply-To: <20040907120204.43421.qmail@web61204.mail.yahoo.com>
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.
next prev parent reply other threads:[~2004-09-07 12:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-07 12:02 Thierry
2004-09-07 12:27 ` Richard Earnshaw [this message]
2004-09-07 12:55 ` Thierry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1094560059.8831.9.camel@pc960.cambridge.arm.com \
--to=rearnsha@gcc.gnu.org \
--cc=gdb@sources.redhat.com \
--cc=goldy_gnu@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox