Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
Cc: 'Pedro Alves' <pedro@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [RFA- v2] Testcase for bug report 11531 and fix for Solaris
Date: Sun, 25 Apr 2010 13:20:00 -0000	[thread overview]
Message-ID: <20100425132041.GA2732@adacore.com> (raw)
In-Reply-To: <002101cae3c0$a56276c0$f0276440$@muller@ics-cnrs.unistra.fr>

> PS1: Once this macro is removed, I will submit a RFA for the complete
> removal of nm-i386-sol2.h.
> PS2: The code inside infrun.c ought to be changed as well. If it is
> now non-functional I propose to generate a compilation error if the
> macro is still defined, this way third party users will not be
> surprised that it does not work...

Since nm-i386-sol2.h was the last user of the CANNOT_STEP_HW_WATCHPOINTS
macro, we should just purge it entirely.  We cannot worry about third
parties that did not contribute their code (that includes people like me
who still has lots of uncontributed code in the AdaCore version of GDB).

> ChangeLog entry:
> 2010-04-24  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* config/i386/nm-i386-sol2.h (CANNOT_STEP_HW_WATCHPOINTS):
> 	Remove macro.

As per the above, let's just purge the whole thing. You can, at your
convinience, just delete the line from the nm file and do the rest
of the purge separately, so do everything all in one patch.

> testsuite/ChangeLog entry:
> 
> 	PR breakpoints/11531.
> 	* testsuite/gdb.base/gdb11531.c: New file.
> 	* testsuite/gdb.base/gdb11531.exp: New file.


> +# If the breakpoint is at the same instruction as the 
> +# watchpoint value assignment
> +# you can fall into the problem of the stepping over the breakpoint
> +# location that can also trigger a watchpoint miss
> +# This is not the problem reported here.
> +# Thus we remove all breakpoints first.

Suggest a different wording:

# The breakpoint is probably at the instruction where the value being
# watched (myrec.x) gets updated.  This is the instruction where we
# expect to receive a watchpoint notification when we do the "stepi"
# below.  However, having the breakpoint at the same location as this
# intruction can possibly interfere with our testcase, as stepping
# over the breakpoint in order to get past it may incorrectly lead
# to the debugger missing the watchpoint hit.  This would be a bug
# in GDB, but this is not the bug that we are trying to test here.
# So, we remove all breakpoints first.

> +gdb_test "stepi" \
> +    "Old value = 0.*New value = 5.*" \
> +    "watchpoint variable triggers at next"

I would prefer that you would verify that the old value and new values
match exactly. The wildcard matching prevents that, so the test would
still pass even if the debugger printed that the new value was 51274793875.
It seems that the use of a wildcard here is just a cheap way of matching
a new-line sequence - the typical way of matching new-lines, I've found,
is to use "\[\r\n\]+". It's been helpful to define a variable with a short
name that contains that regexp and use that variable, rather than repeat
manually the new-line regexp...

> +gdb_test "start" "" "restart"
> +
> +gdb_test "next" "Old value = 0.*New value = 5.*" "watchpoint triggers after
> second start"

Can you explain the purpose of this part of the testcase. Again, the use
of the start command in a gdb_test does not work with some configurations.

-- 
Joel


  reply	other threads:[~2010-04-25 13:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 16:41 [RFA] Testcase for bug report 11531 Pierre Muller
2010-04-23 17:29 ` Joel Brobecker
2010-04-23 18:16   ` Pedro Alves
2010-04-23 18:25     ` Joel Brobecker
2010-04-24 15:13     ` [RFA- v2] Testcase for bug report 11531 and fix for Solaris Pierre Muller
2010-04-25 13:20       ` Joel Brobecker [this message]
2010-04-26 11:24         ` [RFA- v3] " Pierre Muller
2010-04-26 16:49           ` Joel Brobecker
2010-04-26 20:50             ` Pierre Muller
2010-04-25 20:10       ` [RFA- v2] " Pedro Alves
2010-04-26 10:55         ` [RFA- v2] Remove CANNOT_STEP_HW_WATCHPOINTS related code (was fix for bug 11531) Pierre Muller
2010-04-26 11:26           ` Pedro Alves
2010-04-26 11:50             ` Pierre Muller
2010-04-26 11:56               ` Pedro Alves
2010-04-26 12:03                 ` Pierre Muller
2010-04-26 11:29           ` Mark Kettenis
2010-04-26 11:52             ` Pierre Muller

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=20100425132041.GA2732@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /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