Re: [PATCH 02/24] gdb: add program_space parameter to target_so_ops::clear_solib

Pedro Alves
2023-10-17T14:57:58Z

Just a tiny nit.

On 2023-10-10 21:39, Simon Marchi wrote:

> diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
> index 98c81bb3bdaa..4796315c373a 100644
> --- a/gdb/solib-darwin.c
> +++ b/gdb/solib-darwin.c
> @@ -78,16 +78,14 @@ static const registry<program_space>::key<darwin_info>
> /* Get the current darwin data. If none is found yet, add it now. This

I guess "current darwin data" -> "darwin data for PSPACE" ?

> function always returns a valid object. */
>
> -static struct darwin_info *
> -get_darwin_info (void)
> +static darwin_info *
> +get_darwin_info (program_space *pspace)
> {

> --- a/gdb/solib-dsbt.c
> +++ b/gdb/solib-dsbt.c
> @@ -169,16 +169,14 @@ static const registry<program_space>::key<dsbt_info> solib_dsbt_pspace_data;
> /* Get the current dsbt data. If none is found yet, add it now. This

Ditto "current" here.

> function always returns a valid object. */
>
> -static struct dsbt_info *
> -get_dsbt_info (void)
> +static dsbt_info *
> +get_dsbt_info (program_space *pspace)
> {
> - struct dsbt_info *info;
> -
> - info = solib_dsbt_pspace_data.get (current_program_space);
> - if (info != NULL)
> + dsbt_info *info = solib_dsbt_pspace_data.get (pspace);
> + if (info != nullptr)
> return info;
>
> - return solib_dsbt_pspace_data.emplace (current_program_space);
> + return solib_dsbt_pspace_data.emplace (pspace);
> }
>
>
> @@ -270,9 +268,6 @@ decode_loadmap (const gdb_byte *buf)
> return int_ldmbuf;
> }