From 83f66e8f3b8f3b6b31e243cc6308f2ffada1e4d4 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Sun, 8 Feb 2004 03:56:15 +0000 Subject: [PATCH] * config/sim.exp (gdb_load): Handle $arg == "". * lib/gdb.exp (gdb_run_cmd): Honor gdb,do_reload_on_run. * gdb.objc/basicclass.exp: Use gdb_run_cmd. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/config/sim.exp | 6 ++++-- gdb/testsuite/gdb.objc/basicclass.exp | 10 +++------- gdb/testsuite/lib/gdb.exp | 6 ++++++ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ca904f7a41c..8d91aafd478 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-02-07 Daniel Jacobowitz + + * config/sim.exp (gdb_load): Handle $arg == "". + * lib/gdb.exp (gdb_run_cmd): Honor gdb,do_reload_on_run. + * gdb.objc/basicclass.exp: Use gdb_run_cmd. + 2004-02-07 Elena Zannoni * gdb.base/maint.exp: Update test to reflect diff --git a/gdb/testsuite/config/sim.exp b/gdb/testsuite/config/sim.exp index 5d8a93d5311..6ecdc522bf2 100644 --- a/gdb/testsuite/config/sim.exp +++ b/gdb/testsuite/config/sim.exp @@ -1,5 +1,5 @@ # Test Framework Driver for GDB driving a builtin simulator -# Copyright 1994, 1997, 1998 Free Software Foundation, Inc. +# Copyright 1994, 1997, 1998, 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 @@ -55,7 +55,9 @@ proc gdb_load { arg } { global GDB global gdb_prompt - if [gdb_file_cmd $arg] then { return -1 } + if { $arg != "" } { + if [gdb_file_cmd $arg] then { return -1 } + } gdb_target_sim diff --git a/gdb/testsuite/gdb.objc/basicclass.exp b/gdb/testsuite/gdb.objc/basicclass.exp index 39cf296042a..41ab2848c98 100644 --- a/gdb/testsuite/gdb.objc/basicclass.exp +++ b/gdb/testsuite/gdb.objc/basicclass.exp @@ -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 @@ -125,13 +125,9 @@ gdb_test continue \ # # Test resetting breakpoints when re-running program # -send_gdb "run\n" +gdb_run_cmd gdb_expect { - -re "The program .* has been started already.*y or n. $" { - send_gdb "y\n" - exp_continue - } - -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*$gdb_prompt $"\ + -re "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*$gdb_prompt $"\ { pass "resetting breakpoints when rerunning" } -re ".*$gdb_prompt $" { fail "resetting breakpoints when rerunning" } timeout { fail "resetting breakpoints when rerunning" } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 52ec55f2a10..5838c0dad32 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -248,6 +248,12 @@ proc gdb_run_cmd {args} { } return } + + if [target_info exists gdb,do_reload_on_run] { + if { [gdb_load ""] < 0 } { + return; + } + } send_gdb "run $args\n" # This doesn't work quite right yet. gdb_expect 60 { -- 2.39.5