task_pt_regs(current) is only valid when current->mm has been setup.
#endif
#endif
+/* Always use _stp_current_pt_regs() in tapset/runtime code to make sure
+ the returned user pt_regs are sane. */
+#define _stp_current_pt_regs() (current->mm ? task_pt_regs(current) : NULL)
+
/* Whether all user registers are valid. If not the pt_regs needs,
* architecture specific, scrubbing before usage (in the unwinder).
* XXX Currently very simple heuristics, just check arch. Should
{
/* First try simple recovery through task_pt_regs,
on some platforms that already provides complete uregs. */
- c->uregs = task_pt_regs (current);
- if (_stp_task_pt_regs_valid(current, c->uregs))
+ c->uregs = _stp_current_pt_regs();
+ if (c->uregs && _stp_task_pt_regs_valid(current, c->uregs))
c->probe_flags |= _STP_PROBE_STATE_FULL_UREGS;
}
return c->uregs;
if (CONTEXT->probe_flags & _STP_PROBE_STATE_USER_MODE)
uregs = CONTEXT->uregs;
- else if (current->mm)
- uregs = task_pt_regs(current);
else
- uregs = NULL;
+ uregs = _stp_current_pt_regs();
if (uregs)
THIS->__retvalue = (int64_t) REG_IP(uregs);
name = "sigaltstack"
uss_uaddr = $uss
uoss_uaddr = $uoss
- regs = %{ task_pt_regs(current) %}
+ regs = %{ _stp_current_pt_regs() %}
argstr = sprintf("%p, %p", $uss, $uoss)
}
probe syscall.sigaltstack.return = kernel.function("sys_sigaltstack").return
THIS->__retvalue = CONTEXT->kregs ? CONTEXT->kregs->r8 : 0;
%}
function _ia64_pipe1:long() %{
- THIS->__retvalue = task_pt_regs(current)->r9;
+ THIS->__retvalue = _stp_current_pt_regs()->r9;
%}
%)
# pipe _______________________________________________________