I am not able to input anything on terminal in debugger.
I have installed C/C++
set up, codeLLB
and code runner extensions, as well.
My lanch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false, // Use integrated terminal,
"MIMode": "gdb",
"miDebuggerPath": "C:/MinGW/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc.exe build active file",
"internalConsoleOptions": "openOnSessionStart",
"logging": {
"moduleLoad": false,
"trace": true
},
"visualizerFile": "${workspaceFolder}/my.natvis",
"showDisplayString": true
}
]
}
task.json :
{
"version": "2.0.0",
"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."
}
]
}
code :
#include <stdio.h>
void reverse(void); /* function prototype */
void reverse(void)
{
int c;
if (((c = getchar()) != '\n'))
reverse();
putchar(c);
}
int main()
{
printf ("Enter Text ") ;
printf ("\n") ;
reverse();
printf ("\n") ;
getchar();
return 0 ;
}
How do I perfectly setup things, it takes my much time!!
how to debug that?
terminal :PS C:\Users\adity\OneDrive\Documents\leetcode testing\C> & ‘c:\Users\adity\.vscode\extensions\ms-vscode.cpptools-1.22.9-win32-x64\debugAdapters\bin\WindowsDebugLauncher.exe’ ‘–stdin=Microsoft-MIEngine-In-lluy4rno.kna’ ‘–stdout=Microsoft-MIEngine-Out-ehcns4in.vwo’ ‘–stderr=Microsoft-MIEngine-Error-ho5vzozn.rey’ ‘–pid=Microsoft-MIEngine-Pid-03q4hsbx.ebi’ ‘–dbgExe=C:/MinGW/bin/gdb.exe’ ‘–interpreter=mi’
You need to sign in to view this answers