Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Denis PILAT <denis.pilat@st.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: gdb.cp/userdef.exp, class reprensentation
Date: Mon, 13 Oct 2008 11:39:00 -0000	[thread overview]
Message-ID: <48F3333C.2080902@st.com> (raw)

Hi all
In gdb.cp/userdef.cc, you have the following class:

class Member
{
public:
  int z;
};


Which is semantically equivalent to the following and also printed like 
that using ptype.

struct Member {
    int z;
}


But the userdef.exp testsuite only expects gdb to return the 2nd 
semantic, which is fine with some gdb based debuggers, but not for all.
Here is a patch that allows both syntax.

Waiting for your feedback,
-- 
Denis

2008-10-13  Denis Pilat  <denis.pilat@st.com>

	* gdb.cp/userdef.exp: add a successful patern for for "ptype &*c".

Index: gdb.cp/userdef.exp
===================================================================
--- gdb.cp/userdef.exp  (revision 710)
+++ gdb.cp/userdef.exp  (working copy)
@@ -153,7 +153,14 @@
 gdb_test "print c" "\\\$\[0-9\]* = {m = {z = .*}}"
 gdb_test "print *c" "\\\$\[0-9\]* = \\(Member &\\) @$hex: {z = .*}"
 gdb_test "print &*c" "\\\$\[0-9\]* = \\(Member \\*\\) $hex"
-gdb_test "ptype &*c" "type = struct Member {\[\r\n \]+int z;\[\r\n\]+} &\\*"
+gdb_test_multiple "ptype &*c" "ptype &*c" {
+    -re "type = struct Member {\[\r\n \]+int z;\[\r\n\]+} &\\*.*$gdb_prompt $" {
+        pass "ptype &*c"
+    }
+    -re "type = class Member {\[\r\n \]+ public:\[\r\n \]+int z;\[\r\n\]+} &\\*.*$gdb_prompt $" {
+        pass "ptype &*c"
+    }
+}







             reply	other threads:[~2008-10-13 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 11:39 Denis PILAT [this message]
2008-10-13 11:52 ` Daniel Jacobowitz
2008-10-13 12:31   ` Denis PILAT

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=48F3333C.2080902@st.com \
    --to=denis.pilat@st.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