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

"Display"/"Console" view for ad-hoc evaluation of javascript expressions similar to the Display view for Java #101

Open
skybrian opened this issue Jan 16, 2015 · 5 comments

Comments

@skybrian
Copy link

Unless I missed it, it looks like the sdbg console only supports displaying output written to the console. It would be useful to also be able to evaluate expression, similar to the console in a web browser.

In the remote debugging protocol, the commands are Runtime.evaluate [1] and possibly evaluateOnCallFrame [2] if you're stopped at a breakpoint.

[1] https://developer.chrome.com/devtools/docs/protocol/tot/runtime#command-evaluate

[2] https://developer.chrome.com/devtools/docs/protocol/tot/debugger#command-evaluateOnCallFrame

@ivmarkov
Copy link
Contributor

Use the Eclipse "Expressions" view:
expressions

@skybrian
Copy link
Author

Watched variables are useful but not the same, actually, since they don't work for expressions with side effects. For example, if I evaluate element.appendChild(), it shouldn't be reevaluated on each step when stepping through code.

Also, evaluating an expression at the console is useful in a different way because it keeps a history of the previous values of the expression and this is interleaved with log statements.

@ivmarkov
Copy link
Contributor

I think what you want then is the Display view in Eclipse. However, it works only for Java code. I think we need a custom Display view which works for JavaScript code then. I'll reopen this issue and reformulate accordingly

@ivmarkov ivmarkov reopened this Jan 17, 2015
@ivmarkov ivmarkov changed the title console should support evaluating javascript expressions Display view for ad-hoc evaluation of javascript expressions similar to the Display view for Java Jan 17, 2015
@ivmarkov ivmarkov changed the title Display view for ad-hoc evaluation of javascript expressions similar to the Display view for Java "Display"/"Console" view for ad-hoc evaluation of javascript expressions similar to the Display view for Java Jan 17, 2015
@ivmarkov
Copy link
Contributor

On a second thought, it can also be useful indeed if the Eclipse SDBG Console is extended to a real REPL display....
I guess I'm just too used to the Eclipse Java way, where you write your expression in the Display view and then if they have printing side effects, you get them on the Java console, which is a separate view...

ivmarkov added a commit to ivmarkov/sdbg that referenced this issue Jan 17, 2015
something to base the Display/Console REPL view on
@skybrian
Copy link
Author

Yes, JavaScript developers are used to having a real REPL in their debugger. I think sdbg should aim to be a good Java debugger and a good JavaScript debugger, since GWT programs contain both Java and JavaScript.

ivmarkov added a commit that referenced this issue Jan 21, 2015
ivmarkov added a commit to ivmarkov/sdbg that referenced this issue May 25, 2015
keinhaar pushed a commit to keinhaar/sdbg that referenced this issue Oct 11, 2022
something to base the Display/Console REPL view on
keinhaar pushed a commit to keinhaar/sdbg that referenced this issue Oct 11, 2022
keinhaar pushed a commit to keinhaar/sdbg that referenced this issue Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants