Assignment 1 CPP - SVF-tools/Software-Security-Analysis GitHub Wiki
Running Tests
Use control + ~
to open a terminal in VSCode and then type the below command line
Your implementation | ctest command line |
---|---|
Your reachability analysis | ctest -R ass1-icfg-cpp -VV |
Your points-to analysis | ctest -R ass1-pta-cpp -VV |
Your taint analysis | ctest -R ass1-taint-cpp -VV |
The entire Assignment-1 | ctest -R ass1.*cpp -VV |
- Debugging tips for ICFG.
Add -dump-icfg
as an extra option of -icfg
for your ass1
executable when debugging your reachability
implementation. This will dump ICFG into a dot file to view in VSCode.
- Debugging tips for ConstraintGraph and points-to sets.
Add -print-pts
as an extra option of -pta
for your ass1
executable when debugging your solveWorklist
implementation and you could print out the final points-to set of each node to validate your MAYALIAS and NOALIAS results. You could also use -print-constraint-graph
to print out the final constraint graph (edges and nodes) or -dump-constraint-graph
to dump it into a dot file to view in VSCode. Retrieve a variable's points-to set, perform union operations or print out the points-to set using these APIs
Constraint Edge | Corresponding Color in Dot graphs (PAG and ConstraintGraph) |
---|---|
ADDR | Green |
COPY | Black or (dashed arrow for interprocedural COPY edges) |
LOAD | Red |
STORE | Blue |
GEP | Purple |
Submitting Your Work
- Upload
Assignment-1.cpp
to UNSWWebCMS
for your submission.
Your implementation will be evaluated against our 10 internal tests. You will get the full marks if your code can pass them all. Our internal tests are private. Here, we only provided a handful test cases under Assignment-1/Tests/testcases
. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.
Assignment-1.cpp
only and there is NO need to modify other files under the Assignment-1 folder
- You will be working on 3. Configuration && debugging
launch.json
3.1To enable debugging and running, switch your executable by setting the program
and args
fields as described here or follow the below screenshot.
3.2 Debug your code
From Configure-IDE, we know how to set breakpoint, debug and watch the variables.
If we want to check more complicated data structures like ICFG, ConstraintGraph and Point-to Sets. Please read the following instructions.
Debugging for ICFG
As per debugging-tips-for-icfg
Debugging for ConstraintGraph and points-to-sets
As per debugging-tips-for-constraintgraph-and-points-to-sets