Bug #3208
closed
Macros with a variable number of arguments support
Added by Denis Efremov over 12 years ago.
Updated almost 12 years ago.
Published in build:
b503ab3
Description
Aspectator doesn't support macros with a variable number of arguments as join points (or [primitive] pointcuts).
Examples of macros:
#define info(format, args...) pr_info(format, args)
#define dbg(format, ...) pr_debug(format, ## VA_ARGS)
- Status changed from New to Open
- Priority changed from Normal to High
Thank you for your report. The bug is related with incomplete macros processing in aspect parser like #3131. In fact grammar rules for macros processing is so:
primitive_pointcut_signature_macro: LDV_ID | LDV_ID '(' macro_param ')'
macro_param: LDV_ID | macro_param ',' LDV_ID
Most likely I have implemented them without respect to the C grammar that describes the following rules (I have omitted some of them):
control-line:
# define identifier replacement-list new-line
# define identifier lparen identifier-listopt ) replacement-list new-line
# define identifier lparen ... ) replacement-list new-line
# define identifier lparen identifier-list , ... ) replacement-list new-line
text-line: pp-tokensopt new-line
non-directive: pp-tokens new-line
lparen: a ( character not immediately preceded by white-space
replacement-list: pp-tokensopt
pp-tokens:
preprocessing-token
pp-tokens preprocessing-token
new-line: the new-line character
How many rules/advices cannot be written because of this drawback?
- Status changed from Open to Resolved
- Published in build set to 97616c6
Fixed in commit 97616c6 of the master branch. Waiting while tests finish. Close it if it will work for you.
Still fails on such input:
around: define( printf(args...) )
{
({ check_in_interrupt(); 0; })
}
Denis Efremov wrote:
Still fails on such input:
around: define( printf(args...) )
{
({ check_in_interrupt(); 0; })
}
Try this one:
around: define( printf(args, ...) )
{
({ check_in_interrupt(); 0; })
}
- Status changed from Resolved to Open
It looks like a GCC extension, thus, it should be implemented accordingly. Sorry, that I have missed this from your description.
- Status changed from Open to Resolved
- Published in build changed from 97616c6 to cc8018c
Finally fixed in commit cc8018c of the master branch. Will be available after testing. Close if it will work for you.
Still fails on such input:
around: define( printf(level,args...) )
{
({ check_in_interrupt(); 0; })
}
- Status changed from Resolved to Open
Therefore I have to fix it again.
- Status changed from Open to Resolved
- Published in build changed from cc8018c to b503ab3
Commit b503ab3 eventually has fixed the issue. Because of corresponding aspectator change isn't critical (just added one more branch of macro signatures processing) I will skip thorough testing this time.
Denis, please, test the fix and close the bug if all is okay.
- Status changed from Resolved to Closed
I hope that it does can be closed.
Also available in: Atom
PDF