Skip to content

Lab Exercise 3

Yulei Sui edited this page May 17, 2024 · 21 revisions

Lab-Exercise-3 folder layout

$tree Lab-Exercise-3
├── AEMgr.cpp
├── AEMgr.h
├── CMakeLists.txt
├── test.cpp

1. Get the latest Lab-Exercise-3 code template

* Before coding, please type cd $HOME/Software-Security-Analysis and git pull in your terminal to make sure you always have the latest version of the code template before coding.

If git pull fails due to the conflict with your local changes, type git stash to store your current code in a temporal branch and type git pull again. If you want to retrieve your code back, type git stash pop.

You need to set the "program" to be the executable file of Lab 3, i.e., "${workspaceFolder}/bin/lab3" and "args" to include one of the 8 tests, e.g., ["test1"] in launch.json in order to run and debug

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "(gdb) Launch",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/bin/lab3",
      "args": ["test1"],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "MIMode": "gdb",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      "preLaunchTask": "C/C++: cpp build active file"
    }
  ]
}

2. Lab Exercise 3 task

  1. Implement methods from AbstractExecutionMgr::test1() to AbstractExecutionMgr::test8() in class AbstractExecutionMgr in AEMgr.cpp
  2. Pass the test without any assertion by test.cpp.
  3. Submit AEMgr.cpp to UNSW WebCMS or give. Your implementation will be evaluated against our 8 internal tests. You will get the full marks if your code can pass them all. We have provided AEExampleMgr::test0() in AEMgr.cpp as an example to help get started.

*You will be working on AEMgr.cpp only and there is NO need to modify other files under the Lab-Exercise-3 folder

SVF AEMgr APIs to help with your implementation SVF AEMgr API.

3. Debugging

If you want to see the value of AbstractValue. You can also call toString() to print the value (either Interval Value or Address Value).

int main() {
    AbstractValue a = IntervalValue(1, 1);
    std::cout << a.toString() << std::end;
}
Clone this wiki locally