This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] ptype: show members of an unnamed struct inside an union


-----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 <no data fields>.

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

2007-08-16   Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>

        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)

Attachment: ptype_unnamed.diff.sig
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]