Hello Julia,
On 01/08/2010 07:22 AM, Julia Lawall wrote:
On Fri, 8 Jan 2010, Michael Stefaniuc wrote:
I'm trying to get some infos out of the Wine source code; the attached
SmPL works but the channel rule matches code that it shouldn't and thus
the python rule will print out a second copy of the info with some wrong
info in it. With the minimal test case (attached too) I'm getting the
following output:
/tmp/declare.c:6:foo:fixme:ole:"unimplemented function\n"
/tmp/declare.c:6:foo:fixme:typelib:"unimplemented function\n"
The first line is correct but the second isn't. Not sure why but
WINE_DEFAULT_DEBUG_CHANNEL seems to be identical to
WINE_DECLARE_DEBUG_CHANNEL for coccinelle. A run with -debug shows:
There are two things for declarer:
declarer x;
which declares a metavariable that matches a declarer and
declarer name x;
which indicates that the SmPL code you write that looks like a function
calll should match declarers instead. The same two forms exist for
iterators. So just change your declarer to declarer name and everything
will be fine.
thanks, that one works.
Declarer name is a bit recent, so the documentation might be out of date.
We will look into that.
I'm following coccinelle for a while (got hooked by Val Aurora's article
on LWN). When I wrote the cocci file I remembered to have seen something
about a declarer that looks like a function call. That's why I added
"declarer WINE_DEFAULT_DEBUG_CHANNEL" when the simple rule
@ channel @
identifier ch;
@@
WINE_DEFAULT_DEBUG_CHANNEL(ch);
failed to match. As the files I was testing it with didn't have a
WINE_DECLARE_DEBUG_CHANNEL() and thus worked I thought I had picked the
right solution.
thanks again.
bye
michael
dependencies for rule channel satisfied:
binding in = []
binding relevant in = []
transformation info is empty
binding out = [ch --> id ole]
transformation info is empty
binding out = [ch --> id typelib]
I tried different tricks like "disable all" in the channel rule or using
a macro file with either of:
#define WINE_DECLARE_DEBUG_CHANNEL
#define WINE_DECLARE_DEBUG_CHANNEL(x)
#define WINE_DECLARE_DEBUG_CHANNEL(x) x
but none had any effect whatsoever; i was still getting the same wrong
output.
This is with coccinelle 0.2.0rc1. Of course I can post process the data
and drop the wrong info but that would be a hack-job. Any hint on how
to properly fix the issue?
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)