Make sure $GDB contains a real program.

This commit is contained in:
Rob Savoye
1993-04-12 22:15:10 +00:00
parent 0a819c0429
commit 32a02b2a49

View File

@ -39,10 +39,14 @@ if ![info exists decimal] then {
proc gdb_version {} { proc gdb_version {} {
global GDB global GDB
global GDBFLAGS global GDBFLAGS
if {[which $GDB] != 0} then {
set tmp [exec echo "q" | $GDB] set tmp [exec echo "q" | $GDB]
set version [lindex $tmp [lsearch $tmp "\[0-9\]*"]] set version [lindex $tmp [lsearch $tmp "\[0-9\]*"]]
set version [string range $version 0 [expr [string length $version]-2]] set version [string range $version 0 [expr [string length $version]-2]]
clone_output "[which $GDB] version $version $GDBFLAGS\n" clone_output "[which $GDB] version $version $GDBFLAGS\n"
} else {
warning "$GDB does not exist"
}
} }
# #
@ -95,7 +99,6 @@ proc gdb_load { arg } {
if $verbose>1 then { if $verbose>1 then {
send_user "\t\tLoaded $arg into the $GDB\n" send_user "\t\tLoaded $arg into the $GDB\n"
} }
return 0
} }
-re "has no symbol-table.*$prompt $" { -re "has no symbol-table.*$prompt $" {
error "$arg wasn't compiled with \"-g\"" error "$arg wasn't compiled with \"-g\""
@ -202,12 +205,18 @@ proc gdb_start {} {
set oldtimeout $timeout set oldtimeout $timeout
set timeout [expr "$timeout + 60"] set timeout [expr "$timeout + 60"]
if [ llength $GDBFLAGS ] then { if [ llength $GDBFLAGS ] then {
if {[which $GDB] != 0} then {
spawn $GDB $GDBFLAGS spawn $GDB $GDBFLAGS
} else { } else {
if {[which $GDB] != 0} then { error "$GDB does not exist."
exit 1
}
} else {
IF {[WHICH $GDB] != 0} then {
spawn $GDB spawn $GDB
} else { } else {
error "Can't find $GDB" error "$GDB does not exist."
exit 1
} }
} }
expect { expect {