aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2021-06-17 09:41:59 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-06-17 09:41:59 -0400
commit18263be7565782a9c07045a7a72d80c507a5be09 (patch)
tree13653998a640338b8834275203894ea0b88c626d
parentd30e32637d2993aab95a2a1848b045b7bfd90473 (diff)
downloadbinutils-18263be7565782a9c07045a7a72d80c507a5be09.zip
binutils-18263be7565782a9c07045a7a72d80c507a5be09.tar.gz
binutils-18263be7565782a9c07045a7a72d80c507a5be09.tar.bz2
gdb/testsuite: gdb.base/args.exp: add KFAIL for native-extended-gdbserver
This test tests passing arguments made of exactly two single-quotes ('') or a single newline character through the --args argument of GDB. For some reason, GDB adds some extra single quotes when transmitting the arguments to GDBserver. This produces some FAILs when testing with the native-extended-gdbserver board: FAIL: gdb.base/args.exp: argv[2] for one empty (with single quotes) FAIL: gdb.base/args.exp: argv[2] for two empty (with single quotes) FAIL: gdb.base/args.exp: argv[3] for two empty (with single quotes) FAIL: gdb.base/args.exp: argv[2] for one newline FAIL: gdb.base/args.exp: argv[2] for two newlines FAIL: gdb.base/args.exp: argv[3] for two newlines This is documented as PR 27989. Add some appropriate KFAILs. gdb/testsuite/ChangeLog: * gdb.base/args.exp: Check target, KFAIL if remote. (args_test): Add parameter and use it. Change-Id: I49225d1c7df7ebaba480ebdd596df80f8fbf62f0
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/args.exp23
2 files changed, 23 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1eb42e7..16a86b6 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2021-06-17 Simon Marchi <simon.marchi@efficios.com>
+ * gdb.base/args.exp: Check target, KFAIL if remote.
+ (args_test): Add parameter and use it.
+
+2021-06-17 Simon Marchi <simon.marchi@efficios.com>
+
* gdb.base/args.exp: Remove trailing parenthesis in test names.
2021-06-17 Simon Marchi <simon.marchi@efficios.com>
diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp
index e76368f..36dd19e 100644
--- a/gdb/testsuite/gdb.base/args.exp
+++ b/gdb/testsuite/gdb.base/args.exp
@@ -34,7 +34,10 @@ if {[build_executable $testfile.exp $testfile \
return -1
}
-proc args_test { name arglist } {
+# If SINGLE_QUOTES_NEWLINE_KFAIL true, arguments made of exactly '' or a
+# newline character will fail, so kfail those tests.
+
+proc args_test { name arglist {single_quotes_newline_kfail false}} {
global srcdir
global subdir
global testfile
@@ -52,6 +55,10 @@ proc args_test { name arglist } {
set i 1
foreach arg $arglist {
+ if { $single_quotes_newline_kfail
+ && ($arg == {''} || $arg == {\\n}) } {
+ setup_kfail "gdb/27989" "*-*-*"
+ }
gdb_test "print argv\[$i\]" "\\\$$decimal = $hex \"$arg\"" \
"argv\[$i\] for $name"
set i [expr $i + 1]
@@ -65,6 +72,12 @@ proc args_test { name arglist } {
save_vars { GDBFLAGS } {
set old_gdbflags $GDBFLAGS
+ # Single quotes and newlines are not well handled by the extended-remote
+ # target: https://sourceware.org/bugzilla/show_bug.cgi?id=27989
+ set single_quotes_newline_kfail \
+ [expr { [target_info exists gdb_protocol] \
+ && [target_info gdb_protocol] == "extended-remote" }]
+
set GDBFLAGS "$old_gdbflags --args $binfile 1 3"
args_test basic {{1} {3}}
@@ -85,16 +98,16 @@ save_vars { GDBFLAGS } {
# Try with arguments containing literal single quotes.
set GDBFLAGS "$old_gdbflags --args $binfile 1 '' 3"
- args_test "one empty with single quotes" {{1} {''} {3}}
+ args_test "one empty with single quotes" {{1} {''} {3}} $single_quotes_newline_kfail
set GDBFLAGS "$old_gdbflags --args $binfile 1 '' '' 3"
- args_test "two empty with single quotes" {{1} {''} {''} {3}}
+ args_test "two empty with single quotes" {{1} {''} {''} {3}} $single_quotes_newline_kfail
# try with arguments containing literal newlines.
set GDBFLAGS "$old_gdbflags --args $binfile 1 {\n} 3"
- args_test "one newline" {{1} {\\n} {3}}
+ args_test "one newline" {{1} {\\n} {3}} $single_quotes_newline_kfail
set GDBFLAGS "$old_gdbflags --args $binfile 1 {\n} {\n} 3"
- args_test "two newlines" {{1} {\\n} {\\n} {3}}
+ args_test "two newlines" {{1} {\\n} {\\n} {3}} $single_quotes_newline_kfail
}