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:

> 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


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