From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: Eli Zaretskii <eliz@is.elta.co.il>,
Mark Kettenis <kettenis@science.uva.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA/RFC 2] Remove hardware break and watchpoints at program exit.
Date: Fri, 11 Jan 2002 05:39:00 -0000 [thread overview]
Message-ID: <4.2.0.58.20020111143044.019c7e50@ics.u-strasbg.fr> (raw)
In-Reply-To: <2561-Fri11Jan2002143543+0200-eliz@is.elta.co.il>
At 13:35 11/01/2002 , Eli Zaretskii a écrit:
> > Date: Fri, 11 Jan 2002 13:00:44 +0100
> > From: Pierre Muller <muller@cerbere.u-strasbg.fr>
> >
> > In breakpoint_init_inferior
> > I added code that conditionally removes hardware watch and breakpoint
> > if the context is inf_exited, i.e. at exit of the debugged program.
>
>Thanks. I like this approach much better, especially because I never
>understood why does GDB do certain cleanups when the debuggee exits,
>but doesn't do other, similar cleanups.
>
> > I still kept the call to a generic hardware removal function
> > and testing the i386 case, I could see that even though the dr_mirror
> > array is zeored out, the dr_control_mirror and
> > dr_status_mirror still aren't set to zero.
> > For dr_control_register, this is due to an error in the I386_DR_DISABLE
> > because that macro only resets the active bit, but not the size and type bits
> > associated to that debug register.
>
>Why is this a problem? Once the active bit is off, the corresponding
>debug register is inactive, and its value is not important.
The code does already generate a claim for i386 linux:
the linux code tries to write the dr registers using ptrace
but as the process is already finished, this fails.
See i386-linux-nt.c line 741.
How could this be solved?
By adding a test
if (target_has_execution )
ptrace(....)
If this is correct, the same code should also be used for i386-bsd-nat.c
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
next prev parent reply other threads:[~2002-01-11 13:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-11 4:01 Pierre Muller
2002-01-11 4:38 ` Eli Zaretskii
2002-01-11 4:57 ` Pierre Muller
2002-01-11 5:58 ` Eli Zaretskii
2002-01-11 5:39 ` Pierre Muller [this message]
2002-01-11 6:06 ` Eli Zaretskii
2002-01-11 8:15 ` Pierre Muller
2002-01-11 9:20 ` [RFA/RFC 3] " Pierre Muller
2002-01-12 5:20 ` Mark Kettenis
2002-01-12 13:16 ` muller
2002-01-13 0:31 ` Eli Zaretskii
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.20020111143044.019c7e50@ics.u-strasbg.fr \
--to=muller@cerbere.u-strasbg.fr \
--cc=eliz@is.elta.co.il \
--cc=gdb-patches@sources.redhat.com \
--cc=kettenis@science.uva.nl \
/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