Pure-D / code-d

Fully featured D language extension for Visual Studio Code using Serve-D
MIT License
295 stars 47 forks source link

VSCodium Not Supported? (Windows) #485

Open DeathByNukes opened 3 weeks ago

DeathByNukes commented 3 weeks ago

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 commented 3 weeks ago

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