* [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets
@ 2004-02-02 20:26 Fred Fish
2004-02-02 20:32 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Fred Fish @ 2004-02-02 20:26 UTC (permalink / raw)
To: gdb-patches; +Cc: fnf
When using a remote target, like SID, you have to "continue" after
a "gdb_load", not "run". Add support for this case.
2004-02-02 Fred Fish <fnf@redhat.com>
* gdb.base/bang.exp: Handling continuing on remote targets after a
load.
Index: gdb.base/bang.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/bang.exp,v
retrieving revision 1.1
diff -u -p -r1.1 bang.exp
--- gdb.base/bang.exp 24 Jun 2003 22:04:06 -0000 1.1
+++ gdb.base/bang.exp 2 Feb 2004 20:20:04 -0000
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -35,7 +35,10 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Verify that we can run the program and that it terminates normally.
-gdb_test "run" \
- ".*Program exited normally\." \
- "run program"
+# For remote targets we simply continue after loading.
+if [target_info exists use_gdb_stub] {
+ gdb_test "continue" ".*Program exited normally\." "run program"
+} else {
+ gdb_test "run" ".*Program exited normally\." "run program"
+}
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets
2004-02-02 20:26 [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets Fred Fish
@ 2004-02-02 20:32 ` Daniel Jacobowitz
2004-02-02 20:56 ` Fred Fish
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-02-02 20:32 UTC (permalink / raw)
To: Fred Fish; +Cc: gdb-patches, fnf
On Mon, Feb 02, 2004 at 01:26:08PM -0700, Fred Fish wrote:
> When using a remote target, like SID, you have to "continue" after
> a "gdb_load", not "run". Add support for this case.
How about gdb_run_cmd?
>
> 2004-02-02 Fred Fish <fnf@redhat.com>
>
> * gdb.base/bang.exp: Handling continuing on remote targets after a
> load.
>
> Index: gdb.base/bang.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/bang.exp,v
> retrieving revision 1.1
> diff -u -p -r1.1 bang.exp
> --- gdb.base/bang.exp 24 Jun 2003 22:04:06 -0000 1.1
> +++ gdb.base/bang.exp 2 Feb 2004 20:20:04 -0000
> @@ -1,4 +1,4 @@
> -# Copyright 2003 Free Software Foundation, Inc.
> +# Copyright 2003, 2004 Free Software Foundation, Inc.
>
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> @@ -35,7 +35,10 @@ gdb_reinitialize_dir $srcdir/$subdir
> gdb_load ${binfile}
>
> # Verify that we can run the program and that it terminates normally.
> -gdb_test "run" \
> - ".*Program exited normally\." \
> - "run program"
> +# For remote targets we simply continue after loading.
>
> +if [target_info exists use_gdb_stub] {
> + gdb_test "continue" ".*Program exited normally\." "run program"
> +} else {
> + gdb_test "run" ".*Program exited normally\." "run program"
> +}
>
>
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets
2004-02-02 20:32 ` Daniel Jacobowitz
@ 2004-02-02 20:56 ` Fred Fish
2004-02-02 21:01 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Fred Fish @ 2004-02-02 20:56 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches, fnf
On Monday 02 February 2004 13:32, Daniel Jacobowitz wrote:
> How about gdb_run_cmd?
Initially I tried that and had some problems, but I just went back and tried
the following:
gdb_run_cmd
gdb_expect {
-re ".*Program exited normally\." {
pass "run program"
}
timeout {
fail "run program (timeout)"
}
}
which worked:
(gdb) jump *start
No symbol "start" in current context.
(gdb) jump *_start
Continuing at 0x1016.
0
*** EXIT code 0
Program exited normally.
PASS: gdb.base/bang.exp: run program
I'm not sure what happened the first time I tried gdb_run_cmd.
However, there is some precedence for just checking use_gdb_stub to
decide whether to "run" or "continue" as there are several other
places in the testsuite where this is done. Though it could be argued
that perhaps they should be converted to use gdb_run_cmd also.
On the other hand, I'm not entirely comfortable with some of the
assumptions made in gdb_run_cmd, such as jumping to "start" or
"_start". I've seen some load images in the past that don't
necessarily have the starting address in the image set to "start" or
"_start", but instead do things like have it set to a reset vector at
address zero that jumps to some other place in the image and
eventually ends up going through "start".
It would also be nice to know what this comment in
gdb_run_cmd is all about:
# This doesn't work quite right yet.
-Fred
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets
2004-02-02 20:56 ` Fred Fish
@ 2004-02-02 21:01 ` Daniel Jacobowitz
2004-02-02 21:17 ` Fred Fish
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-02-02 21:01 UTC (permalink / raw)
To: Fred Fish; +Cc: gdb-patches, fnf
On Mon, Feb 02, 2004 at 01:56:34PM -0700, Fred Fish wrote:
> On Monday 02 February 2004 13:32, Daniel Jacobowitz wrote:
> > How about gdb_run_cmd?
>
> Initially I tried that and had some problems, but I just went back and tried
> the following:
>
> gdb_run_cmd
> gdb_expect {
> -re ".*Program exited normally\." {
> pass "run program"
> }
> timeout {
> fail "run program (timeout)"
> }
> }
I would prefer this. It also handles gdbserver correctly (restart the
server, continue).
> which worked:
>
> (gdb) jump *start
> No symbol "start" in current context.
> (gdb) jump *_start
> Continuing at 0x1016.
> 0
>
> *** EXIT code 0
>
> Program exited normally.
> PASS: gdb.base/bang.exp: run program
>
> I'm not sure what happened the first time I tried gdb_run_cmd.
>
> However, there is some precedence for just checking use_gdb_stub to
> decide whether to "run" or "continue" as there are several other
> places in the testsuite where this is done. Though it could be argued
> that perhaps they should be converted to use gdb_run_cmd also.
Well, presumably you want to say "continue", because you know we're at
the beginning. But for some targets (at least, once upon a time, based
on gdb_run_cmd), this wasn't enough. If you want to preserve the
use-continue version, please work with the utility functions in
gdb.exp, rather than hardcoding more continues in the testsuite.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets
2004-02-02 21:01 ` Daniel Jacobowitz
@ 2004-02-02 21:17 ` Fred Fish
2004-02-02 21:23 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Fred Fish @ 2004-02-02 21:17 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches, fnf
On Monday 02 February 2004 14:01, Daniel Jacobowitz wrote:
> I would prefer this. It also handles gdbserver correctly (restart the
> server, continue).
OK, here is a revised patch. Note this also preserves the previous
behavior, discussed on gdb-patches for other proposed changes to
bang.exp, where nothing is allowed after the "Program exited
normally." message.
-Fred
2004-02-02 Fred Fish <fnf@redhat.com>
* gdb.base/bang.exp: Use gdb_run_cmd so this tests works with
remote targets. Update copyright years.
Index: gdb.base/bang.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/bang.exp,v
retrieving revision 1.1
diff -c -p -r1.1 bang.exp
*** gdb.base/bang.exp 24 Jun 2003 22:04:06 -0000 1.1
--- gdb.base/bang.exp 2 Feb 2004 21:11:55 -0000
***************
*** 1,4 ****
! # Copyright 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
--- 1,4 ----
! # Copyright 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
*************** gdb_reinitialize_dir $srcdir/$subdir
*** 35,41 ****
gdb_load ${binfile}
# Verify that we can run the program and that it terminates normally.
- gdb_test "run" \
- ".*Program exited normally\." \
- "run program"
--- 35,47 ----
gdb_load ${binfile}
# Verify that we can run the program and that it terminates normally.
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Program exited normally\.\r\n$gdb_prompt $" {
+ pass "run program"
+ }
+ timeout {
+ fail "run program (timeout)"
+ }
+ }
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets
2004-02-02 21:17 ` Fred Fish
@ 2004-02-02 21:23 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-02-02 21:23 UTC (permalink / raw)
To: Fred Fish; +Cc: gdb-patches, fnf
On Mon, Feb 02, 2004 at 02:16:53PM -0700, Fred Fish wrote:
> On Monday 02 February 2004 14:01, Daniel Jacobowitz wrote:
> > I would prefer this. It also handles gdbserver correctly (restart the
> > server, continue).
>
> OK, here is a revised patch. Note this also preserves the previous
> behavior, discussed on gdb-patches for other proposed changes to
> bang.exp, where nothing is allowed after the "Program exited
> normally." message.
Thanks - I meant to mention that in my last message but forgot. Please
check this in.
>
> -Fred
>
> 2004-02-02 Fred Fish <fnf@redhat.com>
>
> * gdb.base/bang.exp: Use gdb_run_cmd so this tests works with
> remote targets. Update copyright years.
>
> Index: gdb.base/bang.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/bang.exp,v
> retrieving revision 1.1
> diff -c -p -r1.1 bang.exp
> *** gdb.base/bang.exp 24 Jun 2003 22:04:06 -0000 1.1
> --- gdb.base/bang.exp 2 Feb 2004 21:11:55 -0000
> ***************
> *** 1,4 ****
> ! # Copyright 2003 Free Software Foundation, Inc.
>
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> --- 1,4 ----
> ! # Copyright 2003, 2004 Free Software Foundation, Inc.
>
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> *************** gdb_reinitialize_dir $srcdir/$subdir
> *** 35,41 ****
> gdb_load ${binfile}
>
> # Verify that we can run the program and that it terminates normally.
> - gdb_test "run" \
> - ".*Program exited normally\." \
> - "run program"
>
> --- 35,47 ----
> gdb_load ${binfile}
>
> # Verify that we can run the program and that it terminates normally.
>
> + gdb_run_cmd
> + gdb_expect {
> + -re ".*Program exited normally\.\r\n$gdb_prompt $" {
> + pass "run program"
> + }
> + timeout {
> + fail "run program (timeout)"
> + }
> + }
>
>
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-02-02 21:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-02 20:26 [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets Fred Fish
2004-02-02 20:32 ` Daniel Jacobowitz
2004-02-02 20:56 ` Fred Fish
2004-02-02 21:01 ` Daniel Jacobowitz
2004-02-02 21:17 ` Fred Fish
2004-02-02 21:23 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox