This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 6/8] gdbserver/s390: Add fast tracepoint support.
- From: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- To: <gdb-patches at sourceware dot org>, Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- Date: Mon, 25 Jan 2016 09:34:43 -0500
- Subject: Re: [PATCH 6/8] gdbserver/s390: Add fast tracepoint support.
- Authentication-results: sourceware.org; auth=none
- References: <1453637529-26972-1-git-send-email-koriakin at 0x04 dot net> <1453637529-26972-7-git-send-email-koriakin at 0x04 dot net>
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