microsoft / microsoft/vscode-cpptools
expression breakpoint not working as expected
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Ubuntu 20.04.4 LTS
- VS Code: 1.68.0
- C/C++ extension: 1.10.7
- OS and version of remote machine (if applicable): both on local linux and remote to linux(from mac or win),but local mac and win is working as expected
- GDB / LLDB version:9.2
Bug Summary and Steps to Reproduce
Bug Summary:
If I use expression breakpoint and expression contains strcmp, when this breakpoint is hit, gdb will crash unexpectedly

Steps to reproduce:
- Only on Linux environment(both local and remote to it via remote-ssh), it works well on local windows environment
- Just a demo project will reproduce this issue
Besides, if I don't use strcmp and just set very simple expression like 1==1, breakpoint will be hit successfully and there's no error.
Sorry to let you guys work on this, looking forward to your reply.
Debugger Configurations
{
// 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": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
"stopAtEntry": false,
"cwd": ".",
"launchCompleteCommand": "exec-run",
"linux": {
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
"preLaunchTask": "default compile",
"externalConsole": false
}
]
}
Debugger Logs
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
Breakpoint 1, main () at /home/eric/Dev/c-test/test.c:5
5 {
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.
ERROR: GDB exited unexpectedly. Debugging will now abort.
The program '/home/eric/Dev/c-test/test.exe' has exited with code -1 (0xffffffff).
Other Extensions
Other extensions have been disabled when I test on this
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure from test.c with the supplied launch configuration on Linux using GDB 9.2, comparing an expression containing strcmp with 1==1. Use the debugger log to determine why GDB exits unexpectedly; done means the failing expression breakpoint no longer aborts debugging and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, vscode
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100