bc67a32
for gdb-6.3/gdb/ChangeLog
bc67a32
from  Alexandre Oliva  <aoliva@redhat.com>
bc67a32
bc67a32
	* i386-linux-nat.c (i386_debug_register_for_thread): New struct.
bc67a32
	(i386_linux_set_dr_for_thread): Rename from...
bc67a32
	(i386_linux_set_debug_regs_for_thread): ... this, and
bc67a32
	add new function to catch exceptions in the old one.
bc67a32
1e7b928
Index: gdb-6.5/gdb/i386-linux-nat.c
bc67a32
===================================================================
1e7b928
--- gdb-6.5.orig/gdb/i386-linux-nat.c	2006-07-11 05:21:58.000000000 -0300
1e7b928
+++ gdb-6.5/gdb/i386-linux-nat.c	2006-07-11 05:24:29.000000000 -0300
1e7b928
@@ -27,6 +27,7 @@
1e7b928
 #include "observer.h"
1e7b928
 #include "target.h"
1e7b928
 #include "linux-nat.h"
1e7b928
+#include "exceptions.h"
1e7b928
 
1e7b928
 #include "gdb_assert.h"
1e7b928
 #include "gdb_string.h"
1e7b928
@@ -695,14 +696,33 @@ struct i386_debug_register_state
bc67a32
   unsigned long control;
bc67a32
 };
bc67a32
 
bc67a32
-static void
bc67a32
-i386_linux_set_debug_regs_for_thread (ptid_t ptid,
bc67a32
-				      struct i386_debug_register_state *dbs)
bc67a32
+struct i386_debug_register_for_thread
bc67a32
+{
bc67a32
+  ptid_t ptid;
bc67a32
+  struct i386_debug_register_state *dbs;
bc67a32
+};
bc67a32
+
bc67a32
+static int
bc67a32
+i386_linux_set_dr_for_thread (void *drp)
bc67a32
 {
bc67a32
+  ptid_t ptid = ((struct i386_debug_register_for_thread *)drp)->ptid;
bc67a32
+  struct i386_debug_register_state *dbs
bc67a32
+    = ((struct i386_debug_register_for_thread *)drp)->dbs;
bc67a32
   int i;
bc67a32
   for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
bc67a32
     i386_linux_dr_set_addr (ptid, i, dbs->addr[i]);
bc67a32
   i386_linux_dr_set_control (ptid, dbs->control);
bc67a32
+  return 1;
bc67a32
+}
bc67a32
+
bc67a32
+static int
bc67a32
+i386_linux_set_debug_regs_for_thread (ptid_t ptid,
bc67a32
+				      struct i386_debug_register_state *dbs)
bc67a32
+{
bc67a32
+  struct i386_debug_register_for_thread dr;
bc67a32
+  dr.ptid = ptid;
bc67a32
+  dr.dbs = dbs;
bc67a32
+  return catch_errors (i386_linux_set_dr_for_thread, &dr, "", RETURN_MASK_ALL);
bc67a32
 }
bc67a32
 
bc67a32
 /* Iterator function to support syncing debug registers across all threads.  */