Skip to content

Commit

Permalink
Allow graph printing and JAR output
Browse files Browse the repository at this point in the history
When Soot was set to output to a jar and graphs were to be printed
simultaneously, only one would happen due to a naming conflict.
  • Loading branch information
tim-hoffman committed Jul 7, 2015
1 parent 62cbafe commit e621a36
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/soot/util/PhaseDumper.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ private static java.io.File makeDirectoryIfMissing(Body b)
throws java.io.IOException {
StringBuffer buf =
new StringBuffer(soot.SourceLocator.v().getOutputDir());

//If the options specify that the output directory should be a jar, we
// must use a different directory for the graphs
if(Options.v().output_jar()){
if(buf.toString().endsWith(".jar")){
buf.delete(buf.length()-4, buf.length());
}
buf.append(".graphs");
}

buf.append(File.separatorChar);
String className = b.getMethod().getDeclaringClass().getName();
buf.append(className);
Expand Down

0 comments on commit e621a36

Please sign in to comment.