microsoft / microsoft/vscode-cpptools

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

Abierto
#5,294 7 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug debugger
Lenguaje dominante
TypeScript
Estrellas
6.2k
Forks
1.7k
Merge medio
14 h 46 min
PR fusionados (30 d)
61

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el comportamiento usando main.c, launch.json y task.json: comienza con el breakpoint, pulsa F5, cancela el breakpoint y luego usa Run y Stop. Observa si el proceso y sus hilos siguen ejecutándose y si funcionan los breakpoints añadidos posteriormente. Se considera terminado cuando Pause, Stop y los breakpoints posteriores funcionan normalmente después de eliminar el breakpoint inicial.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp, typescript, vscode
Área
devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.