How does strace interpret syscall arguments?
I know it uses ptrace
for implementation,
and it can get arguments in registers,
but they're numbers only,
how开发者_StackOverflow中文版 does strace convert them into literal information?
Is it just hard code for every syscall?
Basically, yes, its hardcoded. If you look at the sourcecode (detail), you can see big tables of system calls and big switch statements that know how to decode all their various arguments and return values for multiple different OSes and CPUs
精彩评论