Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Don't use runto_main in i386-unwind.exp
@ 2003-11-23 19:37 Mark Kettenis
  2003-11-23 20:31 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2003-11-23 19:37 UTC (permalink / raw)
  To: gdb-patches

There is no real reson to use runto_main in this testcase, so I
removed it.

Committed,

Mark

Index: testsuite/ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdb.arch/i386-unwind.exp: Don't use runto_main.  Change
	"continue" into "run".

Index: testsuite/gdb.arch/i386-unwind.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-unwind.exp,v
retrieving revision 1.1
diff -u -p -r1.1 i386-unwind.exp
--- testsuite/gdb.arch/i386-unwind.exp 19 Nov 2003 17:42:43 -0000 1.1
+++ testsuite/gdb.arch/i386-unwind.exp 23 Nov 2003 19:28:23 -0000
@@ -45,18 +45,10 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-#
-# Run to `main' where we begin our tests.
-#
-
-if ![runto_main] then {
-    gdb_suppress_tests
-}
-
 # Testcase for backtrace/1435.
 
-gdb_test "continue" "Program received signal SIGTRAP.*" \
-         "continue past gdb1435"
+gdb_test "run" "Program received signal SIGTRAP.*" \
+         "run past gdb1435"
 
 gdb_test "backtrace 10" \
 	"#1\[ \t]*$hex in gdb1435.*\r\n#2\[ \t\]*$hex in main.*" \


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Don't use runto_main in i386-unwind.exp
  2003-11-23 19:37 [PATCH] Don't use runto_main in i386-unwind.exp Mark Kettenis
@ 2003-11-23 20:31 ` Daniel Jacobowitz
  2003-11-23 20:51   ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-11-23 20:31 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

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?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Don't use runto_main in i386-unwind.exp
  2003-11-23 20:31 ` Daniel Jacobowitz
@ 2003-11-23 20:51   ` Mark Kettenis
  2003-11-23 20:57     ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2003-11-23 20:51 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

   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.*" \


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Don't use runto_main in i386-unwind.exp
  2003-11-23 20:51   ` Mark Kettenis
@ 2003-11-23 20:57     ` Daniel Jacobowitz
  2003-11-23 21:15       ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-11-23 20:57 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Sun, Nov 23, 2003 at 09:50:27PM +0100, Mark Kettenis wrote:
>    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.

Thanks - that's just what I had in mind.  I'll try to go back to making
the testsuite work with gdbserver so that others can test this (I have
some comments from Elena that I still need to address).

> 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.*" \
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Don't use runto_main in i386-unwind.exp
  2003-11-23 20:57     ` Daniel Jacobowitz
@ 2003-11-23 21:15       ` Mark Kettenis
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Kettenis @ 2003-11-23 21:15 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

   Date: Sun, 23 Nov 2003 15:57:12 -0500
   From: Daniel Jacobowitz <drow@mvista.com>

   On Sun, Nov 23, 2003 at 09:50:27PM +0100, Mark Kettenis wrote:
   >    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.

   Thanks - that's just what I had in mind.  I'll try to go back to making
   the testsuite work with gdbserver so that others can test this (I have
   some comments from Elena that I still need to address).

I never got it working properly :-(.  Anyway, I checked in the attached.

Index: testsuite/ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* gdb.arch/i386-unwind.exp: Use gdb_run_cmd and gdb_expect instead
	of gdb_test "run".

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 21:12:51 -0000
@@ -47,8 +47,21 @@ gdb_load ${binfile}
 
 # Testcase for backtrace/1435.
 
-gdb_test "run" "Program received signal SIGTRAP.*" \
-         "run past gdb1435"
+# We use gdb_run_cmd so this stands a chance to work for remote
+# targets too.
+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.*" \


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-11-23 21:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-23 19:37 [PATCH] Don't use runto_main in i386-unwind.exp Mark Kettenis
2003-11-23 20:31 ` Daniel Jacobowitz
2003-11-23 20:51   ` Mark Kettenis
2003-11-23 20:57     ` Daniel Jacobowitz
2003-11-23 21:15       ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox