public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB 6.2 for ARM: bug in backtrace when in Thumb mode
@ 2004-09-07 12:02 Thierry
  2004-09-07 12:27 ` Richard Earnshaw
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry @ 2004-09-07 12:02 UTC (permalink / raw)
  To: gdb

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?
 
Thanks in advance for your help,
 
 Thierry



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GDB 6.2 for ARM: bug in backtrace when in Thumb mode
  2004-09-07 12:02 GDB 6.2 for ARM: bug in backtrace when in Thumb mode Thierry
@ 2004-09-07 12:27 ` Richard Earnshaw
  2004-09-07 12:55   ` Thierry
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Earnshaw @ 2004-09-07 12:27 UTC (permalink / raw)
  To: Thierry; +Cc: gdb

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GDB 6.2 for ARM: bug in backtrace when in Thumb mode
  2004-09-07 12:27 ` Richard Earnshaw
@ 2004-09-07 12:55   ` Thierry
  0 siblings, 0 replies; 3+ messages in thread
From: Thierry @ 2004-09-07 12:55 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: gdb

No, indeed, it wasn't (I'm working with gcc 3.4).
I'll wait for gcc 3.5, then!

Thank you Richard.


--- Richard Earnshaw <rearnsha@gcc.gnu.org> wrote:

> 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.
> 



		
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-07 12:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-07 12:02 GDB 6.2 for ARM: bug in backtrace when in Thumb mode Thierry
2004-09-07 12:27 ` Richard Earnshaw
2004-09-07 12:55   ` Thierry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).