[Soot-list] NullPointerColourer (Eclipse 3.4.1, Soot 2.3.0)

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Dec 3 15:21:18 EST 2008


I found the cause of this:

The new JastAdd based Java 5 frontend for Soot fails to add source
position tags to ValueBoxes. It only add these tags to entire
statements. The NullPointerColorer attaches the ColorTags to
ValueBoxes (because statement-level information is not precise
enough). Because these ValueBoxes have no line-number information, you
end up getting 0 in your XML file.

This should be fixed in the JastAdd frontend. Up until then you can
just enable the polyglot-based frontend instead (in Soot's input
options). This will show you the color tags. Note though, that this
will not let you process Java 5 source code.

Eric

2008/12/1  <jg205 at doc.ic.ac.uk>:
> Thanks for the reply Eric!
>
> To run the analysis, I am using the eclipse plugin and selecting the Soot ->
> Process Source File -> Run Soot option on the NullPointerClass I included
> below. This has the "-src-prec java" command set. The actual command that is
> executed is:
>
> "soot.Main --f J --p jap.npcolorer enabled:true --d
> /homes/jg205/Project/workspace/NullPointerColourerTest/sootOutput --cp ...
> --keep-line-number --xml-attributes --src-prec java NullPointerClass" I did
> not include the actual classpath as it's really long!
>
> I appear to get the correct String annotations - i.e. hovering over the
> variables gives the correct null, non-null information... just the colours
> aren't there :(
>
> Any ideas?
>
> Thanks
> Jack
>
> On Mon, 1 Dec 2008, Eric Bodden wrote:
>
>> Jack, I think you may have to process the source code with Soot. It's
>> not enough to have the source on your classpath.
>>
>> You can use "-src-prec java" to make sure that Soot loads your code
>> from source. See
>> http://www.sable.mcgill.ca/soot/tutorial/usage/index.html
>>
>> Eric
>>
>> 2008/12/1 Jack Griffith <jg205 at doc.ic.ac.uk>:
>>>
>>> Hi,
>>>
>>> I am trying to run the NullPointerColourer analysis that comes with Soot
>>> but I only seem to be getting coloured results in the
>>> corresponding .jimple file. The .java file I am running the analysis on
>>> is not coloured! :(
>>>
>>> I've done some searching, and all I could find was that this was a
>>> symptom of soot now knowing where the source files are. But, the
>>> directory is in the classpath.
>>> "...:<secret>/workspace/NullPointerColourerTest/src:..." is part of it,
>>> unless I'm being dumb this is what should be there?? I have one class in
>>> the src folder, i.e.:
>>>
>>> public class NullPointerClass
>>> {
>>>   public static void main(String[] args)
>>>   {
>>>       String s = null;
>>>       String t = "Hello";
>>>
>>>       if (s != null)
>>>           System.out.println(s);
>>>
>>>       if (t != null)
>>>           System.out.println(t);
>>>   }
>>> }
>>>
>>> The .xml file that is produced as output contains 0 values for spos,
>>> which I am led to believe is a symptom of soot not being able to find
>>> this source file (as stated in this thread -
>>> http://www.sable.mcgill.ca/pipermail/soot-list/2007-June/001257.html
>>>
>>> But I don't think this is my problem.
>>>
>>> Any help would be greatly appreciated!
>>>
>>> Thanks
>>> Jack
>>>
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>
>>
>>
>>
>> --
>> Eric Bodden
>> Sable Research Group, McGill University, MontrÃÂ(c)al, Canada
>> Got an interesting job offer? http://www.bodden.de/hire-me/
>>
>
>



-- 
Eric Bodden
Sable Research Group, McGill University, Montréal, Canada
Got an interesting job offer? http://www.bodden.de/hire-me/


More information about the Soot-list mailing list