[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spark: getting field-access summaries



Spark doesn't keep such a summary, so you'll have to build one yourself.
It shouldn't be too hard, though. For each method that you're interested
in:
1) Get its body with getActiveBody()
2) Get the List of the body's def boxes with body.getDefBoxes()
3) Iterate through it. Each element is a ValueBox. Get its value, and
see if it's a StaticFieldRef.
4) Do the same for body.getUseBoxes() (UseBoxes give values read;
DefBoxes give values written)

Ondrej

On Tue, Apr 22, 2003 at 04:30:58PM +0200, Richard Stahl wrote:
> Hello,
> 
> I would like to get the following info out of the Spark:
> 
> for all class fields of a class (classes) get all methods (and/or basic 
> blocks) acccessing (reading and/or writing) the field, i.e., 
> field-access summaries.
> 
> In case, there is not simple and straightforward way to do this: Could 
> you, please, give me an advice (opinion) on where to start and what to 
> use (from the SOOT/Spark API) to get this info in an efficient way?
> 
> Thanks a lot.
> 
> Best regards,
> 
> Richard
>