svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
448 stars 25 forks source link

Trying to setup xdebug with dape. #127

Closed damien-biasotto closed 1 month ago

damien-biasotto commented 1 month ago

First of all thank you for this amazing project, I'm using it for debugging remote java application in emacs.

I know xdebug is not officially supported but I wanted to try my luck, I'm trying to setup a xdebug via Dape to debug a php application running in a docker container.

The setup of xdebug is working fine, I can debug the same application via IntelliJ.

I had a look on how dap-php was initialing the debugger server, and setup the dape config according ly.

I do not have any error when the debug session start, but the debugging does not occur.

Here is my current config:

  (add-to-list
     'dape-configs
     `(rezdy-php
       modes (php-mode php-ts-mode)
       hostname "localhost"
       port 4711
  :workspaceFolder "/path/to/php/src"
       :request "launch"
command "node"
       command-args ("/path/to/vscode/extensions/xdebug.php-debug/out/phpDebug.js" "--server=4711" )
:projectName "php"
    :pathMappings (:/var/www "/path/to/php/src")
       :hostname "localhost"
       :port 9003
       :type "php"))

And here is the log of the dape-server upon starting the debug session:

waiting for debug protocol on port 4711
>> accepted connection from client

Given I have no errors, I was wondering if there is a way to increase dape verbosity?

svaante commented 1 month ago

Hey I added an config and install instructions in the Readme. Have only tested by stepping through hello_world.php.

Got it working by adding the following php ini

zend_extension=xdebug
xdebug.mode = debug
xdebug.start_with_request = yes

Starting adapter with the new added config named xdebug then running hello_world.php from the terminal.

damien-biasotto commented 1 month ago

Awesome it works :)