Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/stack_machdep.c
Context not available. | |||||
#endif | #endif | ||||
stack_capture(curthread, st, fp); | stack_capture(curthread, st, fp); | ||||
} | } | ||||
instruction_ptr | |||||
stack_frame_caller_ip(stack_frame_ptr frame) | |||||
{ | |||||
/* | |||||
* In x86 stacks, what is stored on the stack is not the | |||||
* address of the call, but rather the return address, | |||||
* i.e. what the ip should be after the call. To account for | |||||
* this, decrement the address by 1 so that it will resolve to | |||||
* the call instruction, not the one after. | |||||
*/ | |||||
return (instruction_ptr) (frame->f_retaddr - 1); | |||||
} | |||||
Context not available. |