yinxianwei / chromedevtools

Automatically exported from code.google.com/p/chromedevtools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

If value of a variable is changed when debugger is suspended old value is always returned from DebugContext #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Google Chrome version: 11.0.696.50 beta
SDK + Eclipse Debugger version(s): 0.2.2
OS + version: Ubuntu 10.10

What steps will reproduce the problem?
1. Connect to Chrome instance using the API, set a breakpoint in some file.
2. When the breakpoint is reached, obtain value of some local variable 
from DebugContext using getCallFrames(), getVariablesScopes(), getVariables() 
methods.
3. Change value of the variable using 
CallFrame#getEvaluateContext().evaluateAsync("varName=newvalue",...) method 
call.
4. When value is changed try to obtain value of the variable from the 
DebugContext.

What is the expected result?

There should be a way to clear caches of DebugContext to fetch the new value.

What happens instead?

The cached old value is always returned.

Please provide any additional information below. If possible, attach a
(reduced) test-case.

It would be sufficient to add clearCaches() method to DebugContext class. 
However I think it would be better to automatically clear caches when methods 
like 'evaluateAsync' or JsVariable#setValue are called. I suppose there're not 
too much ways to change values when the debugger is suspended.

Original issue reported on code.google.com by nikolay....@gmail.com on 19 Apr 2011 at 10:30

GoogleCodeExporter commented 8 years ago

Original comment by peter.ry...@gmail.com on 19 Apr 2011 at 5:53

GoogleCodeExporter commented 8 years ago
Fixed in HEAD
( jsObject.getRemoteValueMapping().clearCaches() )

Original comment by peter.ry...@gmail.com on 11 Jul 2011 at 8:43

GoogleCodeExporter commented 8 years ago
Fixed in 0.3.0

Original comment by peter.ry...@gmail.com on 19 Aug 2011 at 10:37

GoogleCodeExporter commented 8 years ago
Is there a way to clear caches for local variables? For example if I have an 
'int' local variable, obtain its value using JsScope#getVariables, 
JsVariable#getValue methods and then assign a new value to that variable the 
old value is always returned from the DebugContext. 
DebugContext.getDefaultRemoteValueMapping().clearCaches() method doesn't help.

Original comment by nikolay....@gmail.com on 22 Aug 2011 at 10:42

GoogleCodeExporter commented 8 years ago
Probably this has been missed.

Original comment by peter.ry...@gmail.com on 22 Aug 2011 at 7:27

GoogleCodeExporter commented 8 years ago
The problem with scopes actually has 2 parts:
  -- old protocol does not clears scope cached values (should be fixed)
  -- V8 does not allow to change local variables; eval expressions work with copy of local variables, i.e. they can modify them, but the change is only visible to eval itself;

Original comment by peter.ry...@gmail.com on 8 Sep 2011 at 4:14

GoogleCodeExporter commented 8 years ago
fixed in HEAD

Original comment by peter.ry...@gmail.com on 12 Sep 2011 at 4:42

GoogleCodeExporter commented 8 years ago
Fixed in 0.3.2

Original comment by peter.ry...@gmail.com on 13 Dec 2011 at 12:13