microsoft / microsoft/vscode-cpptools
Can't pause after press run with no breakpoint when debug with cpptool(but can stop at the begining)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
- Last question updated: 2020/4/14/14:51
- Enviroment:
- Win10 (x64),
- last version of vscode(2020/4/14),
- Extension version: 0.27.0
Source Code (main.c):
#include <stdio.h>
int main(void)
{
int cnt_1st = 0;
int cnt_2nd = 0;
while (1)
{
// sched_run_idle();
if (cnt_1st > 40000000)
{
cnt_1st = 0;
cnt_2nd++;
if (cnt_2nd > 100)
{
cnt_2nd = 0;
printf("heart beat\n");
}
}
cnt_1st++;
}
return 0;
}
Bug Description:
step1: Before pressing F5 I create a breakpoint in the line of " if (cnt_1st > 40000000)",
step2: then press F5 then we can hit the breakpoint normally,
step3: we can do all debug operations such as watch the value of parameter,and changed them by hand.


step4: once I cancel all breakpoints and press "run" , the debug progress will can't stop anymore,
step5: even I create breakpoint again in any where of the codes, result is the same.

and I found there are 3 threads in the left side of the vscode windows,
all states are RUNING, when click stop in any thread , the thread is still running.
in the console side the heartbeat is keep printing.
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "c/c++",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:/MinGW/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build"
}
]
}
task.json:
{
"version": "2.0.0",
"command": "build",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "gcc",
"args": [
"main.c",
"-g"
]
}
]
}
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
Reproduce the behavior using main.c, launch.json, and task.json: start with the breakpoint, press F5, cancel the breakpoint, then use Run and Stop. Observe whether the process and its threads remain running and whether newly added breakpoints work. Done means pause, stop, and later breakpoints operate normally after removing the initial breakpoint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100
