failed to single step over bad thumb->arm boundary
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GDB |
Fix Released
|
Low
|
Ulrich Weigand |
Bug Description
Hardware: Beagleboard
gdb built from gdb-linaro/7.2 bzr rev 32978
I screwed upa thumb assembler file by missing the .thumb_func off, while trying to figure this out I tried single stepping with gdb, however the gdb doesn't stop at the incorrect branch (which I think is trying to branch to my thumb code as ARM code):
-------
$ more wrapper.c
#include <stdio.h>
extern int foo(int a,int b);
int main()
{
printf("Result: %d\n", foo(5,6));
}
-------
$ more simple.s
.thumb
.text
.align 2
.global foo
.thumb
foo:
mov r0,#42
bx lr
-------
cross build it:
arm-linux-
arm-linux-
arm-linux-
scp fiddle across to beagle and:
# ./try/bin/gdb ./fiddle
GNU gdb (Linaro GDB) 7.2-2010.10-1-bzr
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "armv7l-
For bug reporting instructions, please see:
<http://
Reading symbols from /root/fiddle...(no debugging symbols found)...done.
(gdb) break main
Breakpoint 1 at 0x83b0
(gdb) set lang asm
(gdb) display/i $pc
(gdb) r
Starting program: /root/fiddle
Breakpoint 1, 0x000083b0 in main ()
1: x/i $pc
=> 0x83b0 <main+8>: movt r4, #0
(gdb) si
0x000083b4 in main ()
1: x/i $pc
=> 0x83b4 <main+12>: mov.w r0, #5
(gdb)
0x000083b8 in main ()
1: x/i $pc
=> 0x83b8 <main+16>: mov.w r1, #6
(gdb)
0x000083bc in main ()
1: x/i $pc
=> 0x83bc <main+20>: blx 0x83d0 <foo>
(gdb) disassemble 0x83d0
Dump of assembler code for function foo:
0x000083d0 <+0>: movs r0, #42 ; 0x2a
0x000083d2 <+2>: bx lr
End of assembler dump.
(gdb) si
Result: 66656
Program exited normally.
(gdb)
Related branches
Changed in gdb-linaro: | |
status: | Fix Committed → Fix Released |
First of all, .thumb_func is missing in simple.s, I got SIGILL when I run fiddle on my system.
lp667309$ ./fiddle
Illegal instruction
When I add .thumb_func in simple.s, everything works well in both Linaro GDB and FSF GDB head.
I don't think simple.s is a proper case, since itself is not correct. I am inclined to turn this ticket as INVALID.