From patchwork Tue Jul 9 04:36:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 33626 Received: (qmail 23422 invoked by alias); 9 Jul 2019 04:36:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23411 invoked by uid 89); 9 Jul 2019 04:36:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=encrypted X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Jul 2019 04:36:12 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54320C04AC70; Tue, 9 Jul 2019 04:36:11 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C5637FFE2; Tue, 9 Jul 2019 04:36:10 +0000 (UTC) From: Sergio Durigan Junior To: Philippe Waroquiers Cc: Pedro Alves , gdb-patches@sourceware.org Subject: New FAIL on gdb.base/printcmds.exp (was: Re: [RFA] Ensure GDB printf command can print convenience var strings without a target.) References: <20190610211622.15237-1-philippe.waroquiers@skynet.be> <6b413ba9-e390-d0a5-b323-976d449b5e36@redhat.com> <1562625697.1521.5.camel@skynet.be> Date: Tue, 09 Jul 2019 00:36:10 -0400 In-Reply-To: <1562625697.1521.5.camel@skynet.be> (Philippe Waroquiers's message of "Tue, 09 Jul 2019 00:41:37 +0200") Message-ID: <87lfx7vn7p.fsf_-_@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes On Monday, July 08 2019, Philippe Waroquiers wrote: > On Mon, 2019-07-08 at 19:12 +0100, Pedro Alves wrote: >> Looks fine to me, with the nits below fixed. > Thanks. I have applied all the suggested changes (except one) > and pushed the below patch as a result. > > I keptĀ  > gdb_test "set language ada" ".*" "set language ada" > and clarified why with: > + # Without a target, the below produces no output > + # but with a target, it gives a warning. > + # So, use gdb_test expecting ".*" instead of gdb_test_no_output. > + gdb_test "set language ada" ".*" "set language ada" Hi Philippe, I'm seeing new FAILures on gdb.base/printcmds.exp: new FAIL: gdb.base/printcmds.exp: conv var: with target, may-call-functions off: printf $wstr new FAIL: gdb.base/printcmds.exp: conv var: with target, may-call-functions off: set $wstr new FAIL: gdb.base/printcmds.exp: conv var: with target: printf $wstr new FAIL: gdb.base/printcmds.exp: conv var: with target: set $wstr The BuildBot has caught them: https://sourceware.org/ml/gdb-testers/2019-q3/msg00361.html The problem happens because GDB can't identify the wchar_t type: set var $wstr = L"facile" No type named wchar_t. (gdb) FAIL: gdb.base/printcmds.exp: conv var: with target: set $wstr The patch below fixes the problem for me. wchar_t is built-in on C++, so the trick is to set the language to "c++" before dealing with it (and restore the language back to "auto" later). WDYT? diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 0e3126bcf2..aaa4d8d07d 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -959,10 +959,12 @@ proc test_printf_convenience_var {prefix do_wstring} { gdb_test "printf \"astr val = %s\\n\", \$astr" "astr val = fghij" \ "printf \$astr, auto language" if {$do_wstring} { + gdb_test_no_output "set language c++" gdb_test_no_output "set var \$wstr = L\"facile\"" \ "set \$wstr" gdb_test "printf \"wstr val = %ls\\n\", \$wstr" \ "wstr val = facile" "printf \$wstr" + gdb_test_no_output "set language auto" } } }