This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Testcase for bug report 11531
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 23 Apr 2010 13:29:33 -0400
- Subject: Re: [RFA] Testcase for bug report 11531
- References: <000301cae303$d6d068b0$84713a10$@muller@ics-cnrs.unistra.fr>
> +# Do not use run_to main
> +# as this sets a breakpoint at main.
> +# 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.
> +
> +gdb_test "start" ".*Temporary breakpoint.*"
Unfortunately, this does not work when testing with the remote protocol.
Do use "runto", but use "*main" instead of "main", or something like
that. That way, you should always stop before the instruction that
causes the watchpoint to trigger.
> +gdb_test "next" \
> + "Old value = 0.*New value = 5.*" \
> + "watchpoint variable triggers at next"
> +
> +gdb_test "continue" \
> + "Old value = .*New value = 78.*" \
> + "watchpoint variable triggers at continue"
This is a bit on the paranoid side, but can we use end-of-line
expressions rather than ".*" to match the line break? For instance,
I often use:
set eol "\[\r\n\]+"
gdb_test "next" \
"Old value = 0${eol}New value = 5${eol}" \
"watchpoint variable triggers at next"
It's unlikely that you'll have any other number than zero if the
leading digit is zero - but conceivably, we could print the new
value as 55 and still pass the test...
I did suggest at one time to provide a routine that takes a list of
regexp strings, and builds a regexp string joined with the typical
new-line regexp. That way, I could write the test as follow:
test_gdb_complete "pck" \
[multi_line "(p pck\\.ad\[sb\])?" \
"(p pck\\.ad\[sb\])?" \
"p pck.external_identical_one" \
"p pck.inner.inside_variable" \
"p pck.local_identical_one" \
"p pck.local_identical_two" \
"p pck.my_global_variable" \
"p pck.proc" ]
Daniel made another suggestion, which I needed time to investigate
and yet never did :-(.
--
Joel