Skip to content

[Assignment 1] A few minor problems #2

@CAG2Mark

Description

@CAG2Mark
  1. Java 11 is EOL. I would suggest updating the project in the future to use Java 17 or newer. The current version of Soot does not support Java 17.

  2. The raw-classes directory in the example Soot project is redundant. This is because both target/classes and raw-classes are included in the Soot classpath, and Subject.java are compiled to both raw-classes and target/classes, and Soot instruments the latter due to the order of the entries in the classpath.

    This is problematic, because if we remove the following lines in scripts/instrument-run-test.sh:

    find "$ROOT_DIR"/src/ -name "*.java" -print0 | xargs -0 \
    javac -classpath .:"$ROOT_DIR"/lib/* -d "$ROOT_DIR"/target/classes

    then Soot will re-instrument the already instrumented code over successive runs of the script. So instead, the classpath in Soot should be set as the following, with classUnderTestPath and targetPath swapped:

    Options.v().set_soot_classpath(Scene.v().defaultClassPath() + classPathSeparator + classUnderTestPath + classPathSeparator + targetPath);

    and then it will instrument the class files in raw-classes.

  3. In https://github.com/CastleLab/COMP5111-2026Spring-Assignments-Students/blob/asn1/README.md?plain=1#L107, does "line code" mean the actual source code of the line, or just the line number?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions