diff options
-rw-r--r-- | tapset/ChangeLog | 6 | ||||
-rw-r--r-- | tapset/context.stp | 25 |
2 files changed, 31 insertions, 0 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 0313e589..fdfc3bc1 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,9 @@ +2006-01-30 Martin Hunt <hunt@redhat.com> + + * context.stp (probefunc): New function. + (is_return): New function. + (returnval): New function. + 2006-01-15 Frank Ch. Eigler <fche@elastic.org> * logging.stp: Revert. diff --git a/tapset/context.stp b/tapset/context.stp index 4ba9dfb2..3056ed18 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -84,7 +84,32 @@ function pp:string () %{ strlcpy (THIS->__retvalue, CONTEXT->probe_point, MAXSTRINGLEN); %} +function probefunc:string () %{ + char *start = strstr(CONTEXT->probe_point, "function(\""); + if (start) { + char *ptr = start+10; + char *dst = THIS->__retvalue; + int len = MAXSTRINGLEN; + while (*ptr != '@' && --len > 0 && *ptr) + *dst++ = *ptr++; + *dst = 0; + } +%} + +function is_return:long () %{ + char *ptr = strrchr(CONTEXT->probe_point, '.'); + if (ptr) { + if (strcmp(ptr+1,"return") == 0) + THIS->__retvalue = 1; + } +%} + function target:long () %{ THIS->__retvalue = _stp_target; %} +function returnval:long () %{ + if (CONTEXT->regs) { + THIS->__retvalue = dwarf_register_0(CONTEXT->regs); + } +%} |