New implementation of gdb_run_cmd which fixes some subtle bugs.

This commit is contained in:
J.T. Conklin
1994-07-20 16:40:08 +00:00
parent f61ca5fae4
commit 4f2ec2eeb8

View File

@ -122,6 +122,8 @@ proc gdb_run_cmd {} {
send "y\n" send "y\n"
exp_continue exp_continue
} }
-re "Starting program: .*$" {}
} }
} }
@ -159,20 +161,25 @@ proc runto { function } {
timeout { fail "setting breakpoint at $function (timeout)" ; return 0 } timeout { fail "setting breakpoint at $function (timeout)" ; return 0 }
} }
send "run\n" gdb_run_cmd
# the "at foo.c:36" output we get with -g. # the "at foo.c:36" output we get with -g.
# the "in func" output we get without -g. # the "in func" output we get without -g.
expect { expect {
-re "The program .* has been started already.*y or n. $" { -re "Break.* at .*:$decimal.*$prompt $" {
send "y\n" return 1
exp_continue
} }
-re "Starting.*Break.* at .*:$decimal.*$prompt $" { return 1 }
-re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in $function.*$prompt $" { -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in $function.*$prompt $" {
return 1 return 1
} }
-re "$prompt $" { fail "running to $function" ; return 0 } -re "$prompt $" {
timeout { fail "running to $function (timeout)" ; return 0 } fail "running to $function"
return 0
}
timeout {
fail "running to $function (timeout)"
return 0
}
} }
} }