x86
x86

Reputation: 123

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 does strace convert them into literal information?

Is it just hard code for every syscall?

Upvotes: 1

Views: 715

Answers (1)

Chris Dodd
Chris Dodd

Reputation: 126203

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

Upvotes: 2

Related Questions