Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Resend: [RFA] Fix problem with i386 watchpoints after restarting
@ 2002-06-13  0:20 Pierre Muller
  2002-06-13  3:16 ` Mark Kettenis
  0 siblings, 1 reply; 13+ messages in thread
From: Pierre Muller @ 2002-06-13  0:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: msnyder, jimb, ac131313, kettenis

I sent this message 9 days ago, 
but didn't get any answer,
maybe the error was to forget to CC to breakpoint maintainers?
So I added Michael Synder, Jim Blandy and Andrew Cagney,
together with Mark Kettenis (as i386 target maintainer) on CC.

<<Start of original message>>

After much efforts to find a reasonable solution for
the bug that I already explained several times,
I think that I found an easy solution.
See http://sources.redhat.com/ml/gdb-patches/2001-11/msg00613.html
and all related threads.

In short, most i386 targets using the common hardware watchpoint code do 
not call i386_cleanup_dregs 
and this leads to big troubles because 
on a second run of a debugged program the watchpoint is not
inserted correctly.

This patch does call i386_cleanup_dregs for 
all i386 targets that define
I386_USE_GENERIC_WATCHPOINTS
by simply defining a custom 
child_post_startup_inferior function
in the part of i386-nat.c code
that depends on the
I386_USE_GENERIC_WATCHPOINTS
conditional.

Only drawback of that is that this 
function does not seem to be 
multi-arch compatible, 
but does it make sense to have 
native code multi-arched?


ChangeLog entry:

2002-06-04  Pierre Muller  <muller@ics.u-strasbg.fr>

	* i386-nat.c (child_post_startup_inferior): New function
	calling i386_cleanup_dregs if
	I386_USE_GENERIC_WATCHPOINTS is defined.
	* config/i386/nm-i386.h: define CHILD_POST_STARTUP_INFERIOR
	conditional to acknowledge that i386-nat.c has its
	own child_post_startup_inferior function.

Index: i386-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nat.c,v
retrieving revision 1.4
diff -u -p -r1.4 i386-nat.c
--- i386-nat.c  21 Sep 2001 07:16:03 -0000      1.4
+++ i386-nat.c  4 Jun 2002 10:58:17 -0000
@@ -230,6 +230,12 @@ i386_cleanup_dregs (void)
    dr_status_mirror  = 0;
  }

+void
+child_post_startup_inferior (ptid_t ptid)
+{
+  i386_cleanup_dregs ();
+}
+
  /* Print the values of the mirrored debug registers.
     This is called when maint_show_dr is non-zero.  To set that
     up, type "maint show-debug-regs" at GDB's prompt.  */
Index: config/i386/nm-i386.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/nm-i386.h,v
retrieving revision 1.2
diff -u -p -r1.2 nm-i386.h
--- config/i386/nm-i386.h       23 Mar 2001 16:17:45 -0000      1.2
+++ config/i386/nm-i386.h       4 Jun 2002 10:58:18 -0000
@@ -30,6 +30,9 @@
  #define TARGET_HAS_HARDWARE_WATCHPOINTS
  #endif

+/* Use child_post_startup_inferior to reset all debug registers */
+#define CHILD_POST_STARTUP_INFERIOR
+
  /* Clear the reference counts and forget everything we knew about DRi.  */
  extern void i386_cleanup_dregs (void);



Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-07-09 15:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-13  0:20 Resend: [RFA] Fix problem with i386 watchpoints after restarting Pierre Muller
2002-06-13  3:16 ` Mark Kettenis
2002-06-17  6:38   ` Pierre Muller
2002-07-04  6:45     ` Pierre Muller
2002-07-04  9:34       ` Daniel Jacobowitz
2002-07-04  9:37         ` Pierre Muller
2002-07-08 13:39           ` Andrew Cagney
2002-07-08 13:54             ` Mark Kettenis
2002-07-08 22:31               ` Eli Zaretskii
2002-07-09  1:40                 ` Pierre Muller
2002-07-09  7:15                   ` Pierre Muller
2002-07-09  7:50                     ` Andrew Cagney
2002-07-09  8:34                       ` Michal Ludvig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox