This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix watchpoint expectation.



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"}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]