[xdebug-dev] Re: What commands can be sent during run state?

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Tue, 19 Jul 2016 10:21:35 +0100 (BST)

Hi Jeffrey,

(I've moved all the others to the xdebug-dev list as well, so they'll
see the reply too.)

On Mon, 18 Jul 2016, Jeffrey Tan wrote:

> The xdebug documentation is a bit vague on this part. What are the
> commands that can be sent during run state?
>
> Currently hhvm is implemented that only async “break” command can be
> sent during run state.

The protocol specs
(https://xdebug.org/docs-dbgp.php#packet-communications) say:

        If the debugger engine *supports asynchronous commands*, the IDE may
        also send commands while the debugger engine is in a 'run' state.
        These commands should be limited to commands such as the 'break' or
        'status' commands for performance reasons, but this protocol does
        not impose such limitations. The debugger engine MUST respond to
        these commands *prior* to responding to the original 'run' command.

However, the intention is that the sending of async commands is limited
to the two mentioned in the above paragraph. HHVM currently just doing
an async break, sounds like it is in the spirit of the protocol. I am
happy to amend the wording so that this is explicitly mentioned in the
protocol specs.

I would also not mind adding breakpoint_set to the list of allowed
commands, but anything that retrieves data, or variables, should
probably not be in there, because of the mentioned performance reasons.

> This caused problems in our IDE because user may set breakpoints in
> run state, but all the breakpoint_xxx commands are ignored by hhvm.
> The result is that these “run state” set breakpoints are not taking
> effect.
>
> I am going to change hhvm xdebug implementation to allow
> breakpoint_xxx commands in run state. Let me know if you agree with
> this.

I don't think that's a good idea, but you also don't need to. You can
always issue a *break* command first. When the debugger engine then
breaks, you can issue the breakpoint_* commands (or any other command).

> Is there a white/black list of commands that allowed/not-allowed in
> run state? Thanks.

There isn't any list. Maybe we should make one?

However, don't expect debugger engines *or* IDEs
to support async mode. You *have* to test for that with a feature_get
command (https://xdebug.org/docs-dbgp.php#feature-names). If you want
the HHVM debugger engine to be used with standard available IDEs, you
can not rely on these IDEs to support asynchronous communications.

cheers,
Derick

-- 
https://derickrethans.nl | https://xdebug.org | https://dram.io
Like Xdebug? Consider a donation: https://xdebug.org/donate.php
twitter: @derickr and @xdebug
Received on Tue Jul 19 2016 - 10:21:35 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:04 BST