[PATCH] Don't use runto_main in i386-unwind.exp
Mark Kettenis
kettenis@chello.nl
Sun Nov 23 20:51:00 GMT 2003
Date: Sun, 23 Nov 2003 15:31:05 -0500
From: Daniel Jacobowitz <drow@mvista.com>
On Sun, Nov 23, 2003 at 08:37:04PM +0100, Mark Kettenis wrote:
> There is no real reson to use runto_main in this testcase, so I
> removed it.
>
> Committed,
>
> Mark
Please don't do this. runto_main works (suboptimally, but it works)
for remote targets which use a "target foo; load; continue" sequence,
but "run" doesn't.
How about gdb_run_cmd followed by a gdb_expect looking for the SIGTRAP?
Like the attached patch? Works for me.
Mark
Index: testsuite/gdb.arch/i386-unwind.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-unwind.exp,v
retrieving revision 1.2
diff -u -p -r1.2 i386-unwind.exp
--- testsuite/gdb.arch/i386-unwind.exp 23 Nov 2003 19:30:52 -0000 1.2
+++ testsuite/gdb.arch/i386-unwind.exp 23 Nov 2003 20:49:39 -0000
@@ -47,8 +47,19 @@ gdb_load ${binfile}
# Testcase for backtrace/1435.
-gdb_test "run" "Program received signal SIGTRAP.*" \
- "run past gdb1435"
+gdb_run_cmd
+
+gdb_expect {
+ -re "Program received signal SIGTRAP.*$gdb_prompt $" {
+ pass "run past gdb1435"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run past gdb1435"
+ }
+ timeout {
+ fail "run past gdb1435 (timeout)"
+ }
+}
gdb_test "backtrace 10" \
"#1\[ \t]*$hex in gdb1435.*\r\n#2\[ \t\]*$hex in main.*" \
More information about the Gdb-patches
mailing list