Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>,
	 Peter.Schauer@regent.e-technik.tu-muenchen.de,
	 gdb@sourceware.org,
	 "'Pieter Maljaars'" <pieter.maljaars@altenpts.nl>,
	 "'Joseph S. Myers'" <joseph@codesourcery.com>
Subject: Re: Question about solaris CANNOT_STEP_HW_WATCHPOINTS macro
Date: Fri, 23 Apr 2010 00:56:00 -0000	[thread overview]
Message-ID: <201004230156.03303.pedro@codesourcery.com> (raw)
In-Reply-To: <20100422235956.GG13204@adacore.com>

On Friday 23 April 2010 00:59:56, Joel Brobecker wrote:
> > setting a watchpoint on myrec.x and
> > stepping should expose the bug if you
> > remove the CANNOT_STEP_HW_WATCHPOINT from nm-i386sol2.h
> 
> Looks like a different bug is now occurring:

...

> Looking at the infrun debug output:
> 
>     (gdb) set debug infrun 1
>     (gdb) s   
>     infrun: clear_proceed_status_thread (LWP 1)
>     infrun: proceed (addr=0xffffffff, signal=144, step=1)
>     infrun: resume (step=1, signal=0), trap_expected=0
>     infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
>     infrun: target_wait (-1, status) =
>     infrun:   3497 [LWP 1],
>     infrun:   status->kind = stopped, signal = SIGTRAP
>     infrun: infwait_normal_state
>     infrun: TARGET_WAITKIND_STOPPED
>     infrun: stop_pc = 0x8050684
>     infrun: stepped to a different line
>     infrun: stop_stepping
>     14        myrec.y = 3.4;
> 
> So we failed to notice that the watchpoint triggered - we should probably
> look in the area of procfs_stopped_by_watchpoint. Maybe another kernel
> issue???

I think older GDBs handled this because they always checked for
watchpoint hits at every SIGTRAP.  Notice the comment in infrun.c:

>  /* Some targets (e.g. Solaris x86) 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.  */
      ^^^^^^^^^^^

That underlined part of the comment is no longer true nowadays.

See PR9633 <http://sourceware.org/bugzilla/show_bug.cgi?id=9633>, which
points at some other target relying on it.

> If I use the "continue" command instead of a step, the infrun debug
> output looks like this:
> 
>     (gdb) cont
>     Continuing.
>     infrun: clear_proceed_status_thread (LWP 1)
>     infrun: proceed (addr=0xffffffff, signal=144, step=0)
>     infrun: resume (step=0, signal=0), trap_expected=0
>     infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
>     infrun: target_wait (-1, status) =
>     infrun:   3524 [LWP 1],
>     infrun:   status->kind = stopped, signal = SIGTRAP
>     infrun: infwait_normal_state
>     infrun: TARGET_WAITKIND_STOPPED
>     infrun: stop_pc = 0x8050684
>     infrun: stopped by watchpoint    <<<<<---------
>     infrun: (no data address available)
>     infrun: BPSTAT_WHAT_STOP_NOISY
>     infrun: stop_stepping
>     Hardware watchpoint 2: myrec.x
>     
>     Old value = 0
>     New value = 5
>     main () at foo.c:14
>     14        myrec.y = 3.4;
> 
> I ran watchpoint.exp alone and the testcase passes without any problem.
> 
> One last thing: It does not make any difference whether the
> CANNOT_STEP_HW_WATCHPOINT macro is defined or not.  So, I think that,
> starting with version 2.8, it's safe to not have it defined.

Do we still care for <= 2.7 at this point?  (and before someone
spontaneously says "yes"; does GDB still work okay on such old
Solaris systems?)

-- 
Pedro Alves


  reply	other threads:[~2010-04-23  0:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 20:07 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 [this message]
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

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=201004230156.03303.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=Peter.Schauer@regent.e-technik.tu-muenchen.de \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=joseph@codesourcery.com \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    --cc=pieter.maljaars@altenpts.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