Bug #3208
closedMacros with a variable number of arguments support
0%
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)
Updated by Evgeny Novikov over 12 years ago
- 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
Updated by Evgeny Novikov over 12 years ago
How many rules/advices cannot be written because of this drawback?
Updated by Evgeny Novikov over 12 years ago
- 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.
Updated by Denis Efremov over 12 years ago
Still fails on such input:
around: define( printf(args...) )
{
({ check_in_interrupt(); 0; })
}
Updated by Evgeny Novikov over 12 years ago
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; }) }
Updated by Denis Efremov over 12 years ago
The latter works, but these macros are not equal. If someone want them to be equal, he should write printf(...) instead printf(args, ...).
Example of such form of macro http://lxr.linux.no/#linux+v3.4.6/fs/bfs/bfs.h#L44
Updated by Evgeny Novikov over 12 years ago
- 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.
Updated by Evgeny Novikov over 12 years ago
- 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.
Updated by Denis Efremov over 12 years ago
Still fails on such input:
around: define( printf(level,args...) ) { ({ check_in_interrupt(); 0; }) }
Updated by Evgeny Novikov about 12 years ago
- Status changed from Resolved to Open
Therefore I have to fix it again.
Updated by Evgeny Novikov about 12 years ago
- 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.
Updated by Evgeny Novikov almost 12 years ago
- Status changed from Resolved to Closed
I hope that it does can be closed.