[rfc] Strip Thumb bit from PC returned by arm_get_longjmp_target

Ulrich Weigand
2010-08-17T19:16:07Z

Hello,

when stepping over code performing a longjmp on Thumb code,
I'm seeing warning messages along the lines of:
warning: Breakpoint address adjusted from 0x4002d29d to 0x4002d29c.

(This happens e.g. in gdb.threads/threxit-hop-specific.exp.)

This is caused by arm_get_longjmp_target returning a value with
the Thumb bit set, which the rest of the code doesn't expect.

Fixed by calling arm_addr_bits_remove on the PC value returned
from arm_get_longjmp_target.

Tested on armv7l-linux-gnueabi with no regressions.

Any comments? I'm planning on committing this within a couple
of days.

Bye,
Ulrich

ChangeLog:

* arm-tdep.c (arm_get_longjmp_target): Strip extra bits from
returned PC value.

Index: gdb/arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.304
diff -u -p -r1.304 arm-tdep.c
--- gdb/arm-tdep.c 27 May 2010 19:06:12 -0000 1.304
+++ gdb/arm-tdep.c 16 Aug 2010 19:05:36 -0000
@@ -5852,6 +5852,7 @@ arm_get_longjmp_target (struct frame_inf
return 0;

*pc = extract_unsigned_integer (buf, INT_REGISTER_SIZE, byte_order);
+ *pc = arm_addr_bits_remove (gdbarch, *pc);
return 1;
}