microsoft / microsoft/vscode-cpptools
Sometimes stops where no breakpoint exists, sometimes doesn't stop at the breakpoint where should have stopped :(
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
- VS Code: 1.82.0
- C/C++ extension: v1.17.5
- GDB / LLDB version: GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Bug Summary and Steps to Reproduce
Bug Summary:
case1: Sometimes debugger stops where no breakpoint exists. However, gdb say that there is a breakpoint on current stop location when I run "-exec info b" in DEBUG CONSOLE. It's certain that I didn't set a breakpoint. After run "-exec clear", it finally escaped.
case2: There is also the opposite situation. Sometimes doesn't stop at the breakpoint where should have stopped. In the case, code just like:
while ( true )
{
if ( condition1 ){
break; // breakpoint here
}
if ( condition2 ){
break; // breakpoint here
}
}
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": "open_pit_mine-new_cloud_app",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/modules/app/open_pit_mine/open_pit_mine-new_cloud_app",
"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
}
],
"logging": {
"engineLogging": true,
"traceResponse": true
}
}
]
}
Debugger Logs
"HitNonExit.txt" for case1, debugger stops just as it starts, it should be noted that it's not the entry position of program and "stopAtEntry" is false.
"NonHitBp.txt" for case2, and it contains case1's log.
Other Extensions
No response
Additional Information
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 with the attached HitNonExit.txt and NonHitBp.txt logs, then compare the two reported cases with the supplied launch configuration and reproduction code. Done means the debugger stops only at configured breakpoints, reaches both marked break statements when hit, and does not stop unexpectedly elsewhere.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100