1nVitr0 / plugin-vscode-valgrind-task-integration

Valgrind Task Integration for Visual Studio Code
MIT License
5 stars 0 forks source link

Passing LD_LIBRARY_PATH to valgrind? #20

Open aleksas opened 1 year ago

aleksas commented 1 year ago

Following lounch command almost runs as expected. Valgrind output shows an error that an .so dependency was not found. Apparently LD_LIBRARY_PATH value was not passed to valgrind.

    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${command:cmake.launchTargetPath}",
            "args": [
                "-arg1", "value1",
                "-arg2", "value2"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Additional libs for gdb",
                    "text": "set environment LD_LIBRARY_PATH=${workspaceFolder}/build:[OTHER_PATHS]:$LD_LIBRARY_PATH",
                    "ignoreFailures": false
                },
                {
                    "description": "Additional asan lib for gdb",
                    "text": "set environment LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/8/libasan.so",
                    "ignoreFailures": false
                },
                {
                  "description": "Connect to valgrind",
                  "text": "${command:valgrind-task-integration.valgrindGdbArg}",
                  "ignoreFailures": true
                }
            ]
        },
]

If "preLaunchTask": "valgrind-debug", is used then VSCode shows an error

image

Env