vim-vdebug / vdebug

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

vdebug cannot support multiple simultaneous connections for php #227

Open zencodex opened 9 years ago

zencodex commented 9 years ago

frontend.php :

<?php
$personJson = file_get_contents('http://127.0.0.1:778/backend.php');
$person = json_decode($personJson);

var_dump($person);

backend.php :

<?php
class Person {
    public $Name;
    public $Email;
}

$person = new Person();
$person->Name = "Maarten";
$person->Email = "maarten.balliauw@jetbrains.com";

echo json_encode($person);

set a breakpoint in backend.php, vdebug won't break (Debugging session has ended).

see more details: https://confluence.jetbrains.com/display/PhpStorm/Simultaneous+debugging+sessions+with+PhpStorm#SimultaneousdebuggingsessionswithPhpStorm-1.Ensureadebuggersessionisstartedforchildrequests

BlackIkeEagle commented 9 years ago

This might be hard to achieve. But I think we first need full async vdebug to facilitate this. This would also mean this has to wait until 2.0 is out.

joonty commented 9 years ago

@BlackIkeEagle agreed, this would need a fully async vdebug before we could even start on this.

I was thinking about a similar problem, which is how to manage multi-threaded debugging, something that Xdebug technically supports (never tried it, and not even tried the pthreads module with PHP). Xdebug instructs you to open a new connection for each thread, which is the same problem as the one raised by @zencodex.

I think Vdebug could work pretty nicely with this in theory, as you could just have one tab per debugging session, and manage them independently. However, the unique window names and single connection paradigm that exists at the moment would make this fairly tricky.

I'll look into this with version 2, as that's going to introduce a load of breaking changes anyway.

Thanks for raising @zencodex.