From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20855 invoked by alias); 13 Oct 2008 11:39:24 -0000 Received: (qmail 20838 invoked by uid 22791); 13 Oct 2008 11:39:24 -0000 X-Spam-Check-By: sourceware.org Received: from s200aog16.obsmtp.com (HELO s200aog16.obsmtp.com) (207.126.144.130) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 13 Oct 2008 11:38:41 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob016.postini.com ([207.126.147.11]) with SMTP; Mon, 13 Oct 2008 11:38:37 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6955FDB0B for ; Mon, 13 Oct 2008 11:38:37 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BC5D54C1B9 for ; Mon, 13 Oct 2008 11:38:37 +0000 (GMT) Received: from crx595.cro.st.com (crx595.cro.st.com [164.129.44.95]) by mail1.cro.st.com (MOS 3.8.7a) with ESMTP id CQC15009 (AUTH "denis pilat"); Mon, 13 Oct 2008 13:39:38 +0200 (CEST) Message-ID: <48F3333C.2080902@st.com> Date: Mon, 13 Oct 2008 11:39:00 -0000 From: Denis PILAT User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: gdb-patches Subject: gdb.cp/userdef.exp, class reprensentation Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00336.txt.bz2 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 * 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" + } +}