aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2020-09-13 20:31:25 +0100
committerPedro Alves <pedro@palves.net>2020-09-13 20:31:25 +0100
commit2f4b83cd51953fdf9626dc7a198b35505d1f5472 (patch)
treea88028733218de22e23db0d0025bb6363c8984d0 /gdb/testsuite/gdb.base
parentc49da0e466e1bcb6e1f363ea4a806cfd2c322cb0 (diff)
downloadbinutils-2f4b83cd51953fdf9626dc7a198b35505d1f5472.zip
binutils-2f4b83cd51953fdf9626dc7a198b35505d1f5472.tar.gz
binutils-2f4b83cd51953fdf9626dc7a198b35505d1f5472.tar.bz2
Make default_mi_gdb_start/dbx_gdb_start use gdb_spawn
If a board file wants to customize how gdb is launched, the obvious way is to have the board override gdb_spawn. However, that doesn't work for either gdb.mi/ testcases or gdb.base/dbx.exp, because default_mi_gdb_start and dbx_gdb_start don't use gdb_spawn currently. That is fixed by this patch. gdb/testsuite/ * gdb.base/dbx.exp (dbx_gdb_start): Adjust to use gdb_spawn instead of spawning GDB with remote_spawn. * lib/mi-support.exp (default_mi_gdb_start): Adjust to use gdb_spawn instead of spawning GDB with remote_spawn.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/dbx.exp18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index 2a53f99..5228f2e 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -26,31 +26,33 @@ if {[build_executable $testfile.exp $testfile \
# start gdb -- start gdb running, default procedure
#
proc dbx_gdb_start { } {
- global GDB
- global INTERNAL_GDBFLAGS GDBFLAGS
global prompt
- global spawn_id
global timeout
- verbose "Spawning $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
+ global gdb_spawn_id
- if { [which $GDB] == 0 } then {
- perror "$GDB does not exist."
- exit 1
+ save_vars { GDBFLAGS } {
+ append GDBFLAGS " -dbx"
+
+ set res [gdb_spawn]
+ if { $res != 0} {
+ return $res
+ }
}
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
- eval "spawn $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
gdb_expect {
-re ".*\r\n$gdb_prompt $" {
verbose "GDB initialized."
}
-re "$prompt $" {
perror "GDB never initialized."
+ unset gdb_spawn_id
return -1
}
timeout {
perror "(timeout) GDB never initialized."
+ unset gdb_spawn_id
return -1
}
}