vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Data breakpoints are not available when debugging a C++ program on Linux with GDB

Open gareth-rees opened this issue 2 years ago • 1 comments

Environment

VSCode version: 1.69.2 C/C++ extension version: 1.10.8 Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a Date: 2022-07-18T16:14:10.636Z Electron: 18.3.5 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Linux x64 5.4.0-120-generic snap

Bug Summary and Steps to Reproduce

Microsoft's Developer blog for April 20th, 2022, said:

In case you missed it, version 1.8.4 of the C++ extension brought support for data breakpoints (#1410) while debugging C++ programs with GDB in VS Code. Data breakpoints break execution when a value stored at a specified memory address changes.

To set a data breakpoint while debugging in VS Code, right click on a variable in the debug pane and select Break on Value Change.

I am using the C++ extension to debug a C++ program using GDB, but I do not see the "Break on value change" menu entry when right-clicking on a local variable:

Screenshot from 2022-07-21 15-18-14

Is the blog correct that data breakpoints are expected to work in my configuration?

Debugger Configurations

{
    "configurations": [
    {
        "name": "(gdb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/cache-cpp",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description":  "Set Disassembly Flavor to Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
    }
    ]
}

Debugger Logs

(Logs are too long to paste here, but do ask if important.)

Other Extensions

No response

Additional Information

No response

gareth-rees avatar Jul 21 '22 14:07 gareth-rees

In your launch.json file can you add the following block to your configuration and share the output in the Debug Console?

"logging": {
   "engineLogging": true,
   "traceResponse": true
}

WardenGnaw avatar Aug 01 '22 18:08 WardenGnaw

This issue has been closed because it needs more information and has not had recent activity.

github-actions[bot] avatar Aug 16 '22 11:08 github-actions[bot]