Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: gdb-patches@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: [RFAv3 2/3] Test the convenience functions $_gdb_setting and $_gdb_int_setting.
Date: Sat, 06 Jul 2019 10:50:00 -0000	[thread overview]
Message-ID: <20190706104947.30301-3-philippe.waroquiers@skynet.be> (raw)
In-Reply-To: <20190706104947.30301-1-philippe.waroquiers@skynet.be>

gdb/testsuite/ChangeLog
2019-06-07  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/setshow.exp: Test $_gdb_setting and $_gdb_int_setting.
	* gdb.base/default.exp: Update show_conv_list.
---
 gdb/testsuite/gdb.base/default.exp |  2 ++
 gdb/testsuite/gdb.base/setshow.exp | 57 +++++++++++++++++++++++++++++-
 2 files changed, 58 insertions(+), 1 deletion(-)

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 = <internal function _cimag>} \
 	{$_creal = <internal function _creal>} \
 	{$_isvoid = <internal function _isvoid>} \
+	{$_gdb_int_setting = <internal function _gdb_int_setting>} \
+	{$_gdb_setting = <internal function _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..6ab6e6d923 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -91,6 +91,9 @@ gdb_test "show args" "Argument list to give program being debugged when it is st
 gdb_test_no_output "set args foo bar blup baz bubble" "set args" 
 #test show args
 gdb_test "show args" "Argument list to give program being debugged when it is started is \"foo bar blup baz bubble\"..*" "show args"
+gdb_test "p \$_gdb_setting(\"args\")" ".*\"foo bar blup baz bubble\"" \
+    "_gdb_setting args"
+
 
 # Don't test if we can't pass args or if we're using a stub.
 if { !$use_gdb_stub && ![target_info exists noargs] } {
@@ -100,17 +103,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,14 +127,49 @@ 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\..*" \
     "show check type (off)"
 
+#test set breakpoint pending
+#test set breakpoint pending on
+gdb_test "set breakpoint pending on" ".*" "set breakpoint pending on"
+gdb_test "p \$_gdb_setting(\"breakpoint pending\")" ".*\"on\"" \
+    "_gdb_setting breakpoint pending on"
+gdb_test "p \$_gdb_int_setting(\"breakpoint pending\")" ".*= 1" \
+    "_gdb_int_setting breakpoint pending 1"
+#test show breakpoint pending on
+gdb_test "show breakpoint pending" ".* is on\..*" "show breakpoint pending on"
+#test show breakpoint pending off
+gdb_test "set breakpoint pending off" ".*" "set breakpoint pending off"
+gdb_test "show breakpoint pending" ".* is off\..*" "show breakpoint pending off"
+gdb_test "p \$_gdb_setting(\"breakpoint pending\")" ".*\"off\"" \
+    "_gdb_setting breakpoint pending off"
+gdb_test "p \$_gdb_int_setting(\"breakpoint pending\")" ".* = 0" \
+    "_gdb_int_setting breakpoint pending 0"
+#test set breakpoint pending auto
+gdb_test_no_output "set breakpoint pending auto" "set breakpoint pending auto"
+#test show breakpoint pending auto
+gdb_test "show breakpoint pending" " is auto.*" "show breakpoint pending auto"
+gdb_test "p \$_gdb_setting(\"breakpoint pending\")" ".*\"auto\"" \
+    "_gdb_setting breakpoint pending auto"
+gdb_test "p \$_gdb_int_setting(\"breakpoint pending\")" ".* = 2" \
+    "_gdb_setting breakpoint pending 2"
+
+
+
 #test set complaints 100
 gdb_test_no_output "set complaints 100" "set complaints 100" 
 #test show complaints 100
@@ -159,9 +203,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 +234,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"
-- 
2.20.1


  parent reply	other threads:[~2019-07-06 10:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-06 10:50 [RFAv3 0/3] Convenience functions $_gdb_setting/$_gdb_int_setting Philippe Waroquiers
2019-07-06 10:50 ` [RFAv3 3/3] NEWS and documentation for $_gdb_setting and $_gdb_int_setting Philippe Waroquiers
2019-07-06 11:22   ` Eli Zaretskii
2019-07-06 10:50 ` Philippe Waroquiers [this message]
2019-07-06 10:50 ` [RFAv3 1/3] Implement convenience functions to examine GDB settings Philippe Waroquiers
2019-07-08 16:34 ` [RFAv3 0/3] Convenience functions $_gdb_setting/$_gdb_int_setting Pedro Alves
2019-07-08 22:33   ` Philippe Waroquiers
2019-07-10 15:34     ` Pedro Alves
2019-07-10 22:09       ` Philippe Waroquiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190706104947.30301-3-philippe.waroquiers@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox