diff options
Diffstat (limited to 'tapset/context.stp')
-rw-r--r-- | tapset/context.stp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/tapset/context.stp b/tapset/context.stp index 9a46df19..0565d1b7 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -1,5 +1,6 @@ // context tapset // Copyright (C) 2005, 2006 Red Hat Inc. +// Copyright (C) 2006 Intel Corporation. // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General @@ -89,9 +90,7 @@ function pp:string () %{ /* pure */ %} function probefunc:string () %{ /* pure */ - char *dst, *ptr, *start; - String str; - int len = MAXSTRINGLEN; + char *ptr, *start; start = strstr(CONTEXT->probe_point, "function(\""); ptr = start + 10; @@ -99,28 +98,21 @@ function probefunc:string () %{ /* pure */ start = strstr(CONTEXT->probe_point, "inline(\""); ptr = start + 8; } + if (start) { - dst = THIS->__retvalue; + int len = MAXSTRINGLEN; + char *dst = THIS->__retvalue; while (*ptr != '@' && --len > 0 && *ptr) *dst++ = *ptr++; *dst = 0; + } else if (CONTEXT->regs) { - str = _stp_string_init (0); - _stp_symbol_sprint(str, REG_IP(CONTEXT->regs)); - start = strstr(_stp_string_ptr(str), " : "); - if (start) { - dst = THIS->__retvalue; - ptr = start+3; - while (*ptr != '+' && --len > 0 && *ptr) - *dst++ = *ptr++; - *dst = 0; - } - else { - strlcpy(THIS->__retvalue, _stp_string_ptr(str),MAXSTRINGLEN); - } + _stp_symbol_sprint_basic(THIS->__retvalue, MAXSTRINGLEN, + REG_IP(CONTEXT->regs)); + } else { - THIS->__retvalue[0] = '\0'; - } + THIS->__retvalue[0] = '\0'; + } %} function is_return:long () %{ /* pure */ |