Open
Bug 795916
Opened 12 years ago
Updated 2 years ago
Support evaluating multiple client expressions at once
Categories
(DevTools :: Debugger, task, P5)
Tracking
(Not tracked)
NEW
People
(Reporter: Honza, Unassigned)
References
(Blocks 1 open bug)
Details
The remote protocol uses "clientEvaluated" packet to evaluate an expression on the back-end. Since the evaluation invalidates all pause-life-time grips - including previously evaluated expression - this way can't be used if there is more expressions (e.g. in the Watch panel). There should be a way how to evaluate more expression at once (using one round trip and one resume-pause trip) and get all the results back in an array. Honza
Comment 1•12 years ago
|
||
(In reply to Jan Honza Odvarko from comment #0) > The remote protocol uses "clientEvaluated" packet to evaluate an expression > on the back-end. Since the evaluation invalidates all pause-life-time grips > - including previously evaluated expression - this way can't be used if > there is more expressions (e.g. in the Watch panel). > > There should be a way how to evaluate more expression at once (using one > round trip and one resume-pause trip) and get all the results back in an > array. > > Honza I think we discussed some workaround for this last week. Is there some inherently wrong with doing: clientEvaluate("[eval('first expression'), eval('second expression', ...]") However, I do agree that this is far from ideal and not convenient.
Comment 2•12 years ago
|
||
Yes, I thought that we were confident that using the array form wouldn't present us with any problems. If Jim likes adding a separate packet as sugar around that, I'm not going to complain though.
Reporter | ||
Comment 3•12 years ago
|
||
Just to note that Victor's idea works for me as well. So, let's see what's Jim's opinion. Honza
Comment 5•12 years ago
|
||
What should happen when one of the 'eval' expressions causes a breakpoint hit?
Flags: needinfo?(jimb)
Comment 6•12 years ago
|
||
The answer might be, "We abort evaluation of that expression, and proceed to the next."
Comment 7•12 years ago
|
||
Similarly, what should happen if some of the expressions throw? What's the user-visible behavior we're going for here?
Comment 8•12 years ago
|
||
Here is the current implementation of this idea in Firefox: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger-controller.js#921 I think we could improve error handling a bit by returning the error object instead of a string, but that seems to work. I hadn't thought about hitting a breakpoint though. Trying it out shows that we have some bugs in there to fix. I want to say that we should not add any smarts to the server and just treat such a breakpoint hit as a regular one, but I'm afraid that might uncover other potential gotchas that I haven't thought of.
Comment 9•12 years ago
|
||
(In reply to Panos Astithas [:past] from comment #8) > I hadn't thought about hitting a breakpoint though. Trying it out shows that > we have some bugs in there to fix. Filed bug 815537 about this.
Comment 10•12 years ago
|
||
This is a little perverse, but: I think that code won't cope well with expressions like: throw { get name() { throw "Another error" } }
Comment 11•12 years ago
|
||
(In reply to Jim Blandy :jimb from comment #10) > This is a little perverse, but: I think that code won't cope well with > expressions like: > > throw { get name() { throw "Another error" } } The code tries (in its primitive ways) to guard itself from faulty expressions, when the client evaluation throws: http://mxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger-controller.js#506
Comment 12•12 years ago
|
||
Okay, so it'll just drop that watch expression.
Updated•10 years ago
|
Summary: It should be possible to evaluate more client expression at once. → Support evaluating multiple client expressions at once
Updated•10 years ago
|
Depends on: dbg-inspect
Updated•10 years ago
|
Blocks: dbg-inspect
No longer depends on: dbg-inspect
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•5 years ago
|
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•