Bug 2913 - translator can't parse "$var->function"
Summary: translator can't parse "$var->function"
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P3 minor
Target Milestone: ---
Assignee: David Smith
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-13 12:33 UTC by Masami Hiramatsu
Modified: 2006-07-13 20:47 UTC (History)
0 users

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


Attachments
patch to fix issue (737 bytes, patch)
2006-07-13 20:33 UTC, David Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masami Hiramatsu 2006-07-13 12:33:21 UTC
I found that stap can't parse the member of kernel structure if its name is
"function".
ex)
----
probe kernel.function("add_timer_on") {
    printf("%x\n", $timer->function)
}
----
This script causes perse errors.
Comment 1 Frank Ch. Eigler 2006-07-13 12:40:50 UTC
The problem is with line 2165 in src/parser.cxx.  It uses "expect_ident()" to
fetch a piece of the target symbol expression, but since a few months ago,
"function" is lexed as a tok_keyword, not an tok_identifier.  The parser::expect
routines need to be slightly tweaked to accept this possibility.
Comment 2 David Smith 2006-07-13 20:33:31 UTC
Created attachment 1161 [details]
patch to fix issue

This patch fixes the issue by allowing keywords (such as 'function') to appear
in target symbol dereferences.
Comment 3 David Smith 2006-07-13 20:47:18 UTC
The patch should fix this issue.