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: [RFA 2/3] Test 'set print frame-info|frame-arguments presence'.
Date: Sat, 04 May 2019 21:57:00 -0000	[thread overview]
Message-ID: <20190504215538.29821-3-philippe.waroquiers@skynet.be> (raw)
In-Reply-To: <20190504215538.29821-1-philippe.waroquiers@skynet.be>

---
 gdb/testsuite/ChangeLog               |  4 ++
 gdb/testsuite/gdb.base/frame-args.exp | 56 +++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 729cc520d7..68c58f402d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -15864,3 +15864,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-05-04  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
+
+	* gdb.base/frame-args.exp: Test new 'frame-arguments presence'.
+	Test new 'set print frame-info'.
diff --git a/gdb/testsuite/gdb.base/frame-args.exp b/gdb/testsuite/gdb.base/frame-args.exp
index 77f136c064..a7fd90c523 100644
--- a/gdb/testsuite/gdb.base/frame-args.exp
+++ b/gdb/testsuite/gdb.base/frame-args.exp
@@ -50,4 +50,60 @@ gdb_test "frame 1" \
          ".*in call_me \\(i=\\.\\.\\., f=\\.\\.\\., s=\\.\\.\\., ss=\\.\\.\\., u=\\.\\.\\., e=\\.\\.\\.\\) at .*frame-args\\.c:.*" \
          "frame 1 with print frame-arguments set to none"
 
+# Test with "print frame-arguments" set to "presence"
+
+gdb_test_no_output "set print frame-arguments presence" \
+         "set print frame-arguments presence"
+gdb_test "frame 1" \
+         ".*in call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \
+         "frame 1 with print frame-arguments set to presence"
+gdb_test "frame 2" \
+         ".*in main \\(\\) at .*frame-args\\.c:.*" \
+         "frame 2 (no args) with print frame-arguments set to presence"
+
+
+# Test with "print frame-info" set to "loc_and_address"
+gdb_test_no_output "set print frame-info loc_and_address" \
+    "set print frame-info loc_and_address"
+gdb_test "frame 1" \
+         ".*0x.* in call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \
+    "frame 1 with print frame-info set to loc_and_address"
+
+# Test with "print address" set to "off" ...
+gdb_test_no_output "set print address off" \
+    "set print address off"
+
+# ... and "loc_and_address (previously set)
+gdb_test "frame 1" \
+         "#1  call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \
+    "frame 1 with print frame-info set to loc_and_address and address off"
+
+# ... and "location"
+gdb_test_no_output "set print frame-info location" \
+    "set print frame-info location"
+gdb_test "frame 1" \
+         "#1  call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*" \
+         "frame 1 with print frame-info set to location and address off"
+
+# ... and "short_loc"
+gdb_test_no_output "set print frame-info short_loc" \
+    "set print frame-info short_loc"
+gdb_test "frame 1" \
+         "#1  call_me \\(\\.\\.\\.\\)" \
+    "frame 1 with print frame-info set to short_loc and address off"
+
+# ... and "src_and_loc"
+gdb_test_no_output "set print frame-info src_and_loc" \
+    "set print frame-info src_and_loc"
+gdb_test "frame 1" \
+         "#1  call_me \\(\\.\\.\\.\\) at .*frame-args\\.c:.*\r\n\[1-9\]\[0-9\]*\[ \t\]*break_me \\(\\);" \
+         "frame 1 with print frame-info set to src_and_loc and address off"
+
+# ... and "src_line".
+gdb_test_no_output "set print frame-info src_line" \
+    "set print frame-info src_line"
+gdb_test "frame 1" \
+    "\[1-9\]\[0-9\]*\[ \t\]*break_me \\(\\);" \
+    "frame 1 with print frame-info set to src_line and address off"
+
 
-- 
2.20.1


  parent reply	other threads:[~2019-05-04 21:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 21:57 [RFA 0/3] Better control about frame information to print Philippe Waroquiers
2019-05-04 21:57 ` [RFA 1/3] Implement 'set print frame-info|frame-arguments presence' Philippe Waroquiers
2019-05-05 20:24   ` Andreas Schwab
2019-05-06 19:43   ` Tom Tromey
2019-05-04 21:57 ` Philippe Waroquiers [this message]
2019-05-04 21:57 ` [RFA 3/3] Document " Philippe Waroquiers
2019-05-05 16:43   ` Eli Zaretskii

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=20190504215538.29821-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