View Issue Details

IDProjectCategoryView StatusLast Update
0001738XdebugStep Debuggingpublic2020-03-12 16:25
ReporterZoboAssigned Toderick 
PrioritynormalSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0001738: Ability to send text over stream.
DescriptionWhile attached to a php program with DBGp, I would like an option to stream arbitrary messages to the IDE over DBGp.

Use case: Framework tracing information in IDE.

DBGp defines "stdout" and "stderr" stream. Currently, there is no way to use "stderr", for example, with "error_log" or similar.

Propose function xdebug_stream_write(stream, text) that would enable the user to send text over an arbitrary stream. This could be complemented with xdebug_stream_create(stream) or similar.

Optionally a streamWrapper could be create for something like:
$s = fopen("dbgp://stderr", "w");
...
TagsNo tags attached.
Operating System
PHP Version7.4.0-7.4.4

Activities

Zobo

2020-01-23 14:28

reporter   ~0005223

PS: I'm willing to write a patch if this would be considered.

derick

2020-01-27 20:32

administrator   ~0005228

Hi,

I don't really see a reason why Xdebug could not have something for this, but I do not think that it should use the *stream* packet for this. The stream packet does not allow for arbitrary data formats, and is really only meant for stdout/stderr. The spec is currently vague on which other stream types are allowed (https://xdebug.org/docs/dbgp#stream has "stdout|stderr"). The stream packet would only be really useful for unstructured data in any case. What I think what instead should be used, is the "notify" functionality (https://xdebug.org/docs/dbgp#notifications and https://xdebug.org/docs/dbgp#notify). This allows for arbitrary XML children that can contain more structured data.

So I would suggest to add a `xdebug_notify()` method, where the first argument is the notification type (to be prefixed with "xdebug:" as notify's "name" element), the second argument the data (which could be send as base64 encoded data as TEXT data, with NULL allowed for none), and then optionally a third + fourth argument where the third is the name of the custom name space, and the fourth a string containing an XML element with the right custom data type. If you can come up with a different/better API, then I'm open for that as well. But the API/data packet MUST fit in the current DBGp protocol.

cheers,
Derick

Zobo

2020-02-03 11:55

reporter   ~0005235

Yes, notify would also be useful. However I still like the simple "line based text" approach of stream. I'm not sure if there is a way to hook into STDERR, but, do you think redirecting error_log to that stream? I would also guess that some IDEs could have the stream function already implemented, whereas the notify option would require a tight protocol integration between the php code and IDE...

Issue History

Date Modified Username Field Change
2020-01-23 14:25 Zobo New Issue
2020-01-23 14:28 Zobo Note Added: 0005223
2020-01-27 20:32 derick Assigned To => derick
2020-01-27 20:32 derick Status new => feedback
2020-01-27 20:32 derick Note Added: 0005228
2020-02-03 11:55 Zobo Note Added: 0005235
2020-02-03 11:55 Zobo Status feedback => assigned
2020-03-12 16:23 derick Severity minor => feature
2020-03-12 16:25 derick Category Feature/Change request => Remote Debugging
2020-03-12 16:33 derick Category Remote Debugging => Step Debugging