Bug 270574 - java.lang.ClassCastException in Variables tab
java.lang.ClassCastException in Variables tab
Status: RESOLVED FIXED
Product: cnd
Classification: Unclassified
Component: Debugger
8.2
PC Solaris
: P2 (vote)
: Dev
Assigned To: Maria Tishkova
issues@cnd
82patch-candidate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-05 12:43 UTC by soldatov
Modified: 2017-05-18 01:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2017-05-05 12:43:27 UTC
C++ Code:
class A {
public:
    A() {
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                abc[i][j] = 1 + i + j;
            }
        }
    }
    void foo() {}
private:
    int abc[5][5];
};

int main(int argc, char** argv) {
    A a;
    a.foo();
    return 0;
}

Scenario:
- Call context menu on project node and select Step Into
- Add 'a' variable into Variables tab
- Select a -> abc -> abc[0] -> abc[0][0] node
- Press Step Over
===>
SEVERE [org.openide.util.Exceptions]
java.lang.ClassCastException: org.netbeans.modules.cnd.debugger.gdb2.GdbVariable cannot be cast to org.netbeans.modules.cnd.debugger.gdb2.GdbWatch
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.formatRegisterIfNeeded(GdbDebuggerImpl.java:2931)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.updateValue(GdbDebuggerImpl.java:3304)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.interpUpdate(GdbDebuggerImpl.java:3506)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.access$6300(GdbDebuggerImpl.java:152)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl$35.onDone(GdbDebuggerImpl.java:3668)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MICommandManager.dispatch(MICommandManager.java:194)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.dispatch(MIProxy.java:188)
	at org.netbeans.modules.cnd.debugger.gdb2.Gdb$MyMIProxy.dispatch(Gdb.java:697)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.result(MIProxy.java:193)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.processLine(MIProxy.java:157)
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:369)
Caused: java.lang.Exception: when processing line: 67^done,changelist=[{name="var1.private.abc.0.0",value="1",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.1",value="2",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.2",value="3",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.3",value="4",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.4",value="5",in_scope="true",type_changed="false",has_more="0"}]
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:371)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
SEVERE [org.openide.util.Exceptions]
java.lang.ClassCastException: org.netbeans.modules.cnd.debugger.gdb2.GdbVariable cannot be cast to org.netbeans.modules.cnd.debugger.gdb2.GdbWatch
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.formatRegisterIfNeeded(GdbDebuggerImpl.java:2931)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.updateValue(GdbDebuggerImpl.java:3304)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.interpUpdate(GdbDebuggerImpl.java:3506)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.access$6300(GdbDebuggerImpl.java:152)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl$35.onDone(GdbDebuggerImpl.java:3668)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MICommandManager.dispatch(MICommandManager.java:194)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.dispatch(MIProxy.java:188)
	at org.netbeans.modules.cnd.debugger.gdb2.Gdb$MyMIProxy.dispatch(Gdb.java:697)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.result(MIProxy.java:193)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.processLine(MIProxy.java:157)
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:369)
Caused: java.lang.Exception: when processing line: 57^done,changelist=[{name="var5.private.abc.0.0",value="1",in_scope="true",type_changed="false",has_more="0"},{name="var5.private.abc.0.1",value="2",in_scope="true",type_changed="false",has_more="0"},{name="var5.private.abc.0.2",value="3",in_scope="true",type_changed="false",has_more="0"},{name="var5.private.abc.0.3",value="4",in_scope="true",type_changed="false",has_more="0"},{name="var5.private.abc.0.4",value="5",in_scope="true",type_changed="false",has_more="0"}]
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:371)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
INFO [org.netbeans.modules.cnd.editor.cos.COSRedirectorImpl]: inode file Changed org.netbeans.modules.cnd.source.CCDataObject@57b5bf0a[/export/files/NB/CppApplication_2/main.cpp@ce748857:13679d10] Key{fs=0, dev=0, inode=3228260}->Key{fs=0, dev=0, inode=3228260}
SEVERE [org.openide.util.Exceptions]
java.lang.ClassCastException: org.netbeans.modules.cnd.debugger.gdb2.GdbVariable cannot be cast to org.netbeans.modules.cnd.debugger.gdb2.GdbWatch
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.formatRegisterIfNeeded(GdbDebuggerImpl.java:2931)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.updateValue(GdbDebuggerImpl.java:3304)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.interpUpdate(GdbDebuggerImpl.java:3506)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.access$6300(GdbDebuggerImpl.java:152)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl$35.onDone(GdbDebuggerImpl.java:3668)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MICommandManager.dispatch(MICommandManager.java:194)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.dispatch(MIProxy.java:188)
	at org.netbeans.modules.cnd.debugger.gdb2.Gdb$MyMIProxy.dispatch(Gdb.java:697)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.result(MIProxy.java:193)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.processLine(MIProxy.java:157)
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:369)
Caused: java.lang.Exception: when processing line: 49^done,changelist=[{name="var1.private.abc.0.0",value="1",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.1",value="2",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.2",value="3",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.3",value="4",in_scope="true",type_changed="false",has_more="0"},{name="var1.private.abc.0.4",value="5",in_scope="true",type_changed="false",has_more="0"}]
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:371)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
SEVERE [org.openide.util.Exceptions]
java.lang.ClassCastException: org.netbeans.modules.cnd.debugger.gdb2.GdbVariable cannot be cast to org.netbeans.modules.cnd.debugger.gdb2.GdbWatch
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.formatRegisterIfNeeded(GdbDebuggerImpl.java:2931)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.updateValue(GdbDebuggerImpl.java:3304)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.interpUpdate(GdbDebuggerImpl.java:3506)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.access$6300(GdbDebuggerImpl.java:152)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl$35.onDone(GdbDebuggerImpl.java:3668)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MICommandManager.dispatch(MICommandManager.java:194)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.dispatch(MIProxy.java:188)
	at org.netbeans.modules.cnd.debugger.gdb2.Gdb$MyMIProxy.dispatch(Gdb.java:697)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.result(MIProxy.java:193)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.processLine(MIProxy.java:157)
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:369)
Caused: java.lang.Exception: when processing line: 50^done,changelist=[{name="var4.private.abc.0.0",value="1",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.1",value="2",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.2",value="3",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.3",value="4",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.4",value="5",in_scope="true",type_changed="false",has_more="0"}]
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:371)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
SEVERE [org.openide.util.Exceptions]
java.lang.ClassCastException: org.netbeans.modules.cnd.debugger.gdb2.GdbVariable cannot be cast to org.netbeans.modules.cnd.debugger.gdb2.GdbWatch
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.formatRegisterIfNeeded(GdbDebuggerImpl.java:2931)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.updateValue(GdbDebuggerImpl.java:3304)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.interpUpdate(GdbDebuggerImpl.java:3506)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl.access$6300(GdbDebuggerImpl.java:152)
	at org.netbeans.modules.cnd.debugger.gdb2.GdbDebuggerImpl$35.onDone(GdbDebuggerImpl.java:3668)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MICommandManager.dispatch(MICommandManager.java:194)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.dispatch(MIProxy.java:188)
	at org.netbeans.modules.cnd.debugger.gdb2.Gdb$MyMIProxy.dispatch(Gdb.java:697)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.result(MIProxy.java:193)
	at org.netbeans.modules.cnd.debugger.gdb2.mi.MIProxy.processLine(MIProxy.java:157)
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:369)
Caused: java.lang.Exception: when processing line: 50^done,changelist=[{name="var4.private.abc.0.0",value="1",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.1",value="2",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.2",value="3",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.3",value="4",in_scope="true",type_changed="false",has_more="0"},{name="var4.private.abc.0.4",value="5",in_scope="true",type_changed="false",has_more="0"}]
	at org.netbeans.modules.cnd.debugger.gdb2.Tap$4.run(Tap.java:371)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Comment 1 Maria Tishkova 2017-05-16 08:25:25 UTC
fixed in enum/release82 
changeset:   315844:61c784e57584
branch:      release82
tag:         tip
parent:      315773:97762adeb5f9
user:        Maria Dalmatova <mromashova@netbeans.org>
date:        Tue May 16 11:23:38 2017 +0300
summary:     fixed bz#270574  - java.lang.ClassCastException in Variables tab
Comment 2 Quality Engineering 2017-05-18 01:53:22 UTC
Integrated into 'main-silver', will be available in build *201705180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/46baab93d304
User: Maria Dalmatova <mromashova@netbeans.org>
Log: fixed bz#270574  - java.lang.ClassCastException in Variables tab
check instanceof
but it is really strange that API allows to create GdbVariable which answers "yes" on the question isWatch and not GdbWatch instance.
As I found in the code children of the watch are created as GdbVariable with isWatch = true parameter.
(transplanted from 61c784e575842bb53c57508048f9cb445d527628)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo