Fix a bug in the amd64 dtrace_getarg() implementation: when unwinding the

stack, take into account the copy of rsi pushed between the breakpoint
trapframe and the dtrace_invop frame. Prior to r287644, this was covered
by the fact that sizeof(struct amd64_frame) was 24 rather than 16.

Reported by:	smh
This commit is contained in:
markj 2015-11-19 05:33:15 +00:00
parent aa67e007fd
commit 965992ab09

View File

@ -385,8 +385,8 @@ dtrace_getarg(int arg, int aframes)
* we're seeking is passed in regsiters, we can just
* load it directly.
*/
struct trapframe *tf =
(struct trapframe *)((uintptr_t)&fp[1]);
struct trapframe *tf = (struct trapframe *)
((uintptr_t)&fp[1] + sizeof(uintptr_t));
if (arg <= inreg) {
switch (arg) {