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] Improve and fix catch-syscall.exp


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


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