This is the mail archive of the gdb-patches@sourceware.org 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]

Fix watchpoint-hw-hit-once.exp against x86 gdbserver


While comparing testresults for my pending step-over-breakpoints
patch, I noticed a pristine checkout has this failure when
testing against x86_64-linux gdbserver:

 Running ../../../src/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp ...
 FAIL: gdb.base/watchpoint-hw-hit-once.exp: continue to break-at-exit

This patch fixes it.  Tested with a local x86_64-linux gdbserver,
in both default mode and with the whole testsuite in
"breakpoint always-inserted on" mode and checked in.

A native x86 linux GDB fails this test in always-inserted
mode.  I'll address that at some other point.

-- 
Pedro Alves

2010-03-23  Pedro Alves  <pedro@codesourcery.com>

	gdb/gdbserver/
	* linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
	lwp had been stopped by a watchpoint.

---
 gdb/gdbserver/linux-x86-low.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: src/gdb/gdbserver/linux-x86-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-x86-low.c	2010-03-01 20:00:42.000000000 +0000
+++ src/gdb/gdbserver/linux-x86-low.c	2010-03-23 17:49:11.000000000 +0000
@@ -507,10 +507,11 @@ x86_linux_new_thread (void)
 static void
 x86_linux_prepare_to_resume (struct lwp_info *lwp)
 {
+  ptid_t ptid = ptid_of (lwp);
+
   if (lwp->arch_private->debug_registers_changed)
     {
       int i;
-      ptid_t ptid = ptid_of (lwp);
       int pid = ptid_get_pid (ptid);
       struct process_info *proc = find_process_pid (pid);
       struct i386_debug_reg_state *state = &proc->private->arch_private->debug_reg_state;
@@ -522,6 +523,9 @@ x86_linux_prepare_to_resume (struct lwp_
 
       lwp->arch_private->debug_registers_changed = 0;
     }
+
+  if (lwp->stopped_by_watchpoint)
+    x86_linux_dr_set (ptid, DR_STATUS, 0);
 }
 
 /* When GDBSERVER is built as a 64-bit application on linux, the


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