This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][PATCH][symtab] Warn about unresolved DW_AT_upper_bound/DW_AT_count
- From: Tom Tromey <tom at tromey dot com>
- To: Tom de Vries <tdevries at suse dot de>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 19 Jul 2018 08:40:20 -0600
- Subject: Re: [RFC][PATCH][symtab] Warn about unresolved DW_AT_upper_bound/DW_AT_count
- References: <20180718171814.br2yfrfajkyk6i2j@delia>
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> this patch (without test-case for now) generates a warning if
Tom> DW_AT_upper_bound or DW_AT_count is defined, but can't be translated. This
Tom> is triggered for current gcc in lto mode for vla test-cases.
Tom> F.i.:
Tom> ...
Tom> $ gcc gcc/testsuite/gcc.dg/guality/vla-1.c -g -O2 -flto \
Tom> -DPREVENT_OPTIMIZATION -o ./vla-1.exe
Tom> $ ./gdb -batch -ex "set complaints 10" -ex "file ./vla-1.exe"
Tom> During symbol reading, Unresolved DW_AT_upper_bound - DIE at 0x337
Tom> [in module vla-1.exe].
Tom> ...
Tom> Good idea?
I think so.
Tom> + if (attr_ub)
[...]
Tom> + if (attr_count)
The gdb style is to use a check against nullptr in these spots.
Tom