This is the mail archive of the
mailing list for the GDB project.
[patch] Clearer support of TYPE_CODE_TYPEDEF in c_type_print_base
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Thu, 14 Oct 2010 00:00:56 -0700 (PDT)
- Subject: [patch] Clearer support of TYPE_CODE_TYPEDEF in c_type_print_base
Since there's some discussion involved with the gdbtypes.c side of a
previous version of this patch, I have split this part out.
I like this patch, it adds clarity to the case where a typedef
leaks through CHECK_TYPEDEF.
I will check it in in two days if there are no objections.
2010-10-13 Doug Evans <email@example.com>
* c-typeprint.c (c_type_print_base, case TYPE_CODE_TYPEDEF): Verify
assumptions of when this case happens. Print "<unnamed typedef>".
RCS file: /cvs/src/src/gdb/c-typeprint.c,v
retrieving revision 1.62
diff -u -p -r1.62 c-typeprint.c
--- c-typeprint.c 13 Oct 2010 15:10:10 -0000 1.62
+++ c-typeprint.c 14 Oct 2010 00:33:32 -0000
@@ -707,6 +707,13 @@ c_type_print_base (struct type *type, st
switch (TYPE_CODE (type))
+ /* If we get here, the typedef doesn't have a name, and we couldn't
+ resolve TYPE_TARGET_TYPE. Not much we can do. */
+ gdb_assert (TYPE_NAME (type) == NULL);
+ gdb_assert (TYPE_TARGET_TYPE (type) == NULL);
+ fprintf_filtered (stream, _("<unnamed typedef>"));