This repository is a recitation template.
The code presented here uses Soot to perform Definitions Analysis, keeping a
list of all variable definitions with their line numbers.
In this recitation, we consider how to extend it to keeping track of just the
most recent assignment of a variable by modifying the flowThrough method in
IntraDefsAnalysis.
- Open this repository using GitHub Codespaces with the 4-core VM option.
- Run/test your implementation inside the codespace environment by opening the gradle icon on the sidebar and clicking Tasks -> verification -> test.
- You can use VSCode's debugger by setting breakpoints on your code, and selecting the debug icon under test on the gradle icon.
inputs.DefsTest is the code we are analyzing.
IntraDefsAnalysis, extending Soot's ForwardFlowAnalysis, contains the code we're
interested in changing.
As of Feb 2022, the latest Soot release that works is v4.2.1, which depends on ASM 8.0.1 and uses a hard-coded ASM API version 8. This restricts analysis of class files that are compiled with JDK 15 or earlier. So, we cannot do whole program analysis with Java 16 or higher, because the JDK library classes would be in a format that is unsupported by ASM 8.0.1 and in turn Soot v4.2.1. Simply upgrading the ASM version to ASM 9.1 does not fix this, because Soot v4.2.1 has hard-coded the use of ASM API version 8 in its use of ASM ClassVisitor.