aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/boards
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2014-04-16 10:40:41 -0700
committerDoug Evans <dje@google.com>2014-04-16 10:40:41 -0700
commitab19de874b887743e0862e6680e561f6fc4f02fa (patch)
tree629efc40748622bda35f488819520d0e57a34688 /gdb/testsuite/boards
parentfc98a809db2b6792a47919d30c9bd3446f5a83ca (diff)
downloadgdb-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/boards')
-rw-r--r--gdb/testsuite/boards/native-stdio-gdbserver.exp54
-rw-r--r--gdb/testsuite/boards/remote-stdio-gdbserver.exp38
2 files changed, 16 insertions, 76 deletions
diff --git a/gdb/testsuite/boards/native-stdio-gdbserver.exp b/gdb/testsuite/boards/native-stdio-gdbserver.exp
index a1484e5..d1ae37c 100644
--- a/gdb/testsuite/boards/native-stdio-gdbserver.exp
+++ b/gdb/testsuite/boards/native-stdio-gdbserver.exp
@@ -29,60 +29,28 @@ set_board_info gdb,do_reload_on_run 1
# There's no support for argument-passing (yet).
set_board_info noargs 1
-# Hack into sockethost to pass our peculiar remote connection string.
-set_board_info sockethost "stdio"
-set_board_info gdb,socketport ""
+# Hack the host,port to pass our peculiar remote connection string.
+set_board_info sockethost ""
+set_board_info gdb,socketport "stdio"
set_board_info gdb,get_remote_address ${board}_get_remote_address
+set_board_info gdbserver,get_comm_port ${board}_get_comm_port
+
set_board_info use_gdb_stub 1
set_board_info exit_is_reliable 1
# We will be using the standard GDB remote protocol.
set_board_info gdb_protocol "remote"
-# The argument to pass to "target remote".
-# We build this once we know how the testsuite will start gdbserver.
-set stdio_gdbserver_template "| @GDBSERVER_PROG@ @ARGS@ stdio @PROG_AND_ARGS@"
-
# Used to pass a value between ${board}_spawn and ${board}_get_remote_address.
set stdio_gdbserver_command "--unset--"
proc ${board}_get_remote_address { host port } {
global stdio_gdbserver_command
- return $stdio_gdbserver_command
+ return "| $stdio_gdbserver_command"
}
-proc ${board}_build_remote_cmd { cmd } {
- global stdio_gdbserver_template
-
- # First parse $cmd, picking out the various pieces.
- set gdbserver_prog [lindex $cmd 0]
- set args ""
- set len [llength $cmd]
-
- for { set i 1 } { $i < $len } { incr i } {
- set elm [lindex $cmd $i]
- switch -- $elm {
- --multi {
- set args "$args $elm"
- }
- --once {
- set args "$args $elm"
- }
- default {
- break
- }
- }
- }
-
- set prog_and_args [lrange $cmd $i end]
-
- set buf $stdio_gdbserver_template
-
- regsub {@GDBSERVER_PROG@} $buf $gdbserver_prog buf
- regsub {@ARGS@} $buf $args buf
- regsub {@PROG_AND_ARGS@} $buf $prog_and_args buf
-
- return $buf
+proc ${board}_get_comm_port { port } {
+ return $port
}
proc ${board}_spawn { board cmd } {
@@ -90,12 +58,10 @@ proc ${board}_spawn { board cmd } {
verbose -log "${board}_spawn: $board $cmd"
- # Convert the command to start gdbserver to something to pass to
- # "target remote | ..." and save it for later retrieval by
+ # Save the command to start gdbserver for later retrieval by
# ${board}_get_remote_address.
global stdio_gdbserver_command
- set stdio_gdbserver_command [${board}_build_remote_cmd $cmd]
- verbose -log "gdbserver_command: $stdio_gdbserver_command"
+ set stdio_gdbserver_command $cmd
set baseboard [lindex [split $board "/"] 0]
diff --git a/gdb/testsuite/boards/remote-stdio-gdbserver.exp b/gdb/testsuite/boards/remote-stdio-gdbserver.exp
index 73f86ad..6508b76 100644
--- a/gdb/testsuite/boards/remote-stdio-gdbserver.exp
+++ b/gdb/testsuite/boards/remote-stdio-gdbserver.exp
@@ -73,40 +73,14 @@ proc get_remote_login { } {
return $result
}
-proc ${board}_build_remote_cmd { cmd } {
- set stdio_gdbserver_template "| @RSH_CMD@ @GDBSERVER_PROG@ @ARGS@ stdio @PROG_AND_ARGS@"
-
- # First parse $cmd, picking out the various pieces.
- set gdbserver_prog [lindex $cmd 0]
- set args ""
- set len [llength $cmd]
-
- for { set i 1 } { $i < $len } { incr i } {
- set elm [lindex $cmd $i]
- switch $elm {
- --multi {
- set args "$args $elm"
- }
- --once {
- set args "$args $elm"
- }
- default {
- break
- }
- }
- }
-
- set prog_and_args [lrange $cmd $i end]
-
- set buf $stdio_gdbserver_template
-
+proc ${board}_get_remote_address { host port } {
+ global stdio_gdbserver_command
set rsh_cmd "[board_info [target_info name] rsh_prog] [get_remote_login]"
- regsub {@RSH_CMD@} $buf $rsh_cmd buf
- regsub {@GDBSERVER_PROG@} $buf $gdbserver_prog buf
- regsub {@ARGS@} $buf $args buf
- regsub {@PROG_AND_ARGS@} $buf $prog_and_args buf
+ return "| $rsh_cmd $stdio_gdbserver_command"
+}
- return $buf
+proc ${board}_get_comm_port { port } {
+ return $port
}
proc ${board}_download { board host dest } {