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]

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

The attached patched fixes an issue described on this post:

http://sourceware.org/ml/gdb-patches/2002-04/msg01114.html

Any comments?

Thanks and regards,

- --
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center
E-Mail: cseo@linux.vnet.ibm.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxNINqvq7Aov/qQARAvUXAKCLQ5hF+jNzreDyiubG2cHFRbDMNQCfYudG
Kuve0/kwqXrVF9k8rxLwtto=
=8Qjd
-----END PGP SIGNATURE-----
2007-08-16   Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>

	gdb/c-typeprint.c (c_type_print_base): check value of 
	TYPE_NFIELDS (type) when displaying members of an
	unnamed struct inside an union.

Index: src-git/gdb/c-typeprint.c
===================================================================
--- src-git.orig/gdb/c-typeprint.c	2007-08-16 15:28:04.000000000 -0700
+++ src-git/gdb/c-typeprint.c	2007-08-16 15:29:07.000000000 -0700
@@ -735,7 +735,7 @@
 	    fputs_filtered (" ", stream);
 	}
       wrap_here ("    ");
-      if (show < 0)
+      if ((show < 0) && (TYPE_NFIELDS (type) == 0))
 	{
 	  /* If we just printed a tag name, no need to print anything else.  */
 	  if (TYPE_TAG_NAME (type) == NULL)

Attachment: ptype_issue.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]