From 81d2346b1c1bd697307467851f55715d36d0892d Mon Sep 17 00:00:00 2001 From: eteo Date: Tue, 8 Aug 2006 13:11:40 +0000 Subject: 2006-08-08 Eugene Teo * tapset/context.stp (probemod): New function. * stapfuncs.5.in: Document it. * testsuite/buildok/probemod.stp: Test it. --- tapset/context.stp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tapset/context.stp') diff --git a/tapset/context.stp b/tapset/context.stp index 16b176af..7c59b0d6 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -116,6 +116,23 @@ function probefunc:string () %{ /* pure */ } %} +function probemod:string () %{ /* pure */ + char *ptr, *start; + + start = strstr(CONTEXT->probe_point, "module(\""); + ptr = start + 8; + + if (start) { + int len = MAXSTRINGLEN; + char *dst = THIS->__retvalue; + while (*ptr != '"' && --len && *ptr) + *dst++ = *ptr++; + *dst = 0; + } else { + THIS->__retvalue[0] = '\0'; + } +%} + function is_return:long () %{ /* pure */ char *ptr = strrchr(CONTEXT->probe_point, '.'); if (ptr) { -- cgit