New issue
Advanced search Search tips

Issue 820535 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Runtime.getProperties does not return updated values

Reported by c...@microsoft.com, Mar 9 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299

Steps to reproduce the problem:
1. Set a breakpoint and stop at that breakpoint.
2. Use Debugger.evaluateOnCallFrame to change a local variable name, say "aaa = 3";
3. Issue a Runtime.getProperties request to check the current local variables on the stackframe. 
4. Saw that the returned value for "aaa" is still the old value.

Logs:

→ To target: "↔️{\"id\":211,\"method\":\"Debugger.evaluateOnCallFrame\",\"params\":{\"callFrameId\":\"{\\\"ordinal\\\":0,\\\"injectedScriptId\\\":2}\",\"expression\":\"aaa = 3\",\"silent\":true,\"includeCommandLineAPI\":true,\"objectGroup\":\"console\",\"generatePreview\":true}}↔️"

← From target: ↔️{"id":211,"result":{"result":{"type":"number","value":3,"description":"3"}}}

→To target: "↔️{\"id\":221,\"method\":\"Debugger.evaluateOnCallFrame\",\"params\":{\"callFrameId\":\"{\\\"ordinal\\\":0,\\\"injectedScriptId\\\":2}\",\"expression\":\"aaa\",\"silent\":true,\"includeCommandLineAPI\":true,\"objectGroup\":\"console\",\"generatePreview\":true}}↔️"

← From target: ↔️{"id":221,"result":{"result":{"type":"number","value":3,"description":"3"}}}↔️

→ To target: "↔️{\"id\":241,\"method\":\"Runtime.getProperties\",\"params\":{\"objectId\":\"{\\\"injectedScriptId\\\":2,\\\"id\\\":1}\",\"ownProperties\":true,\"accessorPropertiesOnly\":false,\"generatePreview\":true}}↔️"

← From target: ↔️{"id":241,"result":{"result":[{"name":"cb","value":{"type":"function","className":"Function","description":"() => {\n // Some fn\n var xyz = 321;\n anotherFn();\n }","objectId":"{\"injectedScriptId\":2,\"id\":16}"},"writable":true,"configurable":true,"enumerable":true,"isOwn":true},{"name":"aaa","value":{"type":"number","value":1,"description":"1"},"writable":true,"configurable":true,"enumerable":true,"isOwn":true},{"name":"obj1","value":{"type":"undefined"},"writable":true,"configurable":true,"enumerable":true,"isOwn":true},{"name":"zzzz","value":{"type":"undefined"},"writable":true,"configurable":true,"enumerable":true,"isOwn":true}]}}↔️

What is the expected behavior?
I expect to see {"name":"aaa","value":{"type":"number","value":3,"description":"3"}

from the returned call.

What went wrong?
The local variables on the stack frame are not updated, unless I release the runtime (resume from breakpoint), which means if I step over or continue, the variable is actually updated and effective.

Did this work before? No 

Chrome version: 65.0.3325.146  Channel: n/a
OS Version: 10.0
Flash Version:
 
Labels: Needs-Triage-M65
Status: WontFix (was: Unconfirmed)
We don't allow changing locals using evaluateOnCallFrame, you can try RemoteObject.setPropertyValue instead.

Comment 3 by c...@microsoft.com, Mar 9 2018

How can I tell whether the expression I want to change is local or not?
V8 doesn't support generic change to the scope variable atm, it needs to go via setPropertyValue

Sign in to add a comment