[CTRACER]: Emit forward declarations for the return and parameter types

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-12-20 14:27:28 -02:00
parent 973d243189
commit b3dab6396c
1 changed files with 18 additions and 1 deletions

View File

@ -45,6 +45,21 @@ static int cu_find_methods_iterator(struct cu *cu, void *cookie)
function__filter);
}
static int function__fwd_decl(const struct function *self)
{
struct parameter *pos;
/* First check the function return type */
int printed = tag__fwd_decl(self->cu, &self->tag);
/* Then its parameters */
list_for_each_entry(pos, &self->parameters, tag.node)
if (tag__fwd_decl(self->cu, &pos->tag))
printed = 1;
if (printed)
putchar('\n');
}
static int function__emit_kprobes(const struct function *self,
const struct class *target)
{
@ -97,8 +112,10 @@ static int cu_emit_kprobes_iterator(struct cu *cu, void *cookie)
struct class *target = cu__find_class_by_name(cu, cookie);
struct function *pos;
list_for_each_entry(pos, &cu->tool_list, tool_node)
list_for_each_entry(pos, &cu->tool_list, tool_node) {
function__fwd_decl(pos);
function__emit_kprobes(pos, target);
}
return 0;
}