gdb: replace some so_list parameters to use references

A subsequent patch changes so_list to be linked using
intrusive_list.  Iterating an intrusive_list yields some references to
the list elements.  Convert some functions accepting so_list objects to
take references, to make things easier and more natural.  Add const
where possible and convenient.

Change-Id: Id5ab5339c3eb6432e809ad14782952d6a45806f3
Approved-By: Pedro Alves <pedro@palves.net>
Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
This commit is contained in:
Simon Marchi
2023-09-29 22:59:22 -04:00
committed by Simon Marchi
parent c1d21880e9
commit bb86ab837e
23 changed files with 183 additions and 191 deletions

View File

@@ -99,13 +99,12 @@ extern observable<inferior */* parent_inf */, inferior */* child_inf */,
/* The shared library specified by SOLIB has been loaded. Note that
when gdb calls this observer, the library's symbols probably
haven't been loaded yet. */
extern observable<struct so_list */* solib */> solib_loaded;
extern observable<so_list &/* solib */> solib_loaded;
/* The shared library SOLIB has been unloaded from program space PSPACE.
Note when gdb calls this observer, the library's symbols have not
been unloaded yet, and thus are still available. */
extern observable<struct program_space */* pspace */, struct so_list */* solib */>
solib_unloaded;
extern observable<program_space *, const so_list &/* solib */> solib_unloaded;
/* The symbol file specified by OBJFILE has been loaded. */
extern observable<struct objfile */* objfile */> new_objfile;