Re: [PATCH 6/8] gdbserver/s390: Add fast tracepoint support.

Antoine Tremblay
2016-01-25T14:34:47Z

On 01/24/2016 07:12 AM, Marcin Kościelnicki wrote:

> +void
> +initialize_low_tracepoint (void)
> +{
> + unsigned long hwcap = getauxval (AT_HWCAP);

You might consider also using proc if getauxval is not available ?

unsigned long hwcap = 0;

#ifdef HAVE_GETAUXVAL
hwcap = getauxval (AT_HWCAP);
#else
unsigned long data[2];
FILE *f = fopen ("/proc/self/auxv", "r");

if (f == NULL)
return;

while (fread (data, sizeof (data), 1, f) > 0)
{
if (data[0] == AT_HWCAP)
{
hwcap = data[1];
break;
}
}

fclose (f);

Regards,
Antoine