This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Cache auxv to speed up remote debugging
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Luis Machado <lgustavo at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Pedro Alves <pedro at codesourcery dot com>
- Date: Tue, 18 Oct 2011 23:25:47 +0200
- Subject: Re: [PATCH] Cache auxv to speed up remote debugging
- References: <4E4E8C12.5020507@codesourcery.com>
On Fri, 19 Aug 2011 18:15:14 +0200, Luis Machado wrote:
> --- gdb.orig/auxv.c 2011-01-26 15:52:39.718522000 -0200
> +++ gdb/auxv.c 2011-01-26 16:09:29.566522000 -0200
[...]
> +/* Fetch the auxv object from inferior INF. If auxv is cached already,
> + return a pointer to the cache. If not, fetch the auxv object from the
> + target and cache it. This function always returns a valid INFO pointer. */
> +
> +static struct auxv_info *
> +get_auxv_inferior_data (struct inferior *inf, struct target_ops *ops)
> +{
> + struct auxv_info *info;
> +
> + info = inferior_data (inf, auxv_inferior_data);
> + if (info == NULL)
> + {
> + info = XZALLOC (struct auxv_info);
> + info->length = target_read_alloc (ops, TARGET_OBJECT_AUXV,
> + NULL, &info->data);
> + set_inferior_data (inf, auxv_inferior_data, info);
> + }
> +
> + return info;
> +}
+
> + info = get_auxv_inferior_data (current_inferior (), ops);
+
> + info = get_auxv_inferior_data (current_inferior (), ops);
The `inf' parameter of get_auxv_inferior_data is redundant / incorrect,
target_read_alloc (TARGET_OBJECT_AUXV) does not work for any other INF than
current_inferior () anyway, the `inf' parameter should be removed/assumed.
I find the patch OK otherwise, are there some concerns it was not checked in?
Thanks,
Jan