diff options
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/read.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 3556908..1d4397d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -16816,6 +16816,16 @@ read_typedef (struct die_info *die, struct dwarf2_cu *cu) sect_offset_str (die->sect_off), objfile_name (objfile)); TYPE_TARGET_TYPE (this_type) = NULL; } + if (name == NULL) + { + /* Gcc-7 and before supports -feliminate-dwarf2-dups, which generates + anonymous typedefs, which is, strictly speaking, invalid DWARF. + Handle these by just returning the target type, rather than + constructing an anonymous typedef type and trying to handle this + elsewhere. */ + set_die_type (die, target_type, cu); + return target_type; + } return this_type; } |