OiO.lk Blog C# Why C debugger not prints anythings when in debugger mode
C#

Why C debugger not prints anythings when in debugger mode


I am not able to input anything on terminal in debugger
i

have installed c/c++ set up, codeLLB and code runner extension

i tried everything but not works!!

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

VSCODE IMAGE

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

Exit mobile version