diff options
author | Doug Evans <dje@google.com> | 2010-10-19 04:22:20 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2010-10-19 04:22:20 +0000 |
commit | 8c540a24cf3403ee2d92d495bde7c8ac472da1d0 (patch) | |
tree | 1b292695b5e11f2748d052b59aa51cbdb8c86bfe /gdb | |
parent | a01c006446311b6fce2ac93fb79dc06e5b9912c4 (diff) | |
download | gdb-8c540a24cf3403ee2d92d495bde7c8ac472da1d0.zip gdb-8c540a24cf3403ee2d92d495bde7c8ac472da1d0.tar.gz gdb-8c540a24cf3403ee2d92d495bde7c8ac472da1d0.tar.bz2 |
* c-typeprint.c (c_type_print_base, case TYPE_CODE_TYPEDEF): Verify
assumptions of when this case happens. Print "<unnamed typedef>".
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/c-typeprint.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a98fde1..bff8559 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-10-18 Doug Evans <dje@google.com> + + * c-typeprint.c (c_type_print_base, case TYPE_CODE_TYPEDEF): Verify + assumptions of when this case happens. Print "<unnamed typedef>". + 2010-10-18 Tom Tromey <tromey@redhat.com> * valprint.c (val_print_string): Pass 'encoding' to diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 0fd077b..87f7b0d 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -707,6 +707,13 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show, switch (TYPE_CODE (type)) { case TYPE_CODE_TYPEDEF: + /* 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>")); + break; + case TYPE_CODE_ARRAY: case TYPE_CODE_PTR: case TYPE_CODE_MEMBERPTR: |