]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Have expand_symtabs_matching work for already-expanded CUs
authorTom Tromey <tom@tromey.com>
Sat, 7 Dec 2024 23:26:06 +0000 (16:26 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 10 Sep 2025 22:05:28 +0000 (16:05 -0600)
commitf88f9f42db8ff782758435214678ad87d3fc3a18
tree26ba29f129c2e500b73cef8c0b802c6746c3e4e1
parent29fa4279c2f1bc2e0ac7cf77a95cbc0d83dd3c4a
Have expand_symtabs_matching work for already-expanded CUs

Currently, gdb will search the already-expanded symtabs in one loop,
and then also expand matching symtabs in another loop.  However, this
is somewhat inefficient -- when searching the already-expanded
symtabs, all such symtabs are examined.  However, the various "quick"
implementations already know which subset of symtabs might have a
match.

This changes the contract of expand_symtabs_matching to also call the
callback for an already-expanded symtab.  With this change, and some
subsequent enabling changes, the number of searched symtabs should
sometimes be reduced.  This also cuts down on the amount of redundant
code.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16994
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16998
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30736
Acked-By: Simon Marchi <simon.marchi@efficios.com>
gdb/dwarf2/read.c
gdb/psymtab.c