> > I've lost track a bit here. You want to use Dehydra with C, in 'gcc',
> > right? cp-lang.c is only a part of C++, as is global_namespace. So if
> > you are using C only, then you will never have any value for
> > global_namespace, so it should just always be 0.
>
> Actually I have both - c & c++ codes in use, so I would like to parse
> them all. I've assumed that cp-lang.c is responsible for C & C++. But
> apparently
> it is not. Tried also to compile c++ code, with the same result - cp_init_ts
> does
> not gets called.
> Will try to search some other initialization function in c/c++
> frontend.
Sorry , my mistake. cp/cp-lang.c/cp_init_ts do gets called, but - you
were right - only for c++ code.
For c code there exists apparently it's counterbrother - c-lang.c/c-
objc-common.c which posesses similar
init function.
So now I can manage to transfer 'global_namespace' pointer from
gcc(cc1plus) to dehydra plugin.
I haven't yet tested whether it will fully work - but I'm assuming
that exe/dll does not imply any kind
of memory protection - dll can fully access exe's memory space.
I've tried to pick up next next unresolved symbol - 'tree_code_type',
and find out that
it comes from tree.h:
extern const enum tree_code_class tree_code_type[];
#define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)]
However - there are mutiple declarations of tree_code_type arrays -
front end specific.
(c has it's own, c++ has it's own, java has it's own and so on.)
Now I'm bit puzzled here - to which array dehydra is linked to out of
them all ?
Is this true: Dehydra can only pick up C++ code, but not C ?
Another question. gcc_plugin_finish_struct according to documentation
finishes some particular structure typedef.
In dehydra_convert2 I did not find any while/for loop - so I assume
that function is being called once per one structure.
I've tried to modify function to simply print structure name being
defined -
void gcc_plugin_finish_struct (tree t) {
tree type_decl = TYPE_NAME (t);
printf("Type '%s' declaration\n",
IDENTIFIER_POINTER(DECL_NAME(type_decl)) );
}
but no matter what typedef's I have in code - I'm getting only one
print out:
Type '$_1' declaration
which does not even corresponds to actual type name.
Suggestions ?
_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis