Bug #3131
closed
Wrong handling of function-like non-argument macros
Added by Denis Efremov over 12 years ago.
Updated almost 12 years ago.
Description
Aspectator doesn't support function-like macros without arguments as join points (or [primitive] pointcuts). But sometimes this feature is needed. For example, if we want to create kernel configuration invariant rule, we should create two types of aspects( on function and on macros ) in the following case:
include/linux/cpu.h-165:#ifdef CONFIG_HOTPLUG_CPU
include/linux/cpu.h:168:extern void get_online_cpus(void);
include/linux/cpu.h-169:extern void put_online_cpus(void);
include/linux/cpu.h-188:#else /* CONFIG_HOTPLUG_CPU */
include/linux/cpu.h:190:#define get_online_cpus() do { } while (0)
include/linux/cpu.h-191:#define put_online_cpus() do { } while (0)
Aspect (model0115_1a-blast.aspect):
8:after: call( void get_online_cpus(..) )
503:around: define( get_online_cpus() )
Error:
model0115_1a-blast.aspect:503.33-503.33: aspect file processed has incorrect syntax
cc1: fatal error: terminate work after syntax error happened
compilation terminated.
Aspectator fails on the 1st stage
- Category set to 15
- Status changed from New to Open
- Assignee set to Evgeny Novikov
- Priority changed from Normal to High
I guess that the issue hasn't a workaround, so, I raise its priority. But it isn't very important nevertheless, since such macros aren't used widely.
Several notes:
- At present http://forge.ispras.ru/projects/cif is a more appropriate place for Aspectator's bugs and feature requests.
- "Aspectator can't create aspects for function-like macros without arguments" should be formulated like "Aspectator doesn't support function-like macros without arguments as join points (or [primitive] pointcuts)" (of course, this is our lack, since we don't provide any well-written documentation on Aspectator).
- There is a special pre tags that would be nice to be used while formatting code fragments (http://forge.ispras.ru/help/wiki_syntax_detailed.html).
- Description updated (diff)
Thank you one more time for careful bug formulating. Just one note (the reason is that there is not documentation...). You don't need to write each time join points (or [primitive] pointcuts). When I have written this I just meant that either some kind of join points or some kind of pointcuts isn't supported. Join points are points in a program source code some of which can be instrumented. Pointcuts join one or more join points. Primitive pointcuts are relevant to specific constructions (like a macro definition or a function call). So, one can say that either some join points, or pointcuts, or primitive pointcuts aren't supported.
- Priority changed from High to Urgent
Just want to note, that if one changes a priority of bug or feature request, he or she should explain the reason of this change. Often we forget about this. But this time it's worth noticing the change is due to 3 rule models require this feature to be implemented. Also you can find section "Related issues" and fill it (e.g. make this issue blocker of corresponding rule issues).
- Status changed from Open to Resolved
Fixed in commit e323e50 of the master branch and tested now. Wait for 20-30 minutes.
Small tests passed successfully. Denis, please try to use this new pointcut and close the issue if you will find it to work well.
- Project changed from Linux Driver Verification to C Instrumentation Framework
- Category deleted (
15)
- Status changed from Resolved to Closed
I hope that it does can be closed.
Also available in: Atom
PDF