Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: AndrewCot on August 03, 2022, 08:21:14 am

Title: DAP debug plugin testing
Post by: AndrewCot on August 03, 2022, 08:21:14 am
Please read the following doc for what works:
Please read the following doc for my install notes:Google Drive Download
While testign you can downlaod the files from the follwoing google drive:
If anyone wants to test the DAP debug plugin on Big Sur I have uploaded the DMG to the MAC sub directory.Before dragging C::B onto the finder application window I rename the exisitng C::B nightly to CodeBlocks_Nightly and after dragging the DAP C::B I rename it to CodeBlocks_DAP and update if I have dragged them anywhere.


If you want to try it on Windows then there is a Windows installer that installs into the C:\Program Files\CodeBlocks_Experimental directory by default and the config data is stored in the C:\Users\<username>\AppData\Roaming\CodeBlocks-Experimental directory. As such it can be installed parallel to the latest nightly and not affect the nightly.

LINUX - Debian 12 or Ubuntu 22.04 or LM 21

If you want to try it on Debian 12 or Ubuntu 22.04 or LM 21 (may work on 11, 20.04 or 20, but I have not tried) then there are deb files, but use them at your own risk and they will overwrite any existing C:B install. There is a scrip that I use to install the files on my LM 21.0 VirtualBox OS.

Bugs/Issues/Missing Functionality Feedback

Do not report issues or bugs or something is missing if in the following doc it is marked as fail, future or blank:Please report issues or bugs in the following github repo:
If you want to ask questions please start a discussion in the following github repo:
Title: Re: DAP debug plugin testing
Post by: BlueHazzard on August 03, 2022, 09:52:42 am
Thank you  a lot for your work!!!
I will test as soon as possible.

On a side note: Do you have any idea how we can distribute this on a release? On windows we probably have to provide the language server executables? (The same for the language server code completion i guess?) On linux we could probably depend on some packages?
Title: Re: DAP debug plugin testing
Post by: AndrewCot on August 03, 2022, 11:35:05 am
I would read the following doc for my install notes:To distribute it on a release there is allot of work that needs to be done, such as the following:My repo has all of the items with exception of the MAC testing in the list above. I do not have time to back port the plugin to work with the stock SF source tree. I will take the time to go over my SF tickets based on the oldest chronological order first as my source tree is based on all of the tickets I have entered in SF with the exception of this DAP work.

Title: Re: DAP debug plugin testing
Post by: AndrewCot on September 02, 2022, 11:34:04 am
If you want to play with the DAP plugin you can grab the source from the following github repo branch that are based on the SF C::B sources:The plugin is in the src\plugins\contrib\Debugger_DAP sub directories and is hooked into the src\workspace files and for the Mac and Linux command line builds it also has the changes in the build files. If you want to use the workspace/project build process on a MAC then please ask and I will give you the process of getting it setup for you to build as it is not available in the C::B SF SVN repo.
To be able to view structures you will need to incorporate the change in the src/src/watchesdlg.cpp as per the following post:
To see what works and what does not work or has not been tested please check out the following doc:
To see how to setup and configure the DAP debugger check out the following doc (needs some editorial tweaking):
Make sure you read the and doc askign any questions or raising any issues as I will be ignoring any posts where the answers are in the docs or the docs indicate not to raise an issue as it has not been tested or the functionality is not available yet.
Title: Re: DAP debug plugin testing
Post by: Pecan on September 05, 2022, 06:46:57 pm
I downloaded

I'm compiling Debugger_DAP\Debugger_DAP\Debugger_DAP_wx32_64.cbp
It fails to to link in debugger_wxdap.
Where is this file?

Title: Re: DAP debug plugin testing
Post by: AndrewCot on September 06, 2022, 12:29:39 am
You need to include both of the following project files in the sub directories:In the CodeBlocks_wx32_64.workspace file has the two project files added includign the dependency as follows:

        <Project filename="plugins/contrib/Debugger_DAP/DebugAdapterProtocol/dapcxx_codeblocks_wx32_64.cbp" />
        <Project filename="plugins/contrib/Debugger_DAP/Debugger_DAP/Debugger_DAP_wx32_64.cbp">
            <Depends filename="CodeBlocks_wx32_64.cbp" />
            <Depends filename="plugins/contrib/Debugger_DAP/DebugAdapterProtocol/dapcxx_codeblocks_wx32_64.cbp" />
If you are manually merging or building the projects then you need to build the "Debugger WXDAP DLL" first and then the "Debugger DAP Plugin wx3.2.x (64 bit)". There are changes required in the core to get some of the functionality working. I hope that one of the changes I may not need due to the breakpoint move update I need to do, but the compilergcc changes are needed for Windows (see the Windows item 3 for the list of files changed).

I fixed more issues yesterday I found during the Linux and Mac testing.  I still have two bugs, console output and breakpoint move (add remove lines) that I want to fix before the first release is feature complete. There is an issue with the breakpoint dialog context menu that I have no idea about.
Title: Re: DAP debug plugin testing
Post by: Pecan on September 06, 2022, 08:56:41 pm

Thanks, I'm now making progress.
FYI, /.svn has to be a child of /trunk in order for autorevision to work.
For unknown reasons (to me)  a directory junction doesn't work, but a
copy of the .svn folder does.

Title: Re: DAP debug plugin testing
Post by: Pecan on September 07, 2022, 09:16:17 pm

Whats the magic to get "\msys64\mingw64\bin\lldb-vscode.exe" into my msys64 folder?

Title: Re: DAP debug plugin testing
Post by: AndrewCot on September 08, 2022, 12:11:17 am
Thanks. I missed the instructions for this. I have created and added the following table to the file locally and will check the Mac and Linux sections to ensure I have hopefully included the similar install info:

On Windows the following table shows the installation package to install:

|         DAP Adapter                   | Install package/URL
|:------------------------------------- |:----------------------------------------- |
| C:\msys64\mingw64\bin\lldb-vscode.exe | pacman -S mingw-w64-clang-x86_64-lldb     |
| C:\msys64\clang64\bin\lldb-vscode.exe | pacman -S mingw-w64-x86_64-lldb           |
| C:\msys64\mingw32\bin\lldb-vscode.exe | pacman -S mingw-w64-i686-lldb             |
| C:\msys64\clang32\bin\lldb-vscode.exe | pacman -S mingw-w64-clang-i686-lldb       |
| C:\llvm\bin\lldb-vscode.exe           |      |
| .\extension\adapter\codelldb.exe      |    |