Skip to content

Setup and Debug Guide (VScode)

Richard L Ford edited this page Apr 21, 2021 · 2 revisions

2.Download VSCode Extension: CMake Tools

3.Download C/C++ Extension in VSCode

4. Build SVF

a. open the CMake tools set the configure Args

Or b.create the settings.json in the current workspace

./SVF/.vscode/settings.json


{
    "cmake.buildDirectory": "${workspaceFolder}/Debug-build",
    "cmake.sourceDirectory": "${workspaceFolder}",
    "cmake.configureArgs": [
        "-DLLVM_DIR=/Users/charles/guanqin/analysis/clang10"
    ]
}

for further settings please refer to microsoft_VSCode_settings_doc

5.cmake and build

Executable file will be stored in the Debug-build directory

6. Debug with breakpoints

select debug compiler depends on your pc system

Create launch.json to setup for your target program debug

/SVF/.vscode/launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "clang++ - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/Debug-build/bin/wpa",
            "args": ["-ander","/Users/charles/s.bc"],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "MIMode": "lldb"
            // "preLaunchTask": "C/C++: clang++ build active file"
        }
    ]
}

debug mode

Or you can also set breakpoints and press F5 to start your debugging