This is the mail archive of the frysk@sources.redhat.com 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]

[rfc] Remove SyscallNum.shjava and maintain syscallList manually for different architectures


It is very convenient to generate SyscallNum.java by SyscallNum.shjava
in a automatic way, but there are some shortcomings for this script
now.
Mark, add you in CC list for d).

a) SyscallNum.shjava miss some syscalls.
I posted this problem here,
http://sources.redhat.com/ml/frysk/2006-q3/msg00319.html
regular expression in SyscallNum.shjava could not cover all syscall
names.

Actually, this point is not strong enough to remove this script, but
the following ones are persuasive, IMO.

b) SyscallNum.shjava is for "host", instead of for "target".
The scheme in SyscallNum.shjava is to extract syscall num from the
output of GCC extension on "host".  Mostly, syscall num is different
when "target" != "host".  For example, when a i386 program running on
a X86_64 machine, SyscallNum.SYSread should be the number of SYSCALL 
read on i386, instead of X86_64.(SyscallNum.SYSread on X86_64 is 0)

c) syscallList in Syscall.java is hardwired to Linux+i386.
If we could extend syscallList for other platforms(of course, we
should), syscallList could replace SyscallNum.java produced by
SyscallNum.shjava.

d) Some "sub-syscalls", such as connect() and listen(), could not be
listed by SyscallNum.shjava.
Mark present this problem here,
http://sources.redhat.com/ml/frysk/2006-q3/msg00370.html

We could add "bind", "listen", to syscallList with the same syscall
number, and Syscall.java provides some methods, such as
isSyscall(String), for Syscall Observers, like this,

public Action updateSyscallEnter (Task task)
{
  ......
  syscall = Syscall.getSyscall (int syscallNum);  // A Factory maybe.
  // Yao is not sure he could get first syscall argument in Syscall.
  if (syscall.isSyscall("bind"))
  {
      .....
  }
}

Any comments are welcome.  Thanks!

-- 
Yao Qi


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