From patchwork Fri Jul 5 19:58:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 33613 Received: (qmail 121065 invoked by alias); 5 Jul 2019 19:58:36 -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 121009 invoked by uid 89); 5 Jul 2019 19:58:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:D*be, D*be, HContent-Transfer-Encoding:8bit X-HELO: mailsec106.isp.belgacom.be Received: from mailsec106.isp.belgacom.be (HELO mailsec106.isp.belgacom.be) (195.238.20.102) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Jul 2019 19:58:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1562356714; x=1593892714; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZGRldggQDoYT7HqPd7ZKBnnOoMPH1synzlMhArXZCiM=; b=U2VARZVBY/48LwMG+7Z4WZZHpDf6a4PnI14No4dPbhLZ7XkQamw/n6U1 mFwkpOQCKsEdfrAxb+2Sv9YVagdVzQ==; Received: from 96.218-128-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.128.218.96]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 05 Jul 2019 21:58:29 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFAv2 2/3] Test the convenience functions $_gdb_setting and $_gdb_int_setting. Date: Fri, 5 Jul 2019 21:58:22 +0200 Message-Id: <20190705195823.3472-3-philippe.waroquiers@skynet.be> In-Reply-To: <20190705195823.3472-1-philippe.waroquiers@skynet.be> References: <20190705195823.3472-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-IsSubscribed: yes --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/default.exp | 2 ++ gdb/testsuite/gdb.base/setshow.exp | 27 ++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 90b5f8ff8b..3ba2235c0d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -16466,3 +16466,7 @@ For older changes see ChangeLog-1993-2013. Copyright 2014-2019 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. +2019-04-27 Philippe Waroquiers + + * gdb.base/setshow.exp: Test $_gdb_setting and $_gdb_int_setting. + * gdb.base/default.exp: Update show_conv_list. diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 0325b8045d..8e79cbc85d 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -604,6 +604,8 @@ set show_conv_list \ {$_cimag = } \ {$_creal = } \ {$_isvoid = } \ + {$_gdb_int_setting = } \ + {$_gdb_setting = } \ {$_gdb_major = 8} \ {$_gdb_minor = 4} \ {$_shell_exitsignal = void} \ diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index d807d75a66..b78bea8e18 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -100,17 +100,23 @@ if { !$use_gdb_stub && ![target_info exists noargs] } { gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args" } #test set check range on -gdb_test "set check range on" ".*" "set check range on" +gdb_test "set check range on" ".*" "set check range on" +gdb_test "p \$_gdb_setting(\"check range\")" ".*\"on\"" \ + "_gdb_setting check range on" #test show check range on gdb_test "show check range" "Range checking is \"on\"\..*" "show check range (on)" #test set check range off with trailing space gdb_test_no_output "set check range off " "set check range off" #test show check range off gdb_test "show check range" "Range checking is \"off\"\..*" "show check range (off)" +gdb_test "p \$_gdb_setting(\"check range\")" ".*\"off\"" \ + "_gdb_setting check range off" #test set check range auto gdb_test_no_output "set check range auto" "set check range auto" #test show check range auto gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)" +gdb_test "p \$_gdb_setting(\"check range\")" ".*\"auto\"" \ + "_gdb_setting check range auto" # Test set check type on gdb_test "set check type on" ".*" "set check type on" @@ -118,9 +124,17 @@ gdb_test "set check type on" ".*" "set check type on" # Test show check type on gdb_test "show check type" "Strict type checking is on\..*" \ "show check type (on)" +gdb_test "p \$_gdb_setting(\"check type\")" ".*\"on\"" \ + "_gdb_setting check type on" +gdb_test "p \$_gdb_int_setting(\"check type\")" ".*= 1" \ + "_gdb_setting check type on 1" # Test set check type off with trailing space gdb_test_no_output "set check type off " "set check type off" +gdb_test "p \$_gdb_setting(\"check type\")" ".*\"off\"" \ + "_gdb_setting check type off" +gdb_test "p \$_gdb_int_setting(\"check type\")" ".*= 0" \ + "_gdb_setting check type off 0" # Test show check type off gdb_test "show check type" "Strict type checking is off\..*" \ @@ -159,9 +173,17 @@ gdb_test "show environment FOOBARBAZ" "FOOBARBAZ = grbxgrbxgrbx.*" "show enviro gdb_test_no_output "set height 100" "set height 100" #test show height 100 gdb_test "show height" "Number of lines gdb thinks are in a page is 100..*" "show height" +gdb_test "p \$_gdb_setting(\"height\")" ".*\"100\"" \ + "_gdb_setting height 100" +gdb_test "p \$_gdb_int_setting(\"height\")" ".*= 100" \ + "_gdb_int_setting height 100" # Back to infinite height to avoid pagers. While at it, check that # literal "unlimited" works just as well as 0. gdb_test_no_output "set height unlimited" +gdb_test "p \$_gdb_setting(\"height\")" ".*\"unlimited\"" \ + "_gdb_setting height unlimited" +gdb_test "p \$_gdb_int_setting(\"height\")" ".*= 0" \ + "_gdb_int_setting height unlimited" #test set history expansion on gdb_test_no_output "set history expansion on" "set history expansion on" #test show history expansion on @@ -182,6 +204,9 @@ gdb_test_no_output "set history filename ~/foobar.baz" \ gdb_test "show history filename" \ "The filename in which to record the command history is \"[string_to_regexp $HOME]/foobar.baz\"..*" \ "show history filename (~/foobar.baz)" +gdb_test "p \$_gdb_setting(\"history filename\")" \ + ".*\"[string_to_regexp $HOME]/foobar.baz\"..*" \ + "_gdb_setting history filename" #get current working directory set PWD "" set test "show working directory"