Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debugger alias for exec(expr) #41794

Closed
morenoh149 opened this issue May 26, 2018 · 1 comment
Closed

Add debugger alias for exec(expr) #41794

morenoh149 opened this issue May 26, 2018 · 1 comment
Labels
debugger Issues and PRs related to the debugger subsystem. feature request Issues that request new features to be added to Node.js. good first issue Issues that are suitable for first-time contributors.

Comments

@morenoh149
Copy link

node v9.8.0
In the debugger you can quickly inspect the value of a variable at run-time using exec. Given

// test.js
var a = 1
$ node inspect test.js
< Debugger listening on ws://127.0.0.1:9229/4565e728-272a-497d-a3f8-73b03362df0f
< For help see https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in test.js:1
> 1 (function (exports, require, module, __filename, __dirname) { var a = 1
  2
  3 });
debug> n
break in test.js:1
> 1 (function (exports, require, module, __filename, __dirname) { var a = 1
  2
  3 });
debug> n
break in test.js:3
  1 (function (exports, require, module, __filename, __dirname) { var a = 1
  2
> 3 });
debug> exec('a')
1
debug> .exit

To more quickly debug an application it would be nice to alias exec to e or p so one can do

debug> p('a')
1

Even better if the expression could be passed without parens and quotes

debug> p a
1

This is in the same spirit as when pressing Enter the debugger will repeat the previous command.
From #20963

@jkrems
Copy link
Contributor

jkrems commented Jan 31, 2022

Moving back to node since the code was merged into node itself. I think p a would be a reasonable short-hand to add though it would require somebody to send a PR to implement it.

@jkrems jkrems transferred this issue from nodejs/node-inspect Jan 31, 2022
@jkrems jkrems added debugger Issues and PRs related to the debugger subsystem. feature request Issues that request new features to be added to Node.js. good first issue Issues that are suitable for first-time contributors. labels Jan 31, 2022
nodejs-github-bot pushed a commit that referenced this issue Feb 17, 2022
#41794

PR-URL: #41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
nodejs#41794

PR-URL: nodejs#41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
bengl pushed a commit to bengl/node that referenced this issue Feb 21, 2022
nodejs#41794

PR-URL: nodejs#41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
bengl pushed a commit that referenced this issue Feb 21, 2022
#41794

PR-URL: #41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
bengl pushed a commit that referenced this issue Feb 21, 2022
#41794

PR-URL: #41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
bengl pushed a commit that referenced this issue Feb 22, 2022
#41794

PR-URL: #41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams pushed a commit to danielleadams/node that referenced this issue Apr 21, 2022
nodejs#41794

PR-URL: nodejs#41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams pushed a commit that referenced this issue Apr 24, 2022
#41794

PR-URL: #41907
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger Issues and PRs related to the debugger subsystem. feature request Issues that request new features to be added to Node.js. good first issue Issues that are suitable for first-time contributors.
Projects
None yet
Development

No branches or pull requests

4 participants
@jkrems @morenoh149 @Mesteery and others