This is the mail archive of the mailing list for the frysk 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: [rfc] Remove SyscallNum.shjava and maintain syscallList manually for different architectures

Hi Tom,

On Tue, 2006-09-05 at 18:15 -0600, Tom Tromey wrote:
> One use case I came up with is supporting strace's -o option in
> ftrace.  Consider 'ftrace -o <x>'... in this case we'd need to be able
> to look at a SyscallEventInfo and test "is it <x>?".  Probably this
> would mean putting some "model" object representing the <x> syscall
> into a hashset.

Do you mean the -e <expr> option? (
My version of ftrace has -o <x> being redirect output to <x>.

> In the current setup one plausible approach would be to have multiple
> Syscall objects with the same number but different names.  Then,
> SyscallEventInfo would have an accessor to return the corresponding
> Syscall -- which would be the "decoded" one.  Finally, Syscall would
> have an equals() method that would compare both the name and the
> number.

Yes, that seems the right approach.

> The only oddity then would be what to do in the case where an unknown
> number is passed to syscallByNum.  But ... I wonder if this should
> simply throw an exception.

Not an exception. Sometimes new system calls are introduced. It should
just return a Syscall object for number xyz with as name "unknown-xyz"
so as to be unique.



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