luobenyu / chromedevtools

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

NPE is thrown during evaluation properties of exception object #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
SDK/Debugger version: 0.3.2
Eclipse version: Helios Service Release 2
Google Chrome/V8 Embedder + version: 16.0.912.75
OS + version: Ubuntu 11.10

What steps will reproduce the problem?
1. Open some page containing the following script in Chrome:
    try {
        var aaa = 1/x;//x is unresolved
    }
    catch (e) {
        var i = 1;//breakpoint here
    }

2. Start 'WebKit Protocol' debug configuration in Eclipse using WIP Backend 
97678.
3. Put a breakpoint inside 'catch' and wait until execution is suspended.
4. Evaluate 'e' expression (without quotes) in 'Expressions' view.
5. Expand 'e' node and then expand '<exception>' subnode.

What is the expected result?
Properties of the exception should be shown

What happens instead?
'Failed to read variables' message is shown.

Please provide any additional information below. If possible, attach a
(reduced) test-case.
The stacktrace from 'Error' view and the messages from 'Console' view are shown 
below:

java.lang.NullPointerException
at 
org.chromium.sdk.internal.wip.WipValueBuilder.getValueType(WipValueBuilder.java:
63)
at org.chromium.sdk.internal.wip.WipValueBuilder.wrap(WipValueBuilder.java:54)
at 
org.chromium.sdk.internal.wip.WipValueBuilder.createVariable(WipValueBuilder.jav
a:49)
at 
org.chromium.sdk.internal.wip.WipValueLoader$ObjectPropertyProcessor.process(Wip
ValueLoader.java:152)
at 
org.chromium.sdk.internal.wip.WipValueLoader$ObjectPropertyProcessor.process(Wip
ValueLoader.java:1)
at 
org.chromium.sdk.internal.wip.WipValueLoader$2$1.visitData(WipValueLoader.java:2
45)
at 
org.chromium.sdk.internal.wip.WipValueLoader$3$1.accept(WipValueLoader.java:288)
at 
org.chromium.sdk.internal.wip.WipValueLoader$2.runSync(WipValueLoader.java:241)
at org.chromium.sdk.util.AsyncFuture$SyncOperation.execute(AsyncFuture.java:167)
at 
org.chromium.sdk.internal.wip.WipValueLoader.loadPropertiesInFuture(WipValueLoad
er.java:262)
at 
org.chromium.sdk.internal.wip.WipValueLoader.loadJsObjectPropertiesInFuture(WipV
alueLoader.java:70)
at 
org.chromium.sdk.internal.wip.WipValueBuilder$ObjectTypeBase$JsObjectBase.doLoad
Properties(WipValueBuilder.java:258)
at 
org.chromium.sdk.internal.wip.WipValueBuilder$ObjectTypeBase$JsObjectBase.getLoa
dedProperties(WipValueBuilder.java:240)
at 
org.chromium.sdk.internal.wip.WipValueBuilder$ObjectTypeBase$JsObjectBase.getPro
perties(WipValueBuilder.java:203)
at org.chromium.debug.core.model.Value.getVariables(Value.java:73)
at 
org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getValueChi
ldren(VariableContentProvider.java:166)
at 
org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getAllChild
ren(VariableContentProvider.java:83)
at 
org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getChildCou
nt(VariableContentProvider.java:48)
at 
org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.retrieveChil
dCount(ElementContentProvider.java:114)
at 
org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$2.run(Elemen
tContentProvider.java:63)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

> Sent to Chrome:
%000{"id":11,"method":"Runtime.getProperties","params":{"ownProperties":true,"ob
jectId":"{\"injectedScriptId\":1,\"id\":7}"}}%00/
> end of message

> Received from Chrome:
%000{"result":{"result":[{"get":{"type":"function","objectId":"{\"injectedScript
Id\":1,\"id\":8}","className":"Object","description":"function getter() { 
[native code] 
}"},"set":{"type":"function","objectId":"{\"injectedScriptId\":1,\"id\":9}","cla
ssName":"Object","description":"function setter() { [native code] 
}"},"enumerable":false,"configurable":true,"name":"stack"},{"get":{"type":"funct
ion","objectId":"{\"injectedScriptId\":1,\"id\":10}","className":"Object","descr
iption":"function getter() { [native code] 
}"},"set":{"type":"function","objectId":"{\"injectedScriptId\":1,\"id\":11}","cl
assName":"Object","description":"function setter() { [native code] 
}"},"enumerable":false,"configurable":true,"name":"message"},{"value":{"type":"o
bject","objectId":"{\"injectedScriptId\":1,\"id\":12}","subtype":"array","classN
ame":"Array","description":"Array[1]"},"writable":true,"enumerable":false,"confi
gurable":true,"name":"arguments"},{"value":{"type":"string","value":"not_defined
"},"writable":true,"enumerable":false,"configurable":true,"name":"type"},{"name"
:"__proto__","value":{"type":"object","objectId":"{\"injectedScriptId\":1,\"id\"
:13}","className":"Error","description":"Error"},"writable":true,"configurable":
true,"enumerable":false}]},"id":11}%00/
> end of message

Original issue reported on code.google.com by nikolay....@gmail.com on 23 Jan 2012 at 10:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
There should be problem with getters not being properly supported. Might need 
some API changes.

Original comment by peter.ry...@gmail.com on 24 Jan 2012 at 12:37

GoogleCodeExporter commented 9 years ago
I'm seeing the same issue debugging javascript using WebStorm and Chrome.  
Objects using getters and setters cannot be evaluated in the WebStorm debugger 
but can using the Chrome Developer Tools. WebStorm log attached.

Original comment by lstrader...@gmail.com on 17 Feb 2012 at 1:29

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in both  wk* wip backends in HEAD.
(No fix in "dev" backend)
Chrome is recently fixed to conform to protocol in HEAD.

Original comment by peter.ry...@gmail.com on 17 Feb 2012 at 4:26

GoogleCodeExporter commented 9 years ago
Fix in Chrome is done in WebKit r107567, Chrome branch 1041.
Should be in:
Chrome 18.*.*.*
Chrome *.*. >1041 .*

Original comment by peter.ry...@gmail.com on 17 Feb 2012 at 9:12

GoogleCodeExporter commented 9 years ago
Fixed in 0.3.4

Original comment by peter.ry...@gmail.com on 25 Feb 2012 at 12:56