This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] [gdb/testsuite] Fix gdb_target_cmd
- From: Tom de Vries <vries at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 18 Sep 2019 23:14:28 -0000
- Subject: [binutils-gdb] [gdb/testsuite] Fix gdb_target_cmd
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8a6251301c6ea6d804735fbad8cdb7cba707f784
commit 8a6251301c6ea6d804735fbad8cdb7cba707f784
Author: Tom de Vries <tdevries@suse.de>
Date: Thu Sep 19 01:14:19 2019 +0200
[gdb/testsuite] Fix gdb_target_cmd
In commit 81dc3ab594 "[gdb/testsuite] Handle unreachable network in
server-connect.exp" a regression was introduced in gdb_target_cmd, causing
ERRORs like this:
...
ERROR: tcl error sourcing src/gdb/testsuite/gdb.server/abspath.exp.
ERROR: wrong # args: should be "gdb_target_cmd {$args}"
while executing
"gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport"
...
Fix the argument passing in gdb_target_cmd.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-09-19 Tom de Vries <tdevries@suse.de>
* lib/gdbserver-support.exp (gdb_target_cmd): Fix argument passing.
Diff:
---
gdb/testsuite/ChangeLog | 4 ++++
gdb/testsuite/lib/gdbserver-support.exp | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2acc1f7..d5a5309 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2019-09-19 Tom de Vries <tdevries@suse.de>
+ * lib/gdbserver-support.exp (gdb_target_cmd): Fix argument passing.
+
+2019-09-19 Tom de Vries <tdevries@suse.de>
+
* lib/gdbserver-support.exp (gdb_target_cmd_ext): Return 2 (meaning
UNSUPPORTED) for 'Network is unreachable' message. Factor out of ...
(gdb_target_cmd): ... here.
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
index 2ad53c1..00f46c8 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -112,8 +112,8 @@ proc gdb_target_cmd_ext { targetname serialport {additional_text ""} } {
# Like gdb_target_cmd_ext, but returns 0 on success, 1 on failure.
-proc gdb_target_cmd { $args } {
- set res [gdb_target_cmd_ext $args]
+proc gdb_target_cmd { args } {
+ set res [eval gdb_target_cmd_ext $args]
return [expr $res == 0 ? 0 : 1]
}