[Soot-list] accessing basic blocks

Richard L. Halpert richhal22 at gmail.com
Wed Apr 19 20:04:54 EDT 2006


Kevin,
There are several ways you could do this, but I think what you're looking
for is a BodyTransformer (you do intend to add/remove/tag/annotate
statements, right?).  You should extend the BodyTransformer class, and
override the internalTransform method.  Within your internalTranform method,
you can construct a BriefBlockGraph which will accept a Body object as an
argument, which you have on hand since it is a parameter to
internalTransform.  You can also construct an ExceptionalBlockGraph in the
same manner if you wish to include exceptional control flow in your CFG.
BlockGraph itself is merely an abstract base class.

-Richard

On 4/19/06, kevin <kdean1 at gmu.edu> wrote:
>
>  Hello,
>
>
>
> I am a new soot user and am trying to use soot to perform some simple
> profiling on basic blocks. I have an algorithm which basically monitors the
> basic blocks of a program and creates a "hot subpath list" (ie. The most
> frequently accessed paths). However, I am having major problems in finding
> out how to access the basic blocks using soot. I noticed in the API that
> there is a BlockGraph class which accepts a Unitgraph. But I am not sure how
> to access this. Do I need to do this in a BodyTransformer? Or in a
> SceneTransformer? Or neither? I went through all the tutorials and have dug
> through the archives of the mailing list but could not find much information
> regarding this. I would greatly appreciate any help in how to do this.
> Thanks for your time.
>
>
>
> Kevin
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060420/31ac2a53/attachment.htm


More information about the Soot-list mailing list