diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-09-29 22:59:22 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-10-19 10:57:51 -0400 |
commit | bb86ab837e3c4eac98dba5618bf01894dd6b502a (patch) | |
tree | 1ae7227a5e21b5adc9f67e8ae187360c2818a043 /gdb/solist.h | |
parent | c1d21880e981f3f890a74cd9d133e82b26c32818 (diff) | |
download | gdb-bb86ab837e3c4eac98dba5618bf01894dd6b502a.zip gdb-bb86ab837e3c4eac98dba5618bf01894dd6b502a.tar.gz gdb-bb86ab837e3c4eac98dba5618bf01894dd6b502a.tar.bz2 |
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>
Diffstat (limited to 'gdb/solist.h')
-rw-r--r-- | gdb/solist.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/solist.h b/gdb/solist.h index b3a06b8..5d64890 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -84,17 +84,16 @@ struct target_so_ops { /* Adjust the section binding addresses by the base address at which the object was actually mapped. */ - void (*relocate_section_addresses) (struct so_list *so, - struct target_section *); + void (*relocate_section_addresses) (so_list &so, target_section *); /* Free the link map info and any other private data structures associated with a so_list entry. */ - void (*free_so) (struct so_list *so); + void (*free_so) (so_list &so); /* Reset private data structures associated with SO. This is called when SO is about to be reloaded. It is also called before free_so when SO is about to be freed. */ - void (*clear_so) (struct so_list *so); + void (*clear_so) (const so_list &so); /* Free private data structures associated to PSPACE. This method should not free resources associated to individual so_list entries, @@ -137,7 +136,7 @@ struct target_so_ops if they represent the same library. Falls back to using strcmp on so_original_name field when set to NULL. */ - int (*same) (struct so_list *gdb, struct so_list *inferior); + int (*same) (const so_list &gdb, const so_list &inferior); /* Return whether a region of memory must be kept in a core file for shared libraries loaded before "gcore" is used to be @@ -164,14 +163,14 @@ struct target_so_ops using so_list_range = next_range<so_list>; /* Free the memory associated with a (so_list *). */ -void free_so (struct so_list *so); +void free_so (so_list &so); /* A deleter that calls free_so. */ struct so_deleter { void operator() (struct so_list *so) const { - free_so (so); + free_so (*so); } }; |