mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-03-01 13:26:47 +08:00
Support remote targets.
This commit is contained in:
parent
31f7ba0423
commit
b53f9b27af
@ -291,8 +291,15 @@ proc mi_gdb_load { arg } {
|
||||
global loadfile
|
||||
global GDB
|
||||
global mi_gdb_prompt
|
||||
global last_mi_gdb_file
|
||||
upvar timeout timeout
|
||||
|
||||
if { $arg == "" } {
|
||||
set arg $last_mi_gdb_file;
|
||||
}
|
||||
|
||||
set last_mi_gdb_file $arg;
|
||||
|
||||
# ``gdb_unload''
|
||||
|
||||
# ``gdb_file_cmd''
|
||||
@ -388,6 +395,26 @@ proc mi_gdb_load { arg } {
|
||||
return -1
|
||||
}
|
||||
}
|
||||
} elseif { [target_info gdb_protocol] == "remote" } {
|
||||
# remote targets
|
||||
send_gdb "target [target_info gdb_protocol] [target_info netport]\n"
|
||||
gdb_expect 60 {
|
||||
-re "\\^done,.*$mi_gdb_prompt$" {
|
||||
}
|
||||
timeout {
|
||||
perror "Unable to connect to remote target"
|
||||
return -1
|
||||
}
|
||||
}
|
||||
send_gdb "48-target-download\n"
|
||||
gdb_expect 10 {
|
||||
-re "48\\^done.*$mi_gdb_prompt$" {
|
||||
}
|
||||
timeout {
|
||||
perror "Unable to download to remote target"
|
||||
return -1
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user