microsoft / microsoft/vscode-cpptools

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

Offen
#5,294 7 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug debugger
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Verhalten mit main.c, launch.json und task.json: Starte mit dem Breakpoint, drücke F5, breche den Breakpoint ab und verwende dann Run und Stop. Beobachte, ob der Prozess und seine Threads weiter ausgeführt werden und ob neu hinzugefügte Breakpoints funktionieren. Erledigt ist es, wenn Pause, Stop und spätere Breakpoints nach dem Entfernen des anfänglichen Breakpoints normal funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, typescript, vscode
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.