Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code Debugger not launching

  • OS and Version: Windows 10 Build 19042.985
  • VS Code Version: 1.56.2
  • C/C++ Extension Version: v1.4.0-insiders
  • other extensions: remote-ssh

I've been working with remote-ssh on a raspberry and c/c++ extension without any issue, all of a sudden I cannot start the debugger. Nothing changed, configuration files are the same as before but now when I start the debugger, I see for a couple of seconds the top debugging bar and then it disappears. No message on the console, nothing.

For this purpose, I created a simple project from scratch, and even there, the same issue appears.

To Reproduce launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "logging": { "engineLogging": true },
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": false
                }
            ]
        }
    ]
}

main.c

#include <stdio.h>
int main(){
    printf("ciao\n");
    return 1;
}

Compile with gcc -g main.c

As I stated before, this workflow worked for me, from one second to another it stopped working as intended and I have no idea why and how to fix it, any help is appreciated.

What I tried

  • reinstall vscode
  • reinstall the c/c++ extension and delete by hand the extension folder
  • numerous reboots

Updates

I have tried with the wsl-remote extension and it is working as expected.ù

Tried to uninstall gdb from host and launch the debug session, the message "gdb" not found does not even appear as it should

like image 835
Andrea Nisticò Avatar asked Jan 30 '26 02:01

Andrea Nisticò


1 Answers

I was in similar situation and couldn't find relevant resolutions:

Quick Answer: After upgrade to VS Code 1.56.2, make sure to remove old breakpoints and create new breakpoint and at-least have 1 breakpoint and launch.json available.

Lengthy details:

I have similar issue for python scripts when I start the "debugger bar" I see it for a couple of seconds the top debugging bar and then it disappears. Bu then no message on the console, nothing. I tried reinstalling VS Code, enabling/disabling extension, various restart.

  • OS and Version: Mac OSX Version 11.4 (20F71)
  • VS Code Version: 1.56.2
  • Extension: Python v2021.5.842923320 by Microsoft

RootCause:

What I did know for sure that I updated my VS Code, and after that this mysterious issue start happening, so when to release log of VS Code 1.56.2. I found below release log

Debug view displayed on break#

The default value of the debug.openDebug setting is now openOnDebugBreak so that on every breakpoint hit, VS Code will open the Debug view. The Debug view is also displayed on first session start.

So VS code Version 1.56 release, debugger will only show when at-least 1 breakpoint is found. However, looks like there is issue with their internal code checking for historical breakpoint data after VS Code upgrade..

https://code.visualstudio.com/updates/v1_56#_debug-view-displayed-on-break

like image 180
user2577923 Avatar answered Jan 31 '26 16:01

user2577923