This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/commit] arm-tdep.c: Do not single-step after hitting a watchpoint.


Re: question about ARM watchpoints

This patch fixes an issue with watchpoints on ARM targets, where
the debugger stops 2 instructions after the instruction causing
the watchpoint. GDB is expected to stop at the next instruction.

The problem is caused by the fact that GDB does an extra single-step
after receiving the watchpoint notification, because the
have_nonsteppable_watchpoint gdbarch attribute is set for ARM
targets. Our experiments indicate that this is incorrect, at
least for the versions of ARM that we tested on (ARMv7). We tried
to get confirmation of this through the ARM documentation, but
did not manage to get a clear answer. So, in light of evidence
that the current code is wrong for some versions of ARM, and
with the lack of evidence regarding the versions of ARM we could
not test on, this patch simply unsets this gdbarch attribute
for all versions of ARM.  The plan is to refine this later on
if/when we find that some systems behave differently.


        * arm-tdep.c (arm_gdbarch_init): Remove call to

Unless there are comments, I will commit the patch in a week.

Thank you!

 gdb/arm-tdep.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index f9feb52..990c4ad 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -10446,9 +10446,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   if (tdep->arm_abi == ARM_ABI_AUTO)
     tdep->arm_abi = ARM_ABI_APCS;
-  /* Watchpoints are not steppable.  */
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
   /* We used to default to FPA for generic ARM, but almost nobody
      uses that now, and we now provide a way for the user to force
      the model.  So default to the most useful variant.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]