This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Improve and fix catch-syscall.exp
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Doug Evans <xdje42 at gmail dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 16 Dec 2013 02:20:09 -0200
- Subject: Re: [PATCH] Improve and fix catch-syscall.exp
- Authentication-results: sourceware.org; auth=none
- References: <m37gb85p2o dot fsf at redhat dot com> <m3a9g27yr8 dot fsf at sspiff dot org>
On Sunday, December 15 2013, Doug Evans wrote:
> Hi.
>
> I was wondering, what if the magic numbers that are the syscall
> numbers were recorded in the test .c file like:
>
> int close_syscall_number = foo;
>
> and then have the .exp fetch these values after running-to-main.
> That would save having to record syscall numbers in the .exp,
> and all the conditionals to test for the architecture.
But then we'd have to make the conditionals on the .c file instead,
right? I mean, we'd just be switching the place of the problem...
> Not sure there isn't a flaw in this plan,
> and I guess it's debatable whether it's better to just record
> the numbers in the .exp or reference the __NR_* numbers from asm/unistd*.h
> in the .c, but it sounds promising.
The .exp file needs to know the syscall numbers (not only the names) in
order to compare them with the output of "catch syscall". Therefore,
just referencing the syscalls as __NR_* won't help with that...
Unless I'm missing something in your proposal, I don't see how it could
improve the current situation.
--
Sergio