[Soot-list] About how to get the source code line number

Eric Bodden eric.bodden at mail.mcgill.ca
Tue Sep 30 18:04:05 EDT 2008


Your implementation of "RunVeryBusyAnalysis" needs to set the
-keep-line-number flag. The easiest way to do so is to call...

		Options.v().set_keep_line_number(true);

... in your main method.

Also another side note: You can just get the line number from the tag
by calling...

				    if (tag instanceof LineNumberTag) {
					    LineNumberTag lineNumberTag = (LineNumberTag) tag;
					    lineNumberTag.getLineNumber()

... no need for bit-shifting!

You should invoke the whole lot as follows...

javac -g VeryBusyClass.java

javac -classpath
jasminclasses-2.3.0.jar;polyglotclasses-1.3.5.jar;sootclasses-2.3.0.jar;.
RunVeryBusyAnalysis.java

java -cp
jasminclasses-2.3.0.jar;polyglotclasses-1.3.5.jar;sootclasses-2.3.0.jar;.
RunVeryBusyAnalysis

(I think actually you can omit the -g in the call to javac, as this
flag is enabled by default.)

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list