From: Pedro Alves <pedro@palves.net>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Cc: Luis Machado <luis.machado@arm.com>
Subject: Re: [PATCH] gdb.reverse/time-reverse.exp: test both time syscall and C time function (was: Re: [pushed] [gdb/testsuite] Require syscall time in gdb.reverse/time-reverse.exp)
Date: Wed, 22 Feb 2023 18:11:06 +0000 [thread overview]
Message-ID: <74fcf54f-585c-2d8a-92c0-e19f21af8a75@palves.net> (raw)
In-Reply-To: <e2124aec-2efb-1906-590f-95702a496344@suse.de>
On 2023-02-22 5:06 p.m., Tom de Vries wrote:
> On 2/22/23 17:12, Pedro Alves wrote:
>> On 2023-02-21 1:10 p.m., Tom de Vries via Gdb-patches wrote:
>>> On aarch64-linux, I run into:
>>> ...
>>> Running gdb.reverse/time-reverse.exp ...
>>> gdb compile failed, gdb.reverse/time-reverse.c: In function 'main':
>>> gdb.reverse/time-reverse.c:39:12: error: 'SYS_time' undeclared \
>>> (first use in this function); did you mean 'SYS_times'?
>>> syscall (SYS_time, &time_global);
>>> ^~~~~~~~
>>> SYS_times
>>> gdb.reverse/time-reverse.c:39:12: note: each undeclared identifier is \
>>> reported only once for each function it appears in
>>> UNTESTED: gdb.reverse/time-reverse.exp: failed to prepare
>>> ...
>>>
>>> Fix this by adding a new proc have_syscall, and requiring syscall time, such
>>> that we have instead:
>>> ...
>>> UNSUPPORTED: gdb.reverse/time-reverse.exp: require failed: \
>>> expr [have_syscall time]
>>> ...
>>>
>>> Tested on x86_64-linux and aarch64-linux.
>>
>> I think the patch below would be even better. Does it work on aarch64?
>>
>
> It does for me.
Thanks.
>
> FWIW, doing an strace on the exec, I don't see any syscall related to time.
Googling around, it seems like Aarch64 uses the vDSO for time.
>
> LGTM.
>
Thanks, I've merged it, with one small tweak:
>> --- a/gdb/testsuite/gdb.reverse/time-reverse.c
>> +++ b/gdb/testsuite/gdb.reverse/time-reverse.c
>> @@ -20,6 +20,12 @@
>> #include <sys/syscall.h>
>> #include <unistd.h>
>> +#ifdef USE_SYSCALL
>> +# define my_time(TLOC) syscall (SYS_time, &time_global)
I did not mean to hardcode the global here. I meant to write instead:
# define my_time(TLOC) syscall (SYS_time, TLOC)
Fixed in the pushed version.
>> +#else
>> +# define my_time(TLOC) time (TLOC)
>> +#endif
>> +
prev parent reply other threads:[~2023-02-22 18:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 13:10 [pushed] [gdb/testsuite] Require syscall time in gdb.reverse/time-reverse.exp Tom de Vries
2023-02-21 19:44 ` Tom Tromey
2023-02-24 12:53 ` Tom de Vries
2023-02-22 16:12 ` [PATCH] gdb.reverse/time-reverse.exp: test both time syscall and C time function (was: Re: [pushed] [gdb/testsuite] Require syscall time in gdb.reverse/time-reverse.exp) Pedro Alves
2023-02-22 17:06 ` Tom de Vries
2023-02-22 18:11 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=74fcf54f-585c-2d8a-92c0-e19f21af8a75@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@arm.com \
--cc=tdevries@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).