From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 3EA143857411 for ; Wed, 16 Jun 2021 19:37:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3EA143857411 X-ASG-Debug-ID: 1623872274-0c856e6cd518760a0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id TjjOlxUcUCB7lBPl (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2021 15:37:54 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id F0FB8441B21; Wed, 16 Jun 2021 15:37:53 -0400 (EDT) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.181.218 X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 4/4] gdb/testsuite: gdb.base/args.exp: add KFAIL for native-extended-gdbserver Date: Wed, 16 Jun 2021 15:37:51 -0400 X-ASG-Orig-Subj: [PATCH 4/4] gdb/testsuite: gdb.base/args.exp: add KFAIL for native-extended-gdbserver Message-Id: <20210616193751.468795-4-simon.marchi@efficios.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616193751.468795-1-simon.marchi@efficios.com> References: <20210616193751.468795-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1623872274 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 3395 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.90692 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-22.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 19:37:56 -0000 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 --- gdb/testsuite/gdb.base/args.exp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp index e76368f544e..29bb5984245 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,10 @@ proc args_test { name arglist } { save_vars { GDBFLAGS } { set old_gdbflags $GDBFLAGS + # Start GDB just to see if we are using the native or extended-remote target. + clean_restart + set single_quotes_newline_kfail [gdb_is_target_remote] + set GDBFLAGS "$old_gdbflags --args $binfile 1 3" args_test basic {{1} {3}} @@ -85,16 +96,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 } -- 2.31.1