This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Joel Brobecker'" <brobecker at adacore dot com>, <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
- Cc: <gdb at sourceware dot org>, "'Pieter Maljaars'" <pieter dot maljaars at altenpts dot nl>, "'Joseph S. Myers'" <joseph at codesourcery dot com>, "'Pedro Alves'" <pedro at codesourcery dot com>
- Date: Thu, 22 Apr 2010 17:45:49 +0200
- Subject: RE: Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
- References: <001501cad820$36771f50$a3655df0$@muller@ics-cnrs.unistra.fr> <20100422135635.GE13204@adacore.com>
> -----Message d'origine-----
> De?: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] De la
> part de Joel Brobecker
> Envoyé?: Thursday, April 22, 2010 3:57 PM
> À?: Pierre Muller
> Cc?: gdb@sourceware.org; 'Pieter Maljaars'; 'Joseph S. Myers'; 'Pedro
> Alves'
> Objet?: Re: Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
>
> > The macro CANNOT_STEP_HW_WATCHPOINTS
> [...]
> > If this bug has been solve before 2.9 version of Solaris,
> > would it be reasonable to just drop that code out?
>
> I think we should still support version 2.8 if we can.
I have no objections
> I'd be happy to do any testing with some of our machines running
> Solaris,
> but I need a reproducer that I can run by hand. I am still under
> strict
> orders to *NOT* run the dejagnu testsuite on our solaris machines, as
> it
> causes them to crash pretty badly :-(.
The main problem is that the comment inside
infrun.c is not that clear...
The patch was discussed in 2000:
http://sourceware.org/ml/gdb-patches/2000-q1/msg00664.html
submitted by Peter Schauer.
But I don't know if this person still is reachable.
I suspect that the problem appears if
1) you are stepping
2) you have a watchpoint on some memory location
3) you modify some other location within the same
protected page.
The kernel stops because of the page protection,
sees that the accessed address is not the one you asked to
watch, thus restarts the debuggee, forgetting that
stepping was required.
This is at least how I understood it.
The problem is that I have no access
to a machine for which we can be sure that this bug
still exists ...
With this source
struct rec
{
int x;
double y;
int z;
};
static struct rec myrec;
int
main ()
{
myrec.x = 5;
myrec.y = 3.4;
myrec.z = 56;
myrec.x = 78;
return myrec.x;
}
setting a watchpoint on myrec.x and
stepping should expose the bug if you
remove the CANNOT_STEP_HW_WATCHPOINT from nm-i386sol2.h
Pierre