On 12/25/2011 7:17 PM, David Narvaez wrote:
Hi,
I'm trying to use Dehydra to analyze all calls to a method of class A
when those are done from a pointer to a class B that derives from A.
That is, I have
class A
{
public:
void method();
};
class B : public A
{
};
and I'm tryinig to analyze all calls of the type
b->method();
where b is a pointer to B. The problem is that, when I find chained calls like
methoda()->methodb()->method();
where methodb() is supposed to return a pointer to B, the this pointer
of the method call is a pointer to A. I printed the name of the
variable and it was D_52052 which I think is an intermediate variable,
probably initialized as
A* D.52052 = methoda()->methodb()
or something similar. I then though I could keep track of those
declarations and get the real type of the this pointer of the method
call, but I also noticed Dehyra seems to skip these intermediate
statements.
So my concrete question is: is there any way to instruct Dehydra to
include intermediate statements? Or maybe a GCC flag that will let me
see all those details from Dehydra? Does this requiere a deeper hack
in Dehydra in order to get that info?
As I mentioned on irc:
When it comes to function bodies, Dehydra is lossy by design(to reduce
resource usage, script runtimes, etc). It also tries to avoid some of
the implicitly generated parts of the AST.
While you could patch Dehydra to include this particular case, I'm sure
you'd run into other corner cases like this.
Treehydra was designed to give you exact function bodies.
Taras
_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis