The x86_64 ABI for FreeBSD requires function arguments of type MEMORY to be
passed on stack instead of registers. dtrace does not understand this rule so
it gets the register to argument mapping wrong for MEMORY arguments.
Example:
struct big {
u_int64_t a;
u_int64_t b;
u_int64_t c;
};
void func(int *param1, struct big param2, int *param3);
param1 and param3 are type REGISTER so they are passed in %rsi and %rdx
respectively. param2 is type MEMORY (more than 8 bytes) so it is passed on
stack.
dtrace thinks that the mapping is:
param1 in %rsi - arg0
param2 in %rdx - arg1
param3 in %rcx - arg2
when the mapping really is:
param1 in %rsi - arg0
param2 on stack
param3 in %rdx - arg1
------------------------------------------
DTrace: dtrace-discuss
Permalink:
https://dtrace.topicbox.com/groups/dtrace-discuss/T92ec5f4b133e0bbb-M031f86aa185700a9bcb19761
Delivery options: https://dtrace.topicbox.com/groups/dtrace-discuss/subscription