From 769ef81fec526f3c7513c88e82f98045f8971d14 Mon Sep 17 00:00:00 2001 From: Antoine Tremblay Date: Mon, 30 Nov 2015 15:08:04 -0500 Subject: Fix breakpoint size when stepping over a permanent breakpoint in GDBServer. When manually stepping over a permanent breakpoint on ARM we need to fetch the right breakpoint size based on the current instruction set used. Since this is not encoded in the stop_pc, the instruction mode needs to be fetched from the CPSR register. This is done by introducing a new target operation called : breakpoint_kind_from_current_state. For other targets that do not need this, breakpoint_kind_from_pc is used. No regressions, tested on ubuntu 14.04 ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } gdb/gdbserver/ChangeLog: * linux-arm-low.c (arm_is_thumb_mode): New function. (arm_breakpoint_at): Use arm_is_thumb_mode. (arm_breakpoint_kind_from_current_state): New function. (struct linux_target_ops) : Initialize. * linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state. (linux_breakpoint_kind_from_current_state): New function. (struct target_ops : Initialize. * linux-low.h (struct linux_target_ops) : New field. * target.h (struct target_ops): Likewise. (target_breakpoint_kind_from_current_state): New macro. --- gdb/gdbserver/linux-low.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/gdbserver/linux-low.h') diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h index f1d4f0f..e2bfeb7 100644 --- a/gdb/gdbserver/linux-low.h +++ b/gdb/gdbserver/linux-low.h @@ -233,6 +233,9 @@ struct linux_target_ops /* Returns true if the low target supports range stepping. */ int (*supports_range_stepping) (void); + + /* See target.h. */ + int (*breakpoint_kind_from_current_state) (CORE_ADDR *pcptr); }; extern struct linux_target_ops the_low_target; -- cgit v1.1