Closed qyi71 closed 8 months ago
Hi,
The error is not caused by the multiple inputlocations. Your return value "List
Your parameter is also wrong. If you wanted to use the primitive long it should be written "long" and if you wanted to use the class Long then you need to write "java.lang.Long".
The call graph is empty because you are requesting a method signature which is not contained in the view.
ClassType clazz = view.getIdentifierFactory().getClassType("cn.gov.zcy.engr.service.BuildService");
view.getClass(clazz).ifPresent(javaSootClass -> javaSootClass.getMethods().forEach(
System.out::println));
This will show all valid signatures of the requested class.
Hi, The error is not caused by the multiple inputlocations. Your return value "List" is not correct. It should be "java.util.List". In bytecode lists dont have the <> in their type. Your parameter is also wrong. If you wanted to use the primitive long it should be written "long" and if you wanted to use the class Long then you need to write "java.lang.Long". The call graph is empty because you are requesting a method signature which is not contained in the view.
ClassType clazz = view.getIdentifierFactory().getClassType("cn.gov.zcy.engr.service.BuildService"); view.getClass(clazz).ifPresent(javaSootClass -> javaSootClass.getMethods().forEach( System.out::println));
This will show all valid signatures of the requested class. Thanks But now I have a new problem. When I call cg.callsFrom, return an empty array. However, multiple method signatures should be returned
Can you call view.getMethod(signature) and check if the optional is present. Signature is your requested Methodsignature
Ah wait I might know the issue. You are using RTA. If RTA starts not at the main method or starting point of the application it will miss instantiated classes. These classes will be ignored as call targets. If your method does not contain any constructor call there won't be any call from the method. mmh maybe we should create a call to the actual method in the invoke, if the virtual invoke resolvers returns an empty list, since no class of a target method was instantiated before
could you test the same setup with cha instead of rta
First thank you for your answer. However, the reason for the question is that I used Spring Boot. After reviewing the source code of SoutUp, I found that it cannot generate Call Graph
My project has multiple modules, and these modules are built into multiple jars. When I analyze the interface of one of the modules, I cannot analyze it together with other modules. ` List inputLocations = new ArrayList<>();
BuildService has multiple references in rm-server-1.2.0-SNAPSHOT.jar, but the output result is empty