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

VSCodium Not Supported? (Windows) #485

Open
DeathByNukes opened this issue Aug 16, 2024 · 3 comments
Open

VSCodium Not Supported? (Windows) #485

DeathByNukes opened this issue Aug 16, 2024 · 3 comments

Comments

@DeathByNukes
Copy link

DeathByNukes commented Aug 16, 2024

I have tried a few times over the years to use D with VSCodium but have never been able to get the debugger to work. Today I tried from scratch in a blank environment. Here are my steps for reproducing the problem:

DMD:

(As far as I know, DMD can't be debugged without the C++ extension, which is not available for VSCodium.)

LDC:

Download the following files:

  1. In the latest version of Windows 11, open Windows Sandbox. (Install it via "Turn Windows Features on or off".)
  2. Paste in and install the following files: ldc2-1.39.0-windows-multilib.exe and VSCodium-x64-1.92.2.24228.exe
  3. Open VSCodium.
  4. Go to the "Extensions" side tab, search for and install "Code-D" (webfreak.code-d) and "CodeLLDB" (vadimcn.vscode-lldb).
  5. [Setup D Compiler] > [ldc 1.39.0] > [OK]
  6. In the bottom corner, [Reinstall serve-d]
  7. [File] > [Open Folder] > (Create and open a new folder on the Desktop named "test".)
  8. Ctrl+Shift+P > code-d: Create new Project > Empty Win32 Application
  9. Go to the "Explorer" side tab and open source/app.d.
  10. Click the left margin of the first line in the main function to set a breakpoint. (Red circle.)
  11. Press F5.
  12. Select [DUB (code-d: Native Debug / C++ / CodeLLDB)]
  13. (Nothing happens.)
  14. Go to the "Run and Debug" side-tab.
  15. Click the "create a launch.json file" link.
  16. Select [DUB (code-d: Native Debug / C++ / CodeLLDB)]
  17. Go back to the source/app.d tab.
  18. Press F5.
  19. "Oops! The debug adapter has terminated abnormally." > [Open log]
  20. "Debug adapter exit code=3221225781 (0xc0000135), signal=null."

LDC.log

GDC:

Download the following files:

  1. In the latest version of Windows 11, open Windows Sandbox. (Install it via "Turn Windows Features on or off".)
  2. Paste in winlibs-i686-posix-dwarf-gcc-14.2.0-llvm-18.1.8-mingw-w64ucrt-12.0.0-r1.7z and extract it to the desktop.
  3. Move the mingw32 folder to C:\Program Files.
  4. Open the start menu, type "path", and select [Edit the system environment variables].
  5. [Environment Variables...] > "System variables" section > Double-click "Path"
  6. [New] > "C:\Program Files\mingw32\bin" > [OK] > [OK] > [OK]
  7. Paste in and install VSCodium-x64-1.92.2.24228.exe.
  8. Open VSCodium.
  9. Go to the "Extensions" side tab, search for and install "Code-D" (webfreak.code-d) and "Native Debug" (webfreak.debug).
  10. [Setup D Compiler] > [gcc 14.2.0] > [OK]
  11. In the bottom corner, [Reinstall serve-d]
  12. [File] > [Open Folder] > (Create and open a new folder on the Desktop named "test".)
  13. Ctrl+Shift+P > code-d: Create new Project > Empty Win32 Application
  14. Go to the "Explorer" side tab and open source/app.d.
  15. Click the left margin of the first line in the main function to set a breakpoint. (Red circle.)
  16. Press F5.
  17. Select [GDB] (Options present: GDB, LLDB)
  18. (Nothing happens.)
  19. Go to the "Run and Debug" side-tab.
  20. Click the "create a launch.json file" link.
  21. Select [GDB]
  22. Go back to the source/app.d tab.
  23. Press F5.
  24. "Failed to load MI Debugger: C:\Users\WDAGUtilityAccount\Desktop\test\bin\executable: No such file or directory."
  25. Delete the { blah } block from launch.json so the configurations block is empty.
  26. In the "Run and Debug" side-bar, select the drop-down box next to the green arrow and select "Add Configuration...".
  27. Choose "DUB: Build and Launch".
  28. Press F5.
  29. "Cannot read properties of null (reading 'packagePath')"

GDC.log

@WebFreak001
Copy link
Member

if you can get codelldb or gdb to work with vscode (without code-d in it), feel free to put their launch json configs here - I haven't been able to get it to work usefully outside the VS debugger that's proprietary to vscode, but if you have a config that works I can put it into code-d for others to automatically get loaded

@davibu
Copy link

davibu commented Oct 26, 2024

if you can get codelldb or gdb to work with vscode (without code-d in it), feel free to put their launch json configs here - I haven't been able to get it to work usefully outside the VS debugger that's proprietary to vscode, but if you have a config that works I can put it into code-d for others to automatically get loaded

I simply run in launch.json :

        {
            "type": "lldb",
            "request": "launch",
            "name": "run debug",
            "program": "./bin_name"
        }

The projects needs to be build as debug before, but you can also do this add a "preLaunchTask"; "dub build debug" (depends how you name your debug build task). Not quite sure how you would get the binary name dynamically though.

Edit:
Don't forget to set a break-point before running ;)

@fithisux
Copy link

fithisux commented Oct 27, 2024

@WebFreak001 : Do you know if the winlibs you posted contains GDC for Windows, do you know any other source? How do I invoke the compiler? No gdc in the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants