Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: gdb-patches@sources.redhat.com
Cc: msnyder@redhat.com, jimb@redhat.com, ac131313@redhat.com,
	kettenis@gnu.org
Subject: Resend: [RFA] Fix problem with i386 watchpoints after restarting
Date: Thu, 13 Jun 2002 00:20:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20020613091046.01957c70@ics.u-strasbg.fr> (raw)

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


             reply	other threads:[~2002-06-13  7:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-13  0:20 Pierre Muller [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.2.0.58.20020613091046.01957c70@ics.u-strasbg.fr \
    --to=muller@cerbere.u-strasbg.fr \
    --cc=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    --cc=kettenis@gnu.org \
    --cc=msnyder@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox