I want to use Dtrace to get the value of a member in a structure in user-land, not kernel.
The C code likes this:
typedef struct
{
int a;
}st_A;
void fun1(st_A *p)
{
......
}
The Dtrace script likes this:
#!/usr/sbin/dtrace -qs
pid$1::fun1:entry
{
printf("%d\n", *(int*)copyin(arg0, 4));
}
Personally, I think this Dtrace script is very clumsy. If the structure contains many members, I need to calculate the offset of every member. If the structure contains pointer array, the situation is awful!
So, is there any easy and graceful way to access membesr in a structure in user-land process? Thanks very much!