This is the mail archive of the gdb@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: [design change] record-replay linux ABI level


> static enum gdb_syscall
> arm_canonicalize_syscall (int syscall)
> {
>   enum { arm_sys_prlimit64 = 369 };
> 
>   if (syscall <= arm_sys_prlimit64)
>     {
>       if (syscall <= gdb_sys_sched_getaffinity)
>         return syscall;
>       else if (syscall <= gdb_sys_fadvise64_64)
>         {
>           return (syscall + (unsigned int)2);
>         }
>       else
>         {
>           switch (syscall)

Why not define a table that defines the mapping for every syscall?
We do that for registers -vs- register names, for instance, and that
works very well.

    static enum gdb_syscall arm_syscal_map[] =
    {
      gdb_sys_restart_syscall, gdb_sys_exit, gdb_sys_fork,
      [...]
      gdb_sys_sched_getaffinity, gdb_sys_arm_trap16,
      [...]
    };

-- 
Joel


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