microsoft / microsoft/vscode-cpptools

Can't pause after press run with no breakpoint when debug with cpptool(but can stop at the begining)

Aperta
#5,294 7 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug debugger
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

  • 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,
image

step3: we can do all debug operations such as watch the value of parameter,and changed them by hand.
image
image

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.
image

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"
]
}
]
}

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il comportamento usando main.c, launch.json e task.json: inizia con il breakpoint, premi F5, annulla il breakpoint, quindi usa Run e Stop. Osserva se il processo e i suoi thread continuano a essere eseguiti e se i breakpoint aggiunti successivamente funzionano. È completato quando Pause, Stop e i breakpoint successivi funzionano normalmente dopo aver rimosso il breakpoint iniziale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, typescript, vscode
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.