From: Jafeer Uddin Date: Tue, 2 Jul 2019 15:57:07 +0000 (-0400) Subject: Fix errors with new backtrace functions missed in backtracing patch X-Git-Tag: release-4.2~75 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=53002549573ac272678abb4590590bdd08786b8f;p=systemtap.git Fix errors with new backtrace functions missed in backtracing patch --- diff --git a/tapset/linux/ucontext-unwind.stp b/tapset/linux/ucontext-unwind.stp index dadfb5d47..25c1d8acb 100644 --- a/tapset/linux/ucontext-unwind.stp +++ b/tapset/linux/ucontext-unwind.stp @@ -34,13 +34,15 @@ function print_ubacktrace () %{ /* pragma:unwind */ /* pragma:symbols */ */ function print_ubacktrace (pc:long, sp:long) %{ /* pragma:unwind */ /* pragma:symbols */ /* myproc-unprivileged */ /* pragma:uprobes */ /* pragma:vma */ + unsigned long saved_pc, saved_sp; + if (_stp_get_uregs(CONTEXT) == NULL) { _stp_stack_user_print(CONTEXT, _STP_SYM_FULLER); /* expecting a failure message */ STAP_RETURN(); } - unsigned saved_pc = REG_IP(CONTEXT->uregs); - unsigned saved_sp = REG_SP(CONTEXT->uregs); + saved_pc = REG_IP(CONTEXT->uregs); + saved_sp = REG_SP(CONTEXT->uregs); REG_IP(CONTEXT->uregs) = STAP_ARG_pc; REG_SP(CONTEXT->uregs) = STAP_ARG_sp; @@ -120,13 +122,15 @@ function print_ubacktrace_fileline () %{ /* pragma:unwind */ /* pragma:symbols * */ function print_ubacktrace_fileline (pc:long, sp:long) %{ /* pragma:unwind */ /* pragma:symbols */ /* myproc-unprivileged */ /* pragma:uprobes */ /* pragma:vma */ /* pragma:lines */ + unsigned long saved_pc, saved_sp; + if (_stp_get_uregs(CONTEXT) == NULL) { _stp_stack_user_print(CONTEXT, _STP_SYM_FULLER); /* expecting a failure message */ STAP_RETURN(); } - unsigned saved_pc = REG_IP(CONTEXT->uregs); - unsigned saved_sp = REG_SP(CONTEXT->uregs); + saved_pc = REG_IP(CONTEXT->uregs); + saved_sp = REG_SP(CONTEXT->uregs); REG_IP(CONTEXT->uregs) = STAP_ARG_pc; REG_SP(CONTEXT->uregs) = STAP_ARG_sp;