Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
@ 2010-04-09 20:07 Pierre Muller
  2010-04-22 13:56 ` Joel Brobecker
  0 siblings, 1 reply; 14+ messages in thread
From: Pierre Muller @ 2010-04-09 20:07 UTC (permalink / raw)
  To: gdb
  Cc: 'Pieter Maljaars', 'Joseph S. Myers',
	'Pedro Alves'

   The macro
CANNOT_STEP_HW_WATCHPOINTS
is currently only defined at one location 
in the whole gdb sources:
gdb/config/i386/nm-i386sol2.h
with the following comment:
/* Solaris x86 2.6 and 2.7 targets have a kernel bug when stepping
   over an instruction that causes a page fault without triggering
   a hardware watchpoint. The kernel properly notices that it shouldn't
   stop, because the hardware watchpoint is not triggered, but it forgets
   the step request and continues the program normally.
   Work around the problem by removing hardware watchpoints if a step is
   requested, GDB will check for a hardware watchpoint trigger after the
   step anyway.  */

  I would like to know if any of the solaris gurus
around knows if this bug is still present in newer version of the solaris
kernel or at which version it has been fixed.

  I looked into OpenSolaris sources,
but watchpoint.c (which is where I suspect 
hardware watchpoints are handled)
was not updated since OpenSolaris launch in June 2005.

  On the other hand, the macro 
seems to have been introduced into the configuration file
back in April 2000 (revision 1.3 of current CVS tree).
  So this leaves about 5 years for a possible fix inside
the Solaris kernel.

  If this bug has been solve before 2.9 version of Solaris,
would it be reasonable to just drop that code out?

  Pieter, did you consider that issue when writing the
gdbserver port for Solaris?


Pierre Muller
Pascal language support maintainer for GDB



^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
@ 2010-04-23  7:42 Pieter Maljaars
  2010-04-23 12:42 ` Pierre Muller
  2010-04-23 13:27 ` Pedro Alves
  0 siblings, 2 replies; 14+ messages in thread
From: Pieter Maljaars @ 2010-04-23  7:42 UTC (permalink / raw)
  To: Joel Brobecker, Pierre Muller
  Cc: Peter.Schauer, gdb, 'Joseph S. Myers', 'Pedro Alves'

> Looks like a different bug is now occurring:
> 
>     (gdb) start
>     Temporary breakpoint 1 at 0x805067a: file foo.c, line 13.
>     Starting program: [...]/foo 
>     
>     Temporary breakpoint 1, main () at foo.c:13
>     13        myrec.x = 5;
>     (gdb) print myrec.x
>     $1 = 0
>     (gdb) watch myrec.x
>     Hardware watchpoint 2: myrec.x
>     (gdb) s
>     14        myrec.y = 3.4;

I have tested this with Solaris 2.10 and GDB-7.1. I have removed 
the CANNOT_STEP_HW_WATCHPOINT define.  Here this bug does not occur.

    (gdb) start
    Temporary breakpoint 1 at 0x8050681: file watchp.c, line 13.
    Starting program: [...]/watchp

    Temporary breakpoint 1, main () at watchp.c:13
    13        myrec.x = 5;
    (gdb) print myrec.x
    $1 = 0
    (gdb) watch myrec.x
    Hardware watchpoint 2: myrec.x
    (gdb) s
    Hardware watchpoint 2: myrec.x
    
    Old value = 0
    New value = 5
    main () at watchp.c:14
    14        myrec.y = 3.4;


Here it works as expected.  GDB stops also at the other watchpoint.
So with "step" and "continue" both watchpoints are triggered, like
it behaves on x86-linux.

Pieter Maljaars


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
@ 2010-04-23 14:05 Pieter Maljaars
  0 siblings, 0 replies; 14+ messages in thread
From: Pieter Maljaars @ 2010-04-23 14:05 UTC (permalink / raw)
  To: Pedro Alves
  Cc: Joel Brobecker, Pierre Muller, Peter.Schauer, gdb,
	'Joseph S. Myers'

> (I assume this was x86 or x86-64 solaris, not sparc.)  

Yes, it's x86. I forgot to mention it.

> _don't_ remove the CANNOT_STEP_HW_WATCHPOINT, then I suppose
> you'll see watchpoints being missed when you step (since
> the workaround works by removing watchpoints
> when single-stepping) on Solaris 10 as well.

That's correct.  The watchpoints are missed when stepping.  If 
I use "continue", GDB stops at the watchpoints.

Pieter


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

end of thread, other threads:[~2010-04-23 16:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 20:07 Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro Pierre Muller
2010-04-22 13:56 ` Joel Brobecker
2010-04-22 15:47   ` Pierre Muller
2010-04-22 16:51     ` Peter Schauer
2010-04-23  0:00     ` Joel Brobecker
2010-04-23  0:56       ` Pedro Alves
2010-04-23  3:36         ` Joel Brobecker
2010-04-23  7:42 Pieter Maljaars
2010-04-23 12:42 ` Pierre Muller
2010-04-23 12:59   ` Joel Brobecker
2010-04-23 13:27 ` Pedro Alves
2010-04-23 14:08   ` Joel Brobecker
2010-04-23 16:17     ` Pierre Muller
2010-04-23 14:05 Pieter Maljaars

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