Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 6/6] Test nested struct assign
Date: Thu, 01 Nov 2012 07:47:00 -0000	[thread overview]
Message-ID: <1351756007-18242-7-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1351756007-18242-1-git-send-email-yao@codesourcery.com>

Existing testsuite doesn't exercise function evaluate_struct_tuple, so
this test is added to do so.

gdb/testsuite:

2012-11-01  Yao Qi  <yao@codesourcery.com>

	* gdb.base/setvar.exp: Test setting nested struct.
	* gdb.base/setvar.c (v_struct3): New.
---
 gdb/testsuite/gdb.base/setvar.c   |    7 +++++++
 gdb/testsuite/gdb.base/setvar.exp |    8 ++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.base/setvar.c b/gdb/testsuite/gdb.base/setvar.c
index 83509cd..3a80b22 100644
--- a/gdb/testsuite/gdb.base/setvar.c
+++ b/gdb/testsuite/gdb.base/setvar.c
@@ -115,6 +115,13 @@ struct {
     double	v_double_member;
 } v_struct2;
 
+struct
+{
+  long v_long_member;
+  struct t_struct t;
+  char v_char_member;
+} v_struct3;
+
 /**** unions *******/
 
 union t_union {
diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
index 7faa10a..3c5251f 100644
--- a/gdb/testsuite/gdb.base/setvar.exp
+++ b/gdb/testsuite/gdb.base/setvar.exp
@@ -383,6 +383,14 @@ test_set "set variable v_struct1 = {'h', 1, 2, 3, 4.0, 5.0}" \
 v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\}" \
   "set print structure #3"
 
+#
+# test "set variable" for nested struct
+#
+test_set "set variable v_struct3 = {1, {'h', 1, 2, 3, 4.0, 5.0}, 37}" \
+  "print v_struct3" \
+    ".*.\[0-9\]* = \\{.*v_long_member = 1,.*t = \\{.*v_char_member = 104 \'h\',.*v_short_member = 1,.*v_int_member = 2,.*v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\},.*v_char_member = 37 \'%\'\\}" \
+  "set print structure #4"
+
 set timeout $prev_timeout
 
 # Test printing of enumeration bitfields.
-- 
1.7.7.6


  parent reply	other threads:[~2012-11-01  7:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01  7:47 [PATCH 0/6] Remove unused operator OP_LABELED Yao Qi
2012-11-01  7:47 ` [PATCH 3/6] Remove 'variantno' Yao Qi
2012-11-01 15:44   ` Tom Tromey
2012-11-01  7:47 ` [PATCH 5/6] Indentation Yao Qi
2012-11-01 15:45   ` Tom Tromey
2012-11-01  7:47 ` [PATCH 1/6] Remove OP_LABELED Yao Qi
2012-11-01 15:41   ` Tom Tromey
2012-11-02 16:43   ` Pedro Alves
2012-11-02 16:49     ` Tom Tromey
2012-11-02 16:51       ` Pedro Alves
2012-11-02 17:09         ` Tom Tromey
2012-11-02 17:25           ` Pedro Alves
2012-11-01  7:47 ` [PATCH 2/6] Update comment of evaluate_struct_tuple Yao Qi
2012-11-01 15:42   ` Tom Tromey
2012-11-01  7:47 ` [PATCH 4/6] Remove 'substruct_type' and 'subfieldno' Yao Qi
2012-11-01 15:44   ` Tom Tromey
2012-11-01  7:47 ` Yao Qi [this message]
2012-11-01 15:47   ` [PATCH 6/6] Test nested struct assign Tom Tromey
2012-11-01 15:47 ` [PATCH 0/6] Remove unused operator OP_LABELED Tom Tromey
2012-11-02  0:20   ` [committed]: " Yao Qi

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=1351756007-18242-7-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --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