www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - Help to launch the debugger in VS Codium.

reply Mahdis <ubuntulove74 gmail.com> writes:
Hello, please help me in setting up the debugger in VS Codium on 
Fedora 37.
What do I need?
Serve-d,vscode.cpptools, dcd and dub are installed on my system.

I installed code-d, it works great but the debugger just compiles 
and displays the result and stops even with the directive set 
[here](https://github.com/Pure-D/code-d/blob/master/docs/debugging.md).
Dec 12 2022
parent reply WebFreak001 <d.forum webfreak.org> writes:
On Monday, 12 December 2022 at 16:50:53 UTC, Mahdis wrote:
 Hello, please help me in setting up the debugger in VS Codium 
 on Fedora 37.
 What do I need?
 Serve-d,vscode.cpptools, dcd and dub are installed on my system.

 I installed code-d, it works great but the debugger just 
 compiles and displays the result and stops even with the 
 directive set 
 [here](https://github.com/Pure-D/code-d/blob/master/docs/debugging.md).
try installing [CodeLLDB](https://marketplace.visualstudio.com/items?itemName= adimcn.vscode-lldb) ([openvsx](https://open-vsx.org/extension/vad mcn/vscode-lldb/)), it's usually a nice out-of-the-box experience with debugging on linux. It even downloads the debugger automatically and is the preferred auto-pick choice by code-d when using the `"code-d"` debug type on Linux.
Dec 12 2022
parent reply Mahdis <ubuntulove74 gmail.com> writes:
On Monday, 12 December 2022 at 19:11:37 UTC, WebFreak001 wrote:
 On Monday, 12 December 2022 at 16:50:53 UTC, Mahdis wrote:
 [...]
try installing [CodeLLDB](https://marketplace.visualstudio.com/items?itemName= adimcn.vscode-lldb) ([openvsx](https://open-vsx.org/extension/vad mcn/vscode-lldb/)), it's usually a nice out-of-the-box experience with debugging on linux. It even downloads the debugger automatically and is the preferred auto-pick choice by code-d when using the `"code-d"` debug type on Linux.
Thankful But this plugin needs to install lldb-mi for D language? I couldn't compile lldb-mi
Dec 13 2022
parent reply WebFreak001 <d.forum webfreak.org> writes:
On Tuesday, 13 December 2022 at 08:17:53 UTC, Mahdis wrote:
 On Monday, 12 December 2022 at 19:11:37 UTC, WebFreak001 wrote:
 On Monday, 12 December 2022 at 16:50:53 UTC, Mahdis wrote:
 [...]
try installing [CodeLLDB](https://marketplace.visualstudio.com/items?itemName= adimcn.vscode-lldb) ([openvsx](https://open-vsx.org/extension/vad mcn/vscode-lldb/)), it's usually a nice out-of-the-box experience with debugging on linux. It even downloads the debugger automatically and is the preferred auto-pick choice by code-d when using the `"code-d"` debug type on Linux.
Thankful But this plugin needs to install lldb-mi for D language? I couldn't compile lldb-mi
no, CodeLLDB does not need lldb-mi. It also automatically downloads LLDB, so you don't need to install anything. Native Debug needs lldb-mi, but it's not a great integration like CodeLLDB.
Dec 13 2022
parent reply Mahdis <ubuntulove74 gmail.com> writes:
On Tuesday, 13 December 2022 at 08:47:48 UTC, WebFreak001 wrote:
 no, CodeLLDB does not need lldb-mi. It also automatically 
 downloads LLDB, so you don't need to install anything.

 Native Debug needs lldb-mi, but it's not a great integration 
 like CodeLLDB.
The problem that occurred: could not find a process named /home/mahdis/PL/ProgrammingLanguage/test/a I did the launch.json settings in this way, but it doesn't work: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/main", "args": ["-arg1", "-arg2"], } ] } Can I see your launch.json settings?
Dec 13 2022
parent reply WebFreak001 <d.forum webfreak.org> writes:
On Tuesday, 13 December 2022 at 09:39:14 UTC, Mahdis wrote:
 On Tuesday, 13 December 2022 at 08:47:48 UTC, WebFreak001 wrote:
 no, CodeLLDB does not need lldb-mi. It also automatically 
 downloads LLDB, so you don't need to install anything.

 Native Debug needs lldb-mi, but it's not a great integration 
 like CodeLLDB.
The problem that occurred: could not find a process named /home/mahdis/PL/ProgrammingLanguage/test/a I did the launch.json settings in this way, but it doesn't work: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/main", "args": ["-arg1", "-arg2"], } ] } Can I see your launch.json settings?
I don't know where the `test/a` path comes from because your launch.json is `/main` at the end. This one should work: ``` { "type": "code-d", "request": "launch", "name": "Debug D project", "cwd": "${workspaceFolder}", "program": "./main" } ``` the "code-d" debug type just forwards to another debug extension. It picks the best one that is installed for the current platform. For Linux that is CodeLLDB.
Dec 13 2022
parent reply Mahdis <ubuntulove74 gmail.com> writes:
On Tuesday, 13 December 2022 at 09:48:30 UTC, WebFreak001 wrote:

 I don't know where the `test/a` path comes from because your 
 launch.json is `/main` at the end.

 This one should work:

 ```
 {
 	"type": "code-d",
 	"request": "launch",
 	"name": "Debug D project",
 	"cwd": "${workspaceFolder}",
 	"program": "./main"
 }
 ```

 the "code-d" debug type just forwards to another debug 
 extension. It picks the best one that is installed for the 
 current platform. For Linux that is CodeLLDB.
Sorry, I have a problem again, I made these settings, but it compiles, then the result is displayed and it stops: My launch.json settings: ``` { "type": "code-d", "request": "launch", "name": "Debug D project", "cwd": "${workspaceFolder}/source", "program": "./app", } ``` result in OUTPUT: ``` [Running] cd "/home/mahdis/PL/ProgrammingLanguage/newd/source/" && dmd app.d && "/home/mahdis/PL/ProgrammingLanguage/newd/source/"app 48 [Done] exited with code=0 in 1.408 seconds ``` result in DEBUG CONSOLE: ``` Launching: /home/mahdis/PL/ProgrammingLanguage/newd/source/app Launched process 11460 Process exited with code 0. ```
Dec 13 2022
parent reply WebFreak001 <d.forum webfreak.org> writes:
On Tuesday, 13 December 2022 at 10:22:02 UTC, Mahdis wrote:
 On Tuesday, 13 December 2022 at 09:48:30 UTC, WebFreak001 wrote:

 [...]
Sorry, I have a problem again, I made these settings, but it compiles, then the result is displayed and it stops: [...]
how are you compiling your app? If you run dmd manually, make sure to include the `-g` flag to enable debugging symbols (needed for debugging)
Dec 13 2022
parent Mahdis <ubuntulove74 gmail.com> writes:
On Tuesday, 13 December 2022 at 11:24:01 UTC, WebFreak001 wrote:
 how are you compiling your app? If you run dmd manually, make 
 sure to include the `-g` flag to enable debugging symbols 
 (needed for debugging)
Thanks, that was the problem. Solved with `-g` flag.
Dec 13 2022