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: Peter Schauer <peterschauer at gmx dot net>
- To: pierre dot muller at ics-cnrs dot unistra dot fr (Pierre Muller)
- Cc: brobecker at adacore dot com ('Joel Brobecker'), Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de, gdb at sourceware dot org, pieter dot maljaars at altenpts dot nl ('Pieter Maljaars'), joseph at codesourcery dot com ('Joseph S. Myers'), pedro at codesourcery dot com ('Pedro Alves')
- Date: Thu, 22 Apr 2010 18:50:42 +0200 (CEST)
- Subject: Re: Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
Thanks Pierre, you are describing the problem perfectly well.
According to my notes the problem caused
FAIL: gdb.base/watchpoint.exp: until to ival1 assignment
FAIL: gdb.base/watchpoint.exp: until to ival3 assignment
FAIL: gdb.base/watchpoint.exp: until out of loop
FAIL: gdb.base/watchpoint.exp: step to ival2 assignment
regressions, but your example should trigger the problem as well.
IIRC, it happened on x86 Solaris 2.6 and early 2.7 systems, and was
fixed in 2.8 systems.
Unfortunately I have no longer access to any Solaris system, so
I can't be of any help here.
Sorry,
> > -----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
--
Peter Schauer Peter.Schauer@mytum.de