diff options
author | Doug Evans <dje@google.com> | 2014-04-16 10:40:41 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2014-04-16 10:40:41 -0700 |
commit | ab19de874b887743e0862e6680e561f6fc4f02fa (patch) | |
tree | 629efc40748622bda35f488819520d0e57a34688 /gdb/testsuite/lib | |
parent | fc98a809db2b6792a47919d30c9bd3446f5a83ca (diff) | |
download | gdb-ab19de874b887743e0862e6680e561f6fc4f02fa.zip gdb-ab19de874b887743e0862e6680e561f6fc4f02fa.tar.gz gdb-ab19de874b887743e0862e6680e561f6fc4f02fa.tar.bz2 |
Fix wrapper.exp testcase with stdio gdbserver.
* lib/gdbserver-support.exp (gdbserver_default_get_remote_address):
Add comment.
(gdbserver_default_get_comm_port): New function.
(gdbserver_start): Check if board file provided
"gdbserver,get_comm_port" and use it if so.
* boards/native-stdio-gdbserver.exp (sockethost): Set to "".
(gdb,socketport): Set to "stdio".
(gdbserver,get_comm_port): Set to ${board}_get_comm_port.
(stdio_gdbserver_template): Delete.
(${board}_get_remote_address): Update.
(${board}_build_remote_cmd): Delete.
(${board}_get_comm_port): New function.
(${board}_spawn): Update.
* boards/remote-stdio-gdbserver.exp (${board}_build_remote_cmd):
Delete.
(${board}_get_remote_address): Update.
(${board}_get_comm_port): New function.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdbserver-support.exp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 304bd14..8c91e28 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -189,9 +189,17 @@ proc gdbserver_download_current_prog { } { # Default routine to compute the argument to "target remote". proc gdbserver_default_get_remote_address { host port } { + # Historically HOST included the trailing ":". + # To avoid breaking any board files out there we leave things alone. return "$host$port" } +# Default routine to compute the "comm" argument for gdbserver. + +proc gdbserver_default_get_comm_port { port } { + return ":$port" +} + # Start a gdbserver process with initial OPTIONS and trailing ARGUMENTS. # The port will be filled in between them automatically. # @@ -223,6 +231,11 @@ proc gdbserver_start { options arguments } { } else { set get_remote_address gdbserver_default_get_remote_address } + if [target_info exists gdbserver,get_comm_port] { + set get_comm_port [target_info gdbserver,get_comm_port] + } else { + set get_comm_port gdbserver_default_get_comm_port + } # Extract the protocol if [target_info exists gdb_protocol] { @@ -251,7 +264,7 @@ proc gdbserver_start { options arguments } { append gdbserver_command " $options" } if { $portnum != "" } { - append gdbserver_command " :$portnum" + append gdbserver_command " [$get_comm_port $portnum]" } if { $arguments != "" } { append gdbserver_command " $arguments" |