[PATCH v2] [gdb/symtab] Don't expand non-Ada CUs for info exceptions
Tom de Vries
tdevries@suse.de
Tue Sep 24 08:25:18 GMT 2024
On 9/23/24 19:20, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
> Tom> I noticed when running test-case gdb.ada/info_exc.exp with glibc debug info
> Tom> installed, that the "info exceptions" command that lists all Ada exceptions
> Tom> also expands non-Ada CUs, which includes CUs in
> Tom> /lib64/ld-linux-x86-64.so.2 and /lib64/libc.so.6.
>
> Tom> Fix this by:
> Tom> - adding a new lang_matcher parameter to the expand_symtabs_matching
> Tom> function, and
> Tom> - using that new parameter in the expand_symtabs_matching call in
> Tom> ada_add_global_exceptions.
>
> Thanks for doing this.
>
> Tom> +void
> Tom> +dwarf2_per_cu_data::ensure_lang (dwarf2_per_objfile *per_objfile)
> Tom> +{
> Tom> + if (lang (false) != language_unknown)
> Tom> + return;
> Tom> +
> Tom> + section->read (per_objfile->objfile);
> Tom> + cutu_reader reader (this, per_objfile);
>
> I think the cutu_reader constructor ensures the section is read in.
>
Ack, dropped that bit.
> I really wish this business about CU language discovery, cutu_reader,
> etc, weren't such a mess of spaghetti. Not caused by you though.
>
> I tend to think this information should be reliable after the initial
> scan. So maybe the index readers should pre-read all this in the
> background or something like that.
>
Agreed, that sounds like a good approach.
> Approved-By: Tom Tromey <tom@tromey.com>
Pushed, thanks for the review.
- Tom
> Tom
More information about the Gdb-patches
mailing list