[Soot-list] Process a project using source code
Steven Arzt
Steven.Arzt at cased.de
Tue Sep 8 02:44:01 EDT 2015
Hi Chris,
Soot uses the same location conventions as the JVM. If your class is called “a.b.foo”, Soot expects a directory on your process-dir or classpath that contains a file “a/b/foo.java” if you’re using source, or “a/b/foo.class” if you’re loading class files. I don’t know the project structure of Apache Mahout, but the second option you mentioned looks better to me (assuming that the proper directory structure exists within the “java” folder).
Soot’s error message just tells you that it can’t find a particular Java class. This has nothing to do with your source file type, it just refers to classes as Java concepts (as opposed to, e.g., methods).
Dependencies can be an issue. You can either make sure that all your dependencies are on your Soot classpath, or you can use the –allow-phantom-refs option which will make Soot skip over classes it cannot find. In practice, having these phantom classes is not a big problem once you got used to them. Just keep in mind that these are black holes to your analysis.
Best regards,
Steven
Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von csytang
Gesendet: Montag, 7. September 2015 12:33
An: Soot list
Betreff: [Soot-list] Process a project using source code
Hi all,
I use Soot to process a project, let's say Apache Mahout. I got stuck in selecting the correct file path.
First, I have the compiled class files, the only reason that I start from source code is I want to obtain the location tag. If we start from class files,we only locate to source line instead of a position. right?
* CASE 1 [indirect file path(project directory)]
I use the following, set the directory to project directory, it requires .class files
-src-prec java -cp "my libraries" -process-dir "/Downloads/mahout/" -f none
The error message goes like:
java.lang.RuntimeException: Error: couldn't find class: examples.src.main.java.org.apache.mahout.cf.taste.example.bookcrossing.BookCrossingBooleanRecommender are the packages set properly?
I am a bit of confused that I start from .java, how can I have the .class files?
* CASE 2 [use a specific directory]
If I use a specific direcotry
-src-prec java -cp "my libraries" -process-dir "/Downloads/mahout/mr/src/main/java" -f none
It can process the source, but it got exception, due to lack of dependency.
Thus, how to set the path, if I want to process the whole project. Thanks in advance.
Best
Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150908/01a1a09f/attachment-0001.html
More information about the Soot-list
mailing list