vim-vdebug / vdebug

Multi-language DBGP debugger client for Vim (PHP, Python, Perl, Ruby, etc.)
MIT License
1.3k stars 156 forks source link

Open the debug without any stacktrace #403

Open Mte90 opened 5 years ago

Mte90 commented 5 years ago

Screenshot_20190628_214225 I am trying with https://github.com/Varying-Vagrant-Vagrants/VVV to get running vDebug. The issue is with this very basic settings:

let g:vdebug_options = {
    \    'break_on_open' : 0,
    \    'ide_key' : 'VVVDEBUG'
    \}
let g:vdebug_options.path_maps = {"/srv/www/": "/home/mte90/Desktop/VVV/www/"}

I see the page on loading and after a while open as show in the screenshot without any way to interact with the information. It's not clear to me what is missing to get working everything. If I use other tools the connection and debugging is working.

Mte90 commented 5 years ago

any hint for help with the debugging?

BlackIkeEagle commented 5 years ago

1st thing you can do to check if something is working is to enable break_on_open

Mte90 commented 5 years ago

Removing break_on_open I get it working (I am on another computer): immagine

but with wordpress is useless...

BlackIkeEagle commented 5 years ago

I'm not sure what you mean with

but with wordpress is useless...

If I can guess, you mean nothing happens in wordpress, then that sounds normal, because you are blocking further execution?

Mte90 commented 5 years ago

Sorry for the misunderstoonding. I mean that break_on_open in wordpress is useless, so is better to disable it but in that way vdebug is not working for me.

Mte90 commented 5 years ago

I saw the new commits, so I wanted to try the new changes but the result is similar. immagine

Mte90 commented 5 years ago

I am not sure that the latest changes to the plugin help with my issue, there are any kind of debugging that I can do to understand what is happening?

BlackIkeEagle commented 5 years ago

The changes are unrelated to your issue. I'm going to look into it with time.

Mte90 commented 5 years ago

Let me know how I can help, I am available to investigate in the code but I have no glue how works xDebug. This issue is blocking me to use vim as daily tool and improve also my dev workflow.

determin1st commented 5 years ago

With xDebug, you can use xdebug_break(); where you need to break on.

Mte90 commented 5 years ago

Thanks for the hint, with that xDebug works as intended with vdebug!

If I try to put breakpoints in vim they are not reconized. At least I found a way to use it, thanks a lot!

heylookltsme commented 4 years ago

I'm having this same issue. Setting a break point with vdebug opens the the debugger with no output and then a message right away that says "waiting for a connection: none found so far". And if I try to use the step commands I get, "Step over is only possible when Vdebug is running."

Using xdebug_break() instead works as expected. 👍

Please let me know if I can provide more information that would be helpful.

Mte90 commented 4 years ago

As I am trying to get a xdebug dev environemnt that works I am doing more tests, with pugdebug I am able to use breakpoints https://github.com/Mte90/pugdebug but with vdebug doesn't work, except when xdebug_break()is used.

So my guess is that vdebug is not sending or reading right some information that instead with that command are right. Can someone help on debugging and giving some hints? I can try to patch vdebug on my own with more information, because this bug is stopping me to use vim at 100% since few years.

Mte90 commented 4 years ago

I am having the same issue with https://github.com/puremourning/vimspector that use https://github.com/felixfbecker/vscode-php-debug

If I mark a breakpoint is not working but with xdebug_break() everything is fine.

Mte90 commented 4 years ago

This is what I get in the vdebug log output when that issue happens:

- [Info] {Mon 14 2020 16:48:35} Closing the connection
- [Debug] {Mon 14 2020 16:48:35} Command: stop -i 1
- [Debug] {Mon 14 2020 16:48:35} Response: <?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="1" status="stopped" reason="ok"></response>
- [Debug] {Mon 14 2020 16:48:35} Closing the socket
- [Debug] {Mon 14 2020 16:48:35} Closing the socket
- [Debug] {Mon 14 2020 16:48:35} keymapper: unmap
- [Debug] {Mon 14 2020 16:48:35} Closing the socket

Seems like that after launching the connection is stopped by vdebug itself before to get something from xdebug.

Xdebug log:

[6280] Log opened at 2020-09-14 14:48:31
[6280] I: Connecting to configured address/port: 192.168.50.1:9000.
[6280] I: Connected to client. :-)
[6280] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///srv/tideways-header.php" language="PHP" xdebug:language_version="7.1.33-16+ubuntu18.04.1+deb.sury.org+1" protocol_version="1.0" appid="6280" idekey="VVVDEBUG"><engine version="2.9.6"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2020 by Derick Rethans]]></copyright></init>

[6280] <- stop -i 1
[6280] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="1" status="stopped" reason="ok"></response>

[6280] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="1" status="stopping" reason="ok"></response>
BlackIkeEagle commented 4 years ago

@Mte90 is there a simple way to reproduce this? because I'm only seeing this empty stacktrace situation when xdebug got connected but there was no breakpoint hit.

Mte90 commented 4 years ago

The point is that a breakpoint is configured inside vim but seems that vdebug is ignoring it

BlackIkeEagle commented 4 years ago

Yes, I get the point, but I have not yet been able to reproduce it in any way. So I was wondering if you would be able to provide a simple enough example where it happens so that I can pinpoint what goes wrong.

Mte90 commented 4 years ago

Well I am getting when using https://github.com/Varying-Vagrant-Vagrants/VVV/ with xdebug enabled, so I don't have any tiny environment to replicate... That was the reasons I tried to investigate, if you can give me some hints in the code I can take a look again

Mte90 commented 3 years ago

I did a bounty of 15$ for this ticket https://www.bountysource.com/issues/76208208-open-the-debug-without-any-stacktrace

I am available for debugging.