We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
By default, the sootup bytecode frontend will output jimple with no type info (for non-arg variables). For example:
{ java.nio.file.Path l1; sun.nio.fs.UnixFileSystemProvider l0; unknown $stack4, $stack5, $stack6, $stack7, l2, l3; l0 := @this: sun.nio.fs.UnixFileSystemProvider; l1 := @parameter0: java.nio.file.Path; l2 = staticinvoke <sun.nio.fs.UnixPath: sun.nio.fs.UnixPath toUnixPath(java.nio.file.Path)>(l1); l3 = staticinvoke <java.lang.System: java.lang.SecurityManager getSecurityManager()>(); if l3 == null goto label1; $stack5 = new java.lang.RuntimePermission; specialinvoke $stack5.<java.lang.RuntimePermission: void <init>(java.lang.String)>("getFileStoreAttributes"); virtualinvoke l3.<java.lang.SecurityManager: void checkPermission(java.security.Permission)>($stack5); virtualinvoke l2.<sun.nio.fs.UnixPath: void checkRead()>(); label1: $stack7 = l0; $stack6 = l2; $stack4 = virtualinvoke $stack7.<sun.nio.fs.UnixFileSystemProvider: java.nio.file.FileStore getFileStore(sun.nio.fs.UnixPath)>($stack6); return $stack4; }
The stack$_ variables has type unknown. I guessed that I should use TypeAssigner body interceptor.
stack$_
unknown
TypeAssigner
I tried
public static void main(String[] args) { JavaView v = createViewForClassPath(javaClassPath); v.configBodyInterceptors((c) -> new ClassLoadingOptions() { @Nonnull @Override public List<BodyInterceptor> getBodyInterceptors() { List<BodyInterceptor> res = new ArrayList<>(); res.add(new CastAndReturnInliner()); res.add(new LocalSplitter()); res.add(new TypeAssigner()); return res; } }); System.out.println(v.getBodyInterceptors()); } private static JavaView createViewForClassPath(String classPath) { JavaProject javaProject = JavaProject.builder(new JavaLanguage(8)) .addInputLocation( new JavaClassPathAnalysisInputLocation( System.getProperty("java.home") + "/lib/rt.jar")) .build(); return javaProject.createView(); }
and
private static JavaView createViewForClassPath(String classPath) { JavaProject javaProject = JavaProject.builder(new JavaLanguage(8)) .addInputLocation( new JavaClassPathAnalysisInputLocation( System.getProperty("java.home") + "/lib/rt.jar")) .build(); return javaProject.createView((c) -> new ClassLoadingOptions() { @Nonnull @Override public List<BodyInterceptor> getBodyInterceptors() { List<BodyInterceptor> res = new ArrayList<>(); res.add(new CastAndReturnInliner()); res.add(new LocalSplitter()); res.add(new TypeAssigner()); return res; } }); }
But these two ways will both cause System.out.println(v.getBodyInterceptors()); output [], and jimple is not typed. How can I get the typed jimple?
System.out.println(v.getBodyInterceptors());
[]
The text was updated successfully, but these errors were encountered:
Thanks for raising this issue. This method returns an empty list. We will fix this.
Sorry, something went wrong.
It should work now with fix #614
kadirayk
Successfully merging a pull request may close this issue.
By default, the sootup bytecode frontend will output jimple with no type info (for non-arg variables). For example:
The
stack$_
variables has typeunknown
. I guessed that I should useTypeAssigner
body interceptor.I tried
and
But these two ways will both cause
System.out.println(v.getBodyInterceptors());
output[]
, and jimple is not typed. How can I get the typed jimple?The text was updated successfully, but these errors were encountered: