[Soot-list] Determine a field's main class

Cheng Zhang cheng.zhang.stap at gmail.com
Tue Apr 26 12:53:49 EDT 2011


Hi, Vasco,

Does JInstanceFieldRef.getField().getDeclaringClass() work in your case?

Best,

Cheng

On Wed, Apr 27, 2011 at 12:09 AM, Vasco Pessanha <coreanu_ at hotmail.com> wrote:
> Hi,
>
> I am using Soot to collect all the class fields accessed in a program. For
> each one, I keep the main class of the field and its name.
> For instances, "<Pair, x>" refers to the field "x" of class "Pair".
>
> The problem is, if I have an abstract class "A" that has a field "f", and
> another class "B" that extends "A", then I can have accesses to "f" in both
> classes. Therefore, since I am deducing the main class with the class where
> the access is made, we will generate "<A, f>" and "<B, f>" fields, despite
> they are the same.
>
> Can anyone help me to determine which is the main class of a given field
> (JInstanceFieldRef)? In the previous case would be "A"..
>
> Thanks,
>
> Vasco Pessanha
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


More information about the Soot-list mailing list