mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 23:39:35 +08:00
* config/monitor.exp(gdb_target_monitor): Add pattern for
"Ending remote" to detect errors in connecting. * gdb.base/setshow.exp: Add .* within auto language test.
This commit is contained in:
@ -1,5 +1,10 @@
|
|||||||
Wed Mar 5 00:00:43 1997 Bob Manson <manson@charmed.cygnus.com>
|
Wed Mar 5 00:00:43 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||||
|
|
||||||
|
* config/monitor.exp(gdb_target_monitor): Add pattern for
|
||||||
|
"Ending remote" to detect errors in connecting.
|
||||||
|
|
||||||
|
* gdb.base/setshow.exp: Add .* within auto language test.
|
||||||
|
|
||||||
* lib/gdb.exp(gdb_run_cmd): Add check for gdb_init_command
|
* lib/gdb.exp(gdb_run_cmd): Add check for gdb_init_command
|
||||||
target feature.
|
target feature.
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ proc gdb_target_monitor { } {
|
|||||||
verbose "Set target to $targetname"
|
verbose "Set target to $targetname"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
-re "Ending remote.*$gdb_prompt" { }
|
||||||
-re "Connection refused.*$gdb_prompt" {
|
-re "Connection refused.*$gdb_prompt" {
|
||||||
verbose "Connection refused by remote target. Pausing, and trying again."
|
verbose "Connection refused by remote target. Pausing, and trying again."
|
||||||
sleep 30
|
sleep 30
|
||||||
@ -99,32 +100,44 @@ proc gdb_load { arg } {
|
|||||||
global gdb_prompt
|
global gdb_prompt
|
||||||
global timeout
|
global timeout
|
||||||
|
|
||||||
if { $arg != "" } {
|
for { set j 1; } { $j <= 2 } {incr j; } {
|
||||||
if [gdb_file_cmd $arg] { return -1 }
|
if { $arg != "" } {
|
||||||
}
|
if [gdb_file_cmd $arg] { return -1 }
|
||||||
|
|
||||||
gdb_target_monitor
|
|
||||||
|
|
||||||
if [is_remote host] {
|
|
||||||
# FIXME:
|
|
||||||
set arg a.out;
|
|
||||||
}
|
|
||||||
|
|
||||||
verbose "Loading $arg"
|
|
||||||
send_gdb "load $arg\n"
|
|
||||||
set timeout 1000
|
|
||||||
verbose "Timeout is now $timeout seconds" 2
|
|
||||||
gdb_expect {
|
|
||||||
-re ".*$gdb_prompt $" {
|
|
||||||
verbose "Loaded $arg into $GDB\n"
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
timeout {
|
|
||||||
if { $verbose > 1 } {
|
gdb_target_monitor
|
||||||
perror "Timed out trying to load $arg."
|
|
||||||
|
if [is_remote host] {
|
||||||
|
# FIXME:
|
||||||
|
set arg a.out;
|
||||||
|
}
|
||||||
|
|
||||||
|
verbose "Loading $arg"
|
||||||
|
send_gdb "load $arg\n"
|
||||||
|
set timeout 1000
|
||||||
|
verbose "Timeout is now $timeout seconds" 2
|
||||||
|
gdb_expect {
|
||||||
|
-re ".*\[Ff\]ailed.*$gdb_prompt $" {
|
||||||
|
verbose "load failed";
|
||||||
|
}
|
||||||
|
-re ".*$gdb_prompt $" {
|
||||||
|
verbose "Loaded $arg into $GDB\n"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
timeout {
|
||||||
|
if { $verbose > 1 } {
|
||||||
|
perror "Timed out trying to load $arg."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gdb_test "target exec" "No exec file now." "" ".*Kill it.*y or n.*" "y"
|
||||||
|
|
||||||
|
if { $j == 1 && ![reboot_target] } {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
perror "Couldn't load file into GDB.";
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
proc gdb_start { } {
|
proc gdb_start { } {
|
||||||
|
@ -55,27 +55,27 @@ gdb_test "show annotate" "Annotation_level is 0..*" "default annotation_level i
|
|||||||
|
|
||||||
#test set annotate 2
|
#test set annotate 2
|
||||||
send_gdb "set annotate 2\n"
|
send_gdb "set annotate 2\n"
|
||||||
expect {
|
gdb_expect {
|
||||||
-re ".*\032\032pre-prompt.*$prompt .*\032\032prompt.*$" \
|
-re ".*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \
|
||||||
{ pass "set annotate 2" }
|
{ pass "set annotate 2" }
|
||||||
-re ".*$prompt $" { fail "set annotate 2" }
|
-re ".*$gdb_prompt $" { fail "set annotate 2" }
|
||||||
timeout { fail "(timeout) set annotate 2" }
|
timeout { fail "(timeout) set annotate 2" }
|
||||||
}
|
}
|
||||||
|
|
||||||
send_gdb "show annotate\n"
|
send_gdb "show annotate\n"
|
||||||
expect {
|
gdb_expect {
|
||||||
-re ".*\032\032post-prompt.*Annotation_level is 2..*\032\032pre-prompt.*$prompt .*\032\032prompt.*$" \
|
-re ".*\032\032post-prompt.*Annotation_level is 2..*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \
|
||||||
{ pass "show annotate (2)" }
|
{ pass "show annotate (2)" }
|
||||||
-re ".*$prompt $" { fail "show annotate (2)" }
|
-re ".*$gdb_prompt $" { fail "show annotate (2)" }
|
||||||
timeout { fail "(timeout) show annotate (2)" }
|
timeout { fail "(timeout) show annotate (2)" }
|
||||||
}
|
}
|
||||||
|
|
||||||
#test annotation_level 2
|
#test annotation_level 2
|
||||||
send_gdb "info line 1\n"
|
send_gdb "info line 1\n"
|
||||||
expect {
|
gdb_expect {
|
||||||
-re ".*\032\032post-prompt.*Line 1 of .* is at address .* but contains no code.*:1:0:beg:0x.*\032\032pre-prompt.*$prompt .*\032\032prompt.*$" \
|
-re ".*\032\032post-prompt.*Line 1 of .* is at address .* but contains no code.*:1:0:beg:0x.*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \
|
||||||
{ pass "annotation_level 2" }
|
{ pass "annotation_level 2" }
|
||||||
-re ".*$prompt $" { fail "annotation_level 2" }
|
-re ".*$gdb_prompt $" { fail "annotation_level 2" }
|
||||||
timeout { fail "(timeout) annotation_level 2" }
|
timeout { fail "(timeout) annotation_level 2" }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ gdb_test "show language" "The current source language is \"asm\"..*" "show langu
|
|||||||
#test set language auto
|
#test set language auto
|
||||||
gdb_test "set language auto" "" "set language auto"
|
gdb_test "set language auto" "" "set language auto"
|
||||||
#test show language
|
#test show language
|
||||||
gdb_test "show language" "The current source language is \"auto\"..*" "show language (auto)"
|
gdb_test "show language" "The current source language is \"auto.*\"..*" "show language (auto)"
|
||||||
#test set listsize 100
|
#test set listsize 100
|
||||||
gdb_test "set listsize 100" "" "set listsize 100"
|
gdb_test "set listsize 100" "" "set listsize 100"
|
||||||
#test show listsize 100
|
#test show listsize 100
|
||||||
@ -175,14 +175,14 @@ gdb_test "show listsize" "Number of source lines gdb will list by default is 100
|
|||||||
#test set prompt (FooBarBaz)
|
#test set prompt (FooBarBaz)
|
||||||
set newprompt "\\(FooBarBaz\\)"
|
set newprompt "\\(FooBarBaz\\)"
|
||||||
send_gdb "set prompt (FooBarBaz) \n"
|
send_gdb "set prompt (FooBarBaz) \n"
|
||||||
expect {
|
gdb_expect {
|
||||||
-re "$newprompt $" { pass "set prompt (FooBarBaz) " }
|
-re "$newprompt $" { pass "set prompt (FooBarBaz) " }
|
||||||
timeout { fail "(timeout) set prompt (FooBarBaz) " }
|
timeout { fail "(timeout) set prompt (FooBarBaz) " }
|
||||||
}
|
}
|
||||||
|
|
||||||
#test show prompt (FooBarBaz)
|
#test show prompt (FooBarBaz)
|
||||||
send_gdb "show prompt\n"
|
send_gdb "show prompt\n"
|
||||||
expect {
|
gdb_expect {
|
||||||
-re "Gdb's prompt is \"$newprompt \"..* $" \
|
-re "Gdb's prompt is \"$newprompt \"..* $" \
|
||||||
{ pass "show prompt (FooBarBaz) " }
|
{ pass "show prompt (FooBarBaz) " }
|
||||||
timeout { fail "(timeout) show prompt (FooBarBaz) " }
|
timeout { fail "(timeout) show prompt (FooBarBaz) " }
|
||||||
@ -190,8 +190,8 @@ expect {
|
|||||||
|
|
||||||
#test set prompt (gdb)
|
#test set prompt (gdb)
|
||||||
send_gdb "set prompt (gdb) \n"
|
send_gdb "set prompt (gdb) \n"
|
||||||
expect {
|
gdb_expect {
|
||||||
-re "$prompt $" { pass "set prompt (gdb) " }
|
-re "$gdb_prompt $" { pass "set prompt (gdb) " }
|
||||||
timeout { fail "(timeout) set prompt (gdb) " }
|
timeout { fail "(timeout) set prompt (gdb) " }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user