Re: RFC: Don't kill the program after "file"

Fred Fish
2006-08-10T19:13:40Z

On Tuesday 01 August 2006 18:11, Daniel Jacobowitz wrote:
> As it happens I have patches for a similar issue with target
> extended-remote. The remote patches are substantial, but I can
> probably break out the simulator related bits. I'll try to do that.

Here's the patch I'm temporarily using to allow me to continue build
and testing toolchains with the simulators.

-Fred

Index: gdb/gdb/testsuite/lib/gdb.exp
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 gdb.exp
--- gdb/gdb/testsuite/lib/gdb.exp 31 Jul 2006 20:28:17 -0000 1.1.1.6
+++ gdb/gdb/testsuite/lib/gdb.exp 7 Aug 2006 10:33:19 -0000
@@ -1017,6 +1017,9 @@ proc gdb_file_cmd { arg } {
verbose "\t\tKilling previous program being debugged"
exp_continue
}
+ -re "The program is not being run.*$gdb_prompt $" {
+ # OK.
+ }
-re "$gdb_prompt $" {
# OK.
}
@@ -1024,6 +1027,11 @@ proc gdb_file_cmd { arg } {

send_gdb "file $arg\n"
gdb_expect 120 {
+ -re "A program is being debugged already..*Are you sure you want to change the file.*\\(y or n\\) $"\
+ { send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
-re "Reading symbols from.*no debugging symbols found.*done.*$gdb_prompt $" {
verbose "\t\tLoaded $arg into the $GDB with no debugging symbols"
set gdb_file_cmd_debug_info "nodebug"