diff options
Diffstat (limited to 'tapset/ucontext-symbols.stp')
-rw-r--r-- | tapset/ucontext-symbols.stp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tapset/ucontext-symbols.stp b/tapset/ucontext-symbols.stp index 3813a8bf..2e7ad25b 100644 --- a/tapset/ucontext-symbols.stp +++ b/tapset/ucontext-symbols.stp @@ -50,3 +50,26 @@ function usymdata:string (addr: long) %{ /* pure */ _stp_symbol_snprint(THIS->__retvalue, MAXSTRINGLEN, THIS->addr, current, 1); %} + +/** + * sfunction print_ustack - Print out stack for the current task from string. + * @stk: String with list of hexidecimal addresses for the current task. + * + * Perform a symbolic lookup of the addresses in the given string, + * which is assumed to be the result of a prior call to + * <command>ubacktrace()</command> for the current task. + * + * Print one line per address, including the address, the + * name of the function containing the address, and an estimate of + * its position within that function. Return nothing. + */ +function print_ustack(stk:string) %{ + char *ptr = THIS->stk; + char *tok = strsep(&ptr, " "); + while (tok && *tok) { + _stp_print_char(' '); + _stp_usymbol_print (simple_strtol(tok, NULL, 16), current); + _stp_print_char('\n'); + tok = strsep(&ptr, " "); + } +%} |