Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Debug script

0
0
Hello,

How can I get values of variables

To retrieve the value of a variable, Eclipse seems to use the evaluate request. Here's a sample from Eclipse's debugger console:
> Sent to Chrome:
Content-Length:132

{"seq":25,"type":"request","command":"evaluate","arguments":{"disable_break":true,"expression":"value","inlineRefs":true,"frame":0}}
> end of message

> Received from Chrome:
Content-Length:789

{"seq":31,"request_seq":25,"type":"response","command":"evaluate","success":true,"body":{"handle":5,"type":"object","className":"Object","constructorFunction":{"ref":2,"type":"function","name":"Object","inferredName":"","scriptId":4},"protoObject":{"ref":4,"type":"object","className":"Object"},"prototypeObject":{"ref":3,"type":"undefined"},"properties":[{"name":"foo","value":{"ref":20,"type":"number","value":123}},{"name":"bar","value":{"ref":21,"type":"number","value":456.789}},{"name":"baz","value":{"ref":22,"type":"string","value":"foobar"}}],"text":"#<Object>"},"refs":[{"handle":20,"type":"number","value":123,"text":"123"},{"handle":21,"type":"number","value":456.789,"text":"456.789"},{"handle":22,"type":"string","value":"foobar","length":6,"text":"foobar"}],"running":false}
> end of message
Eclipse sent this request to retrieve a value for display in a tooltip. When the expression evaluates to an object, V8 appears to return information about immediate child properties only (as opposed to full serialization).

Is there any alternative for debugging other than Debugger protocol?

We're not aware of any other way to debug scripts running in V8.

Cheers!

Viewing all articles
Browse latest Browse all 2297