Support select ARM+THUMB mode when setting breakpoints
Fei Ding
fdingiit@gmail.com
Tue Jul 14 03:02:00 GMT 2015
Hi, there:
I've found a problem when setting breakpoints on ARM+THUMB code when
there is no symbol for object file (stripped).
For example, assume now I am at an ARM instruction (CPSR.T=0), and
going to set a breakpoint at a THUMB instruction, because there is no
symbol, GDB will make a 4-byte-long instruction (SVC maybe) wrongly,
which should be a 2-byte-long THUMB breakpoint instruction instead.
After continue the target, a SIGILL/SIGSEGV/SIGBUS error will appear.
This is not a bug of GDB I think, but may confuse the programmer when
debugging, especially SIGSEGV. Here is an issue reported on AOSP:
http://code.google.com/p/android/issues/detail?id=56962, which is
mostly the same problem, but it was closed without any solution.
Personally, I've made a workaround for this problem: let the user
specify the kind of breakpoint. For example, `b *0x12345 mode
arm/thumb'. The command of `mode arm/thumb' is not required, but
optional. Do you want a patch for this? Or maybe you can fix this as
your way, key function here is `int arm_pc_is_thumb (struct gdbarch
*gdbarch, CORE_ADDR memaddr)' of arm-tdep.c
Thanks && BRs.
More information about the Gdb
mailing list