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]

[RFA/testsuite] Handle MIPS in step-test.exp


The MIPS PIC calling conventions have a $gp register which needs to be
reloaded after function calls, so they need the same treatment IA-64 and PA
do in step-test.  I also needed to finish stepping past one call before
looking for the next or the test showed a bogus failure.

Is this OK?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2002-10-21  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.base/step-test.exp: Allow MIPS to return to the line of a
	function call.

Index: testsuite/gdb.base/step-test.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/step-test.exp,v
retrieving revision 1.5
diff -u -p -r1.5 step-test.exp
--- testsuite/gdb.base/step-test.exp	5 Apr 2002 00:30:09 -0000	1.5
+++ testsuite/gdb.base/step-test.exp	13 Oct 2002 22:55:02 -0000
@@ -78,7 +78,8 @@ gdb_test "step" ".*${decimal}.*myglob.*"
 # On PA64, we end up at a different instruction than PA32.
 # On IA-64, we also end up on callee instead of on the next line due
 # to the restoration of the global pointer (which is a caller-save).
-if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"]} {
+# Similarly on MIPS PIC targets.
+if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] || [istarget "mips*-*-*"]} {
     send_gdb "finish\n"
     gdb_expect {
         -re ".*${decimal}.*a.*5.*= a.*3.*$gdb_prompt $" { pass "step out 1" }
@@ -176,8 +177,11 @@ gdb_expect {
     # On PA64, we end up at a different instruction than PA32.
     # On IA-64, we end up on callee instead of on the following line due
     # to the restoration of the global pointer.
-    if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] } {
+    # Similarly on MIPS PIC targets.
+    if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] || [istarget "mips*-*-*"] } {
         pass "stepi: finish call 2"
+	test_i "stepi: past call" "stepi" \
+	  ".*${decimal}.*callee.*STEPI"  ".*${decimal}.*callee.*NEXTI"
     } else {
 	fail "stepi: finish call 2"
         return


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