SublimeXdebug icon indicating copy to clipboard operation
SublimeXdebug copied to clipboard

Freature request: Watch expressions

Open netbrain opened this issue 11 years ago • 5 comments

Add a way to set watch expressions. I work quite a bit with legacy code, and the context could hold several hundred variables. Watch expressions would be a welcomed feature to limit the variable list.

netbrain avatar Jun 10 '13 08:06 netbrain

Unfortunately the 'watch' breakpoint types are not supported by DBGP protocol. (source)

201 - breakpoint type not supported (for example I don't support 'watch' yet and thus return this error)

martomo avatar Jun 21 '13 19:06 martomo

Hmm, then how does Eclipse do it (Using xdebug with the PDT package)?

cstuder avatar Jul 29 '13 14:07 cstuder

@cstuder What you are talking about is a conditional breakpoint, you are able to define an expression for a breakpoint when to stop.

For example you set a breakpoint in C:\wamp\www\wordpress\wp-settings.php on line 72 and you only want to stop the script when the expression $wp_version=='3.5.2' is true.

breakpoint_set -i 7 -n 72 -t line -f file%3A//C%3A%5Cwamp%5Cwww%5Cwordpress%5Cwp-settings.php -- JHdwX3ZlcnNpb249PSczLjUuMic=

martomo avatar Jul 29 '13 16:07 martomo

@martomo: No, we're talking about manually entered watch expressions. These expressions are evaluated every time we stop at a breakpoint:

watchexpressions

They can be very, very useful, especially when the local scope is getting out of hand.

cstuder avatar Jul 30 '13 06:07 cstuder

@cstuder I have added an initial commit martomo/SublimeTextXdebug@9484168838051f29123b8b6c24eb4b9911a3e776 for this feature to SublimeTextXdebug, please let me know what you think. I still have to fine tune it some more, enable/disable watch expressions, remove single watch expression instead of having to clear/delete them all.

martomo avatar Aug 04 '13 01:08 martomo