Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Support for conditional breakpoints #68

Closed
CADBOT opened this issue Jun 7, 2019 · 2 comments
Closed

Support for conditional breakpoints #68

CADBOT opened this issue Jun 7, 2019 · 2 comments

Comments

@CADBOT
Copy link

CADBOT commented Jun 7, 2019

I would love to see support for conditional breakpoints. I know the typical advise would be to use a more full-featured debugger, but I vastly prefer the command line debugging experience to having to tab over the chrome.

@copperwall
Copy link

It looks like a condition is already supported as the third parameter to setBreakpoint

$ npx node-inspect script.js
< Debugger listening on ws://127.0.0.1:9229/749eeb8d-ad81-41e1-87fb-6bc4ab4fda8b
< For help, see: https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in script.js:2
  1 'use strict';
> 2 console.log(1);
  3
  4 console.log(2)
debug> setBreakpoint('script.js', 4, 'typeof a !== \'undefined\'')
  1 'use strict';
  2 console.log(1);
  3
> 4 console.log(2)
  5
debug> cont
< 1
< 2
< Waiting for the debugger to disconnect...
debug>

https://github.com/nodejs/node-inspect/blob/master/lib/internal/inspect_repl.js#L642

Trott pushed a commit to Trott/io.js that referenced this issue Oct 29, 2020
The `node-inspect` debugging client supports passing an optional third
parameter as a string to be evaluated when the breakpoint is hit. If the
condition evaluates to `true` in the current context, the breakpoint
pauses execution; otherwise the execution continues.

This was raised as an issue in
nodejs/node-inspect#68, but the client already
supports that functionality, so I thought it'd be helpful to add it to
the node documentation.

PR-URL: nodejs#35823
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
targos pushed a commit to nodejs/node that referenced this issue Nov 3, 2020
The `node-inspect` debugging client supports passing an optional third
parameter as a string to be evaluated when the breakpoint is hit. If the
condition evaluates to `true` in the current context, the breakpoint
pauses execution; otherwise the execution continues.

This was raised as an issue in
nodejs/node-inspect#68, but the client already
supports that functionality, so I thought it'd be helpful to add it to
the node documentation.

PR-URL: #35823
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
BethGriggs pushed a commit to nodejs/node that referenced this issue Dec 8, 2020
The `node-inspect` debugging client supports passing an optional third
parameter as a string to be evaluated when the breakpoint is hit. If the
condition evaluates to `true` in the current context, the breakpoint
pauses execution; otherwise the execution continues.

This was raised as an issue in
nodejs/node-inspect#68, but the client already
supports that functionality, so I thought it'd be helpful to add it to
the node documentation.

PR-URL: #35823
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
BethGriggs pushed a commit to nodejs/node that referenced this issue Dec 10, 2020
The `node-inspect` debugging client supports passing an optional third
parameter as a string to be evaluated when the breakpoint is hit. If the
condition evaluates to `true` in the current context, the breakpoint
pauses execution; otherwise the execution continues.

This was raised as an issue in
nodejs/node-inspect#68, but the client already
supports that functionality, so I thought it'd be helpful to add it to
the node documentation.

PR-URL: #35823
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
BethGriggs pushed a commit to nodejs/node that referenced this issue Dec 15, 2020
The `node-inspect` debugging client supports passing an optional third
parameter as a string to be evaluated when the breakpoint is hit. If the
condition evaluates to `true` in the current context, the breakpoint
pauses execution; otherwise the execution continues.

This was raised as an issue in
nodejs/node-inspect#68, but the client already
supports that functionality, so I thought it'd be helpful to add it to
the node documentation.

PR-URL: #35823
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
@Trott
Copy link
Member

Trott commented Aug 4, 2021

It seems like this can be closed, but if I'm mistaken about that, please comment. Thanks.

@Trott Trott closed this as completed Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants