From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1506 invoked by alias); 29 Aug 2007 20:14:54 -0000 Received: (qmail 1492 invoked by uid 22791); 29 Aug 2007 20:14:52 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Aug 2007 20:14:46 +0000 Received: from mailhub3.br.ibm.com (mailhub3 [9.18.232.110]) by igw1.br.ibm.com (Postfix) with ESMTP id 275D8148349 for ; Wed, 29 Aug 2007 16:57:23 -0300 (BRT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l7TKEehd1773726 for ; Wed, 29 Aug 2007 17:14:42 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l7TKEcKN010983 for ; Wed, 29 Aug 2007 17:14:40 -0300 Received: from [9.18.238.58] ([9.18.238.58]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l7TKEb91010968; Wed, 29 Aug 2007 17:14:37 -0300 Message-ID: <46D5D3AE.4010209@linux.vnet.ibm.com> Date: Wed, 29 Aug 2007 20:14:00 -0000 From: Carlos Eduardo Seo User-Agent: Thunderbird 2.0.0.6 (X11/20070802) MIME-Version: 1.0 To: Joel Brobecker CC: Luis Machado , gdb-patches@sourceware.org Subject: Re: [patch] ptype: show members of an unnamed struct inside an union References: <20070828171422.GB3874@adacore.com> <46D47155.5000403@linux.vnet.ibm.com> <20070828200356.GA3795@adacore.com> <46D4818C.1030001@linux.vnet.ibm.com> <20070828203420.GB3795@adacore.com> <20070829025618.GA26311@caradoc.them.org> <20070829043633.GD3795@adacore.com> <20070829163021.GA32337@caradoc.them.org> <20070829183215.GF3795@adacore.com> <20070829183643.GA9026@caradoc.them.org> <20070829184824.GG3795@adacore.com> In-Reply-To: <20070829184824.GG3795@adacore.com> OpenPGP: id=8BFFA900 Content-Type: multipart/mixed; boundary="------------020900090404050308030505" 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: 2007-08/txt/msg00523.txt.bz2 This is a multi-part message in MIME format. --------------020900090404050308030505 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 692 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > Cool! Carlos, would you be able to look into that? I promise to > review any patch promptly. > Joel I believe this simple fix addresses the issue. It also fixes one thing that was wrong with the previous patch: GDB was showing "{...}" when a struct had no members, instead of . What do you think? - -- Carlos Eduardo Seo Software Engineer IBM Linux Technology Center -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG1dOuqvq7Aov/qQARAuiXAJ9l6SplkC3rw0yWirpfykMUIeozKQCdE+Nz ozaauc2l8paWiDR/t3NUCtQ= =egcI -----END PGP SIGNATURE----- --------------020900090404050308030505 Content-Type: text/plain; name="ptype_unnamed.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ptype_unnamed.diff" Content-length: 717 2007-08-16 Carlos Eduardo Seo gdb/c-typeprint.c (c_type_print_base): allows GDB to show members of unnamed struct/union that couldn't be displayed otherwise using ptype. Index: src/gdb/c-typeprint.c =================================================================== --- src.orig/gdb/c-typeprint.c 2007-08-29 12:36:09.000000000 -0700 +++ src/gdb/c-typeprint.c 2007-08-29 12:57:51.000000000 -0700 @@ -733,7 +733,7 @@ fputs_filtered (" ", stream); } wrap_here (" "); - if (show < 0) + if ((show < 0) && (TYPE_TAG_NAME (type) != NULL)) { /* If we just printed a tag name, no need to print anything else. */ if (TYPE_TAG_NAME (type) == NULL) --------------020900090404050308030505 Content-Type: application/octet-stream; name="ptype_unnamed.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ptype_unnamed.diff.sig" Content-length: 90 iD8DBQBG1dOuqvq7Aov/qQARAnYdAJ41XIIwrKri4J6r5mt2prfFC/9VZACd E8X6SdNM3gDs8P4H1Y/5bl53yjE= --------------020900090404050308030505--