Re: [abc-users] Re: XML attributes in a reweaving analysis

From: Eric Bodden <eric.bodden_at_mail.mcgill.ca>
Date: Thu, 21 May 2009 11:12:27 -0400

Hi Nathan.

Interesting question. Would be nice to see this working... I am not
quite sure about the exception that you are seeing but I think I have
an explanation for why your tags get lost on the way. The problem is
that after you added the tags in your reweaving analysis, abc will (1)
replace all method bodies with the bodies that existed before weaving
and then (2) do the weaving over again. As you can imagine, (1) also
removes your tags.

There is however a way to work around this. The method
abc.weaving.weaver.Weaver.reverseRebind(Object) gives you for every
unit, trap or local that you "see" in the reweaving analysis the
corresponding unit, trap or local that you had before weaving (except
for those units, traps or local that were introduced through the
weaving process, of course). When you attach your tags to those units
instead then I believe that abc should preserve them.

Hope that helps,
Eric

2009/5/21 Nathan Weston <npweston_at_gmail.com>:
> Apologies, I should have said I'm using Eclipse 3.4.2, Soot Plugin 2.3.0 and
> abc 1.3.0.
>
> Thanks,
> Nathan
>
> Nathan Weston wrote:
>>
>> Hello all,
>>
>> I've implemented a new reweaving analysis which I've hooked in to abc as a
>> new reweaving pass.  All seems to work well except that I'd like it to
>> integrate with the Soot Eclipse plugin by providing visualisations in terms
>> of Color and Link Tags.  In my reweaving pass I add these tags to Units in
>> the method bodies, and I've added the Soot arguments "-xml-attributes" and
>> "-f J".
>>
>> The XML files get generated and placed in an attributes folder under
>> sootOutput in the appropriate project folder.  However, these XML files do
>> not contain the Link and Color tags I've added, though they do contain
>> InPreinitializationTags.    As well as this, trying to load the Jimple in
>> Eclipse throws the following exception:
>>
>> java.lang.NullPointerException
>>    at
>> ca.mcgill.sable.soot.attributes.AttributeDomProcessor.processNode(AttributeDomProcessor.java:55)
>>    at
>> ca.mcgill.sable.soot.attributes.AttributeDomProcessor.processAttributesDom(AttributeDomProcessor.java:48)
>>    at
>> ca.mcgill.sable.soot.attributes.SootAttributeFilesReader.readFile(SootAttributeFilesReader.java:48)
>>    at
>> ca.mcgill.sable.soot.attributes.AbstractAttributesComputer.computeAttributes(AbstractAttributesComputer.java:80)
>>    at
>> ca.mcgill.sable.soot.attributes.AbstractAttributesComputer.getHandler(AbstractAttributesComputer.java:129)
>>    at
>> ca.mcgill.sable.soot.attributes.AbstractAttributesComputer.getAttributesHandler(AbstractAttributesComputer.java:101)
>>    at
>> ca.mcgill.sable.soot.resources.SootPartManager.updatePart(SootPartManager.java:51)
>>    at
>> ca.mcgill.sable.soot.resources.EditorActivationListener.partActivated(EditorActivationListener.java:45)
>>    at
>> org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72)
>>    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>    at org.eclipse.core.runtime.Platform.run(Platform.java:880)
>>    ... lots more
>>
>> Any help as to where I'm going wrong would be greatly appreciated!
>> nathan
>
>

-- 
Eric Bodden
Sable Research Group, McGill University
Montréal, Québec, Canada
Received on Thu May 21 2009 - 16:12:30 BST

This archive was generated by hypermail 2.2.0 : Thu May 28 2009 - 10:50:12 BST