This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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




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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]