Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Debugging not working with flatpak #540

Open
pioupia opened this issue Dec 11, 2023 · 0 comments
Open

[BUG] Debugging not working with flatpak #540

pioupia opened this issue Dec 11, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@pioupia
Copy link

pioupia commented Dec 11, 2023

Hello,
It seems that the extension does not work when Visual Studio Code is launched with Flatpak. Indeed, when a debug is launched, in the Visual Studio code debug console page, GDB returns the following error: `ERROR: Unable to start debugging. GDB exited unexpectedly.
I'd like to point out that before Visual Studio Code was switched to Flatpak, it worked correctly.

In order to launch a correct bash session, some configurations had to be modified, so I'm attaching our user.json configuration:

"terminal.integrated.defaultProfile.linux": "zsh",
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "/usr/bin/flatpak-spawn",
            "icon": "terminal-bash",
            "args": [
                "--host",
                "--env=TERM=xterm-256color",
                "bash"
            ]
        },
        "zsh": {
            "path": "/usr/bin/flatpak-spawn",
            "args": [
                "--host",
                "--env=TERM=xterm-256color",
                "zsh"
            ]
        },
    },

I think the extension is trying to run the gdb program in a way that doesn't give it access to files or environment variables.

Without the bash configuration set in the user parameters, the bash we have has no environment variables and is buggy. This may be due to the fact that, as the application is launched with Flatpak, the command flatpak-spawn --host should be used to give GDB access to the data required for it to function correctly.

If we set the line terminal.integrated.defaultProfile.linux to bash, and we set the path of the bath profile to /usr/bin/bath, the debugger is working correctly, but not the shell anymore.

I don't know if it was clear, but I'm trying to explain something I don't really understand.

This issue is related to this one I think: microsoft/vscode#140261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants