summaryrefslogtreecommitdiffstats
path: root/tapset/ucontext-symbols.stp
diff options
context:
space:
mode:
Diffstat (limited to 'tapset/ucontext-symbols.stp')
-rw-r--r--tapset/ucontext-symbols.stp27
1 files changed, 25 insertions, 2 deletions
diff --git a/tapset/ucontext-symbols.stp b/tapset/ucontext-symbols.stp
index 3813a8bf..5502f5cd 100644
--- a/tapset/ucontext-symbols.stp
+++ b/tapset/ucontext-symbols.stp
@@ -23,7 +23,7 @@
%}
/**
- * sfunction usymname - Return the symbol of an address in the current task.
+ * sfunction usymname - Return the symbol of an address in the current task. EXPERIMENTAL!
* @addr: The address to translate.
*
* Description: Returns the (function) symbol name associated with the
@@ -36,7 +36,7 @@ function usymname:string (addr: long) %{ /* pure */
%}
/**
- * sfunction usymdata - Return the symbol and module offset of an address.
+ * sfunction usymdata - Return the symbol and module offset of an address. EXPERIMENTAL!
* @addr: The address to translate.
*
* Description: Returns the (function) symbol name associated with the
@@ -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. EXPERIMENTAL!
+ * @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, " ");
+ }
+%}