coder / code-server

VS Code in the browser
https://coder.com
MIT License
68.71k stars 5.64k forks source link

[Docs]: C/C++ debug not working #5764

Closed sakthivel-axim closed 2 years ago

sakthivel-axim commented 2 years ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

  1. Download and install using dpkg -i <package.deb>
  2. Add launch.json with type cppdbg
  3. Able to compile and execute. But debug not working.

Expected

Able to debug

Actual

Throws error Configured debug type 'cppdbg' is not supported.

Logs

No response

Screenshot/Video

image

Does this issue happen in VS Code or GitHub Codespaces?

Are you accessing code-server over HTTPS?

Notes

Installed the .deb package in BeagleBone board. Running over HTTP.

jsjoeio commented 2 years ago

I think the CPP debugger is in the MSFT extension which we can't use in code-server (based off this) so I don't think there's anything we can do here sadly.

cc @code-asher are there any workarounds that you know of?

sakthivel-axim commented 2 years ago

Thanks, @jsjoeio. Understand that cannot use cppdbg. Please let me know the possibilities to use gdb for debugging in Debian environment.

jsjoeio commented 2 years ago

Understand that cannot use cppdbg. Please let me know the possibilities to use gdb for debugging in Debian environment

None that I know of but maybe @code-asher knows

code-asher commented 2 years ago

The only open-source version of the Microsoft C++ extension I know of is https://open-vsx.org/extension/llvm-vs-code-extensions/vscode-clangd but I have never used it so I am not sure how/if debugging works.

a279437145 commented 2 years ago

I can have cpp debugging working on code-server running on my Raspberry pi (Ubuntu 22.04 , arm64) , I installed https://github.com/Microsoft/vscode-cpptools (there are armhf builds), you may try it . (It can work even without https)

sakthivel-axim commented 2 years ago

Thanks you @a279437145 .

I have tried to install but it doesn't show in extension. Could you please share config/steps to bring up? It will be helpful.

a279437145 commented 2 years ago

yep , it's not in the openVSX extension gallery , so you cant install it directly. I downloaded the vsix from https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools and chose the Download extensionoption in the right , then choose the right one for you you are on armhf ubuntu , so you should choose Linux arm32 , like this: IMG_20221123_171335

then put it on your code-server and install, the way to install exis extensions are described in the code-server docs

Also if you want i can provide my tasks.jsonandlaunch.json

sakthivel-axim commented 2 years ago

Thanks @a279437145 . I will try to setup. Please share your tasks.json and launch.json, it helps a lot. Thanks once again.

a279437145 commented 2 years ago

the files are here launch.txt tasks.txt change the attribute to .json(I can't upload json files to github directly),and please ignore the python configuration in launch.json it should work like this Screenshot_2022-11-23-19-58-51-30_3aea4af51f236e4932235fdada7d1643 I cant use computer now so I did that on phone , the screenshot may somehow look a bit strange,regret~

sakthivel-axim commented 2 years ago

It's working. Thank you @a279437145.

a279437145 commented 2 years ago

Great , you are welcome.

Message ID: @.***>

sakthivel-axim commented 2 years ago

yep , it's not in the openVSX extension gallery , so you cant install it directly. I downloaded the vsix from https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools and chose the Download extensionoption in the right , then choose the right one for you you are on armhf ubuntu , so you should choose Linux arm32 , like this: IMG_20221123_171335

then put it on your code-server and install, the way to install exis extensions are described in the code-server docs

Also if you want i can provide my tasks.jsonandlaunch.json

Debugging is working with help of this.