Author Topic: DAP debug plugin testing  (Read 9075 times)

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
DAP debug plugin testing
« on: August 03, 2022, 08:21:14 am »
ALL OS's
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:
MACOS
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.

WINDOWS

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 CB_install_Local_Build.sh 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:https://github.com/acotty/CodeBlocks_Unofficial_Testing
« Last Edit: August 03, 2022, 08:23:07 am by AndrewCot »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: DAP debug plugin testing
« Reply #1 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?

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: DAP debug plugin testing
« Reply #2 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:
  • The Windows NSIS installer is missing all of the new files/changes/updates since the 20.03 and I have given up trying to get my NSIS updates included as it is way too hard and would take me way too much of my time to explain every change I made in the NSIS script (the existing installer has two NSIS scripts that have been merged into one that uses a parameter to build either a 32 or 64 bit installer)
  • As per a previous email someone would need to run with getting the source into the CB SF tree
  • Someone would need to either update the existing projects to use global variables for all three OS's and hook up the new plugin project files into the workspaces. This assumes that some one  has merge in the MAC workspace and project files that do not exist at the moment (there is a SF ticket for this, but no one has looked at it). This way all three workspace's have the plugin.
  • Someone would need to update the make process to incorporate the plugin makefile.am and include the zip & two DLL's into the output files.
  • Someone would need to update the WIKI page for the new DAP plugin.
  • If you want the DAP debugger automatically detected and added in then you will need other changes (there is a SF ticket for the base work). There are additional changes for the DAP debugger in the clang compiler XML file and a few additional changes as the DAP debugger is not GDB.
  • The biggest one for other devs to test it on various MAC's. Testing on Windows and Linux is not where the DAP plugin will be used the most as there is no GDB DAP debugger available and the LLDB debugger on Windows may not be feature complete compared to the MAC version. I do not know the status of the Linux version, but would assume it's between the other two.
  • There is one or two minor (few lines) other changes needed in the SF truck if you just want to try the plugins, but I cannot remember what they were as I did them a while ago. They will cause a link fail or some debugging feature to fail.
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.


Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: DAP debug plugin testing
« Reply #3 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 Readme.md and Readme_DAP_setup.md 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.
Readme.md

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: DAP debug plugin testing
« Reply #4 on: September 05, 2022, 06:46:57 pm »
@Andrew
I downloaded https://github.com/acotty/codeblocks_sfmirror/archive/refs/heads/DAP_Debugger.zip

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

TIA

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: DAP debug plugin testing
« Reply #5 on: September 06, 2022, 12:29:39 am »
You need to include both of the following project files in the sub directories:
  • Debugger_DAP\Debugger_DAP_wx32_64.cbp
  • DebugAdapterProtocol\dapcxx_codeblocks_wx32_64.cbp
In the CodeBlocks_wx32_64.workspace file has the two project files added includign the dependency as follows:

Code
        <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" />
        </Project>
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 Readme-DAP_setup.md 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.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: DAP debug plugin testing
« Reply #6 on: September 06, 2022, 08:56:41 pm »
@Andrew

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.

« Last Edit: September 08, 2022, 12:16:36 am by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: DAP debug plugin testing
« Reply #7 on: September 07, 2022, 09:16:17 pm »

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


Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: DAP debug plugin testing
« Reply #8 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 Readm_DAP_setup.md 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           | https://github.com/llvm/llvm-project      |
| .\extension\adapter\codelldb.exe      | https://github.com/vadimcn/vscode-lldb    |


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: DAP debug plugin testing
« Reply #9 on: November 28, 2022, 11:25:04 pm »
How do I watch a wxString?
int values show as ints but wxString values show a an address, not its value.
« Last Edit: November 29, 2022, 06:43:13 am by Pecan »