Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interpreting strace output

With strace it is possible to see the ioctl call for the certain file descriptor and with certain command. The third argument is a structure, but strace shows it as a raw pointer to the memory. strace output example:

open("/dev/node", O_RDWR) = 3
ioctl(3, 0x108, 0x8f0eb18) = 0
close(3)  

Is there a way (strace options or other tools) to see what is the structure, or at least a value behind a raw pointer?

like image 779
Terry Greentail Avatar asked Jun 21 '12 09:06

Terry Greentail


1 Answers

In gdb, if you stop it right before the call to ioctl, you can then enter:

(gdb) p *(ioctl_struct *) 0x8f0eb18

That will show you how the contents of that memory location maps to the ioctl_struct.

like image 187
koral Avatar answered Sep 20 '22 15:09

koral