[PATCH] Cache auxv to speed up remote debugging

Luis Machado luis_gustavo@mentor.com
Tue Oct 18 22:10:00 GMT 2011


Hi,

On 10/18/2011 07:25 PM, Jan Kratochvil wrote:
> 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.
Make sense. I'll change it.

> I find the patch OK otherwise, are there some concerns it was not checked in?
>
Not really. Mainly waiting for someone to review it.

Thanks,
Luis
> Thanks,
> Jan



More information about the Gdb-patches mailing list