If you add some "clean_restart" calls to the test case gdb.ada/import.exp, it will cause failures. This happens because the DWARF indexer does not create symbols for these DIEs. The test currently works because the CUs in question are already expanded.
I have a patch for this. Probably the Ada compiler should be changed to emit these using imported declarations, though. The current approach seems a bit fragile maybe.
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a7343246f5319e67e7e96ba98596c94cda115560 commit a7343246f5319e67e7e96ba98596c94cda115560 Author: Tom Tromey <tom@tromey.com> Date: Thu Jan 2 13:40:27 2025 -0700 Ada import functions not in index The cooked index does not currently contain entries for Ada import functions. This means that whether or not these are visible to "break" depends on which CUs were previously expanded -- clearly a bug. This patch fixes the issue. I think the comments in the patch explain the fix reasonably well. Perhaps one to-do item here is to change GNAT to use DW_TAG_imported_declaration for these imports. This may eventually let us remove some of the current hacks. This version includes a fix from Simon to initialize the new member. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32511 Acked-By: Simon Marchi <simon.marchi@efficios.com>
Fixed. The Ada compiler should still be changed, and gdb should handle imported declarations more generically, but that's a bigger and separate project.