开发者

How does strace interpret syscall arguments?

开发者 https://www.devze.com 2023-04-07 17:05 出处:网络
I know it uses ptrace for implementation, and it can get arguments in registers, but they\'re numbers only,

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

0

精彩评论

暂无评论...
验证码 换一张
取 消