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:24:18 -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> <CAP9bCMSDiTjTrQo-G7OBEBYcjxPCzhnmY8-s_ZWdhdNeGf6k5A at mail dot gmail dot com>
On Sunday, December 15 2013, Doug Evans wrote:
> Alternatively, gdb knows the numbers. IWBN to provide a way to print
> them, and then the .exp file could get the numbers from that.
> OTOH, one could just have the .exp do the catch and process the output
> to get the number.
>
> (gdb) catch syscall 6
> Catchpoint 2 (syscall 'close' [6])
> (gdb) catch syscall close
> Catchpoint 1 (syscall 'close' [6])
Yes, it can be done. But testing for the correctness of this number is
also part of the test, IMO...
> One might even check the .c __NR_ value with gdb's value computed from
> the .exp for extra paranoid testing, but I'm guessing there's
> insufficient benefit.
... and maybe it isn't an insufficient benefit. I mean, currently
"catch syscall" works on the host only, but it's being implemented in
gdbserver and eventually I guess it'll be a good idea to really check
those numbers against the hard-coded ones. Currently, they are
hard-coded in the .exp file, but as you said, one could check the __NR_*
value too...
Anyway, just my opinion of why we should keep those numbers hard-coded
somewhere.
--
Sergio