Maison > Article > développement back-end > Débogueur C Impossible d'imprimer ou de prendre des entrées lorsque le mode débogueur est activé
dans le dossier .vscode :
Mon lanch.json :
"configurations": [ { "name": "C/C++: gcc.exe build and debug active file", "type": "cppdbg", "request": "launch", "program": "${fileDirname}\${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "MIMode": "gdb", "miDebuggerPath": "C:\MinGW\bin\gdb.exe", "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 } ], "preLaunchTask": "C/C++: gcc.exe build active file" } ], "version": "2.0.0" }
task.json :
{ "tasks": [ { "type": "cppbuild", "label": "C/C++: gcc.exe build active file", "command": "C:\MinGW\bin\gcc.exe", "args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${fileDirname}\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "Task generated by Debugger." } ], "version": "2.0.0" }
c_cpp_properties.json :
{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "windowsSdkVersion": "10.0.22621.0", "cStandard": "c17", "cppStandard": "c++17", "intelliSenseMode": "gcc-x64", "compilerPath": "C:/MinGW/bin/gcc.exe" } ], "version": 4 }
code :
#include <stdio.h> int main(){ int i; scanf("%d", &i); printf("You entered: %d\n", i); return 0; }
Terminal :
PS C :Utilisateurs*OneDriveDocumentsINTERVIEW PREPDSA et petits apprentissages> & 'c:Users**.vscodeextensionsms-vscode.cpptools-1.23.0-win32-x64debugAdaptersbinWindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-caznmueg.sx2' '--stdout=Microsoft-MIEngine-Out-kpfaclzx.m3o' '--stderr=Microsoft-MIEngine-Error-nq1rgwan.vxy' '--pid=Microsoft-MIEngine-Pid-d12jsuyv.lf0' '--dbgExe= C:MinGWbingdb.exe' '--interpreter=mi'
Quand j'appuie sur F5, cela signifie que je débogue mon code C, il n'imprime rien et ne prend aucune entrée si scanf est là, si le débogueur est à scanf , et si j'appuie sur F10 , alors comme le montre l'image, rien ne se passe. Je ne peux que survoler et voir la valeur de la variable. J'ai installé
set up, ```codeLLB``` and code runner extensions, as well. Also, If I not put debugger at scanf function: it waits for input ,but when i write something and hit enter, nothing happens, also the debugger not allow to step next step...And after that if i stop the debugger, then what ever i wrote in terminal ,shows there immediately. Example: if i wrote fffff and then stop debugger then that word executes in terminal!
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!