This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Fix watchpoint expectation.
- From: Fernando Nasser <fnasser at redhat dot com>
- To: "David S. Miller" <davem at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 18 Apr 2002 10:23:37 -0400
- Subject: Re: [PATCH] Fix watchpoint expectation.
- Organization: Red Hat Canada
- References: <200204171954.MAA06471@nuts.ninka.net>
David,
Please just fix the pattern to accept both line numbers instead
of duplicating it.
Thanks,
Fernando
"David S. Miller" wrote:
>
> On sparc64, functions can be completed with the following sequence:
>
> return %i7 + 8
> nop
>
> All other sparc cases do something similar to:
>
> ret
> restore
>
> The critical difference is that return basically does in one
> instruction what "ret+restore" do in 2 instructions. More
> specifically this means the frame of the function is released
> one instruction before control is transferred back to the caller.
>
> This means that is is legal for a watch point to go out of scope
> at the very end of the function instead of at the caller. I've
> updated the testsuite to suit.
>
> 2002-04-17 David S. Miller <davem@redhat.com>
>
> * gdb.base/commands.exp: Allow watchpoint to go out of scope at
> line 82 of run.c as well as line 57 to deal with platforms that
> release the frame early.
>
> --- ./testsuite/gdb.base/commands.exp.~1~ Tue Apr 16 10:56:47 2002
> +++ ./testsuite/gdb.base/commands.exp Tue Apr 16 10:58:53 2002
> @@ -330,8 +330,17 @@ proc watchpoint_command_test {} {
> timeout {fail "(timeout) end commands on watch"}
> }
> send_gdb "continue\n"
> +
> + # It is valid to finish up on either line 57 or line 82 of run.c
> + # The reason for this is that on some platforms, like sparc64,
> + # the frame is released in the epilogue of the callee before
> + # control is fully transferred back to the caller.
> +
> gdb_expect {
> -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:57.*$gdb_prompt $" {
> + pass "continue with watch"
> + }
> + -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:82.*$gdb_prompt $" {
> pass "continue with watch"
> }
> -re "$gdb_prompt $" {fail "continue with watch"}
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9