Bug 11713 - listing of available $variables should include $
Summary: listing of available $variables should include $
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-17 14:37 UTC by Frank Ch. Eigler
Modified: 2010-06-22 13:05 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
patch (240 bytes, patch)
2010-06-18 03:14 UTC, Wenji Huang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2010-06-17 14:37:32 UTC
% stap -L 'kernel.function("sys_open")'
kernel.function("sys_open@fs/open.c:1050") $filename:char const* $flags:int
$mode:int $ret:long int

properly adds $ to the available $context variables being listed, but in
error messages, we don't decorate the variables that way.

% stap -p2 -e 'probe kernel.function("sys_open") {println($foo)}'
semantic error: unable to find local 'foo' near pc 0xffffffff810e1df7 in
sys_open(fs/open.c) (alternatives: filename flags mode ret): identifier '$foo'
at <input>:1:44
Comment 1 Wenji Huang 2010-06-18 03:14:43 UTC
Created attachment 4844 [details]
patch

With this patch, the following message will be displayed,

$ ./stap -e 'probe kernel.function("sys_open"){print($foo)}'semantic error:
unable to find local 'foo' near pc 0xc04cf156 in sys_open(fs/open.c)
(alternatives: $filename $flags $mode $ret): identifier '$foo' at <input>:1:41
	source: probe kernel.function("sys_open"){print($foo)}
							^
Pass 2: analysis failed.  Try again with another '--vp 01' option.
Comment 2 Frank Ch. Eigler 2010-06-18 10:59:40 UTC
(In reply to comment #1)
> Created an attachment (id=4844)

Thanks.  I suspect there are a few other analogous places in the code.
Comment 3 Wenji Huang 2010-06-21 06:32:59 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Created an attachment (id=4844)
> 
> Thanks.  I suspect there are a few other analogous places in the code.
> 
Seems the patch is enough, It's hard-coded like $arg, $value for other probe types.
Comment 4 Wenji Huang 2010-06-22 08:56:47 UTC
commit 4ca5acc84095c947c2dfade905b8eab5a7433961
Author: Wenji Huang <wenji.huang@oracle.com>
Date:   Tue Jun 22 10:43:35 2010 +0800

    PR11713: listing available variable with leading '$'
    
    * dwflpp.cxx(dwflpp::print_locals): Add '$' to name.
Comment 5 Frank Ch. Eigler 2010-06-22 13:05:38 UTC
thanks