<using plugin="plugin-duplicate" />
<output>
In entry advice: Before distributor (line 12)
+ In distributor: 5
In entry advice: Zero (line 12)
In bar advice!
In bar: 10!
In exit advice: Zero
In entry advice: Before distributor (line 12)
+ In distributor: 6
In entry advice: One (line 12)
In assign advice!
In assign advice!
In exit advice: One
</output>
<prototypes>
- int _distrib();
+ int _distrib(ALL_SIGNED_T);
void _assign_advice();
void _bar_advice();
void _entry_advice(signed char *, int32_t);
static void plugin_join_on_entry(struct aop_joinpoint *jp, void *data)
{
- const char *name;
+ struct aop_dynval *param;
- name = aop_get_function_name();
- if (name != NULL && strcmp(name, "foo") == 0) {
- aop_duplicate(jp, "_distrib", AOP_TERM_ARG);
- duplicated = 1;
- }
- else {
- duplicated = 0;
- }
+ param = aop_capture_in_param(jp, 0);
+ aop_duplicate(jp, "_distrib", AOP_DYNVAL(param), AOP_TERM_ARG);
+ duplicated = 1;
}
static void plugin_join_on_bar(struct aop_joinpoint *jp, void *data)
{
struct aop_pointcut *pc;
+ duplicated = 0;
pc = aop_match_function_entry();
+ aop_filter_entry_by_name(pc, "foo");
+ aop_filter_by_in_param(pc, 0, aop_t_all_signed());
aop_join_on(pc, plugin_join_on_entry, NULL);
if (duplicated) {