United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 5005668 'Unexpected JDWP Error: 35' when evaluating 'this'
5005668 : 'Unexpected JDWP Error: 35' when evaluating 'this'

Details
Type:
Bug
Submit Date:
2004-03-01
Status:
Closed
Updated Date:
2004-03-02
Project Name:
JDK
Resolved Date:
2004-03-02
Component:
core-svc
OS:
windows_xp
Sub-Component:
debugger
CPU:
generic
Priority:
P3
Resolution:
Duplicate
Affected Versions:
5.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
The bug has been originally reported against the NetBeans IDE running on J2SE 1.5-beta b32c and 1.5-beta2 b40:
http://www.netbeans.org/issues/show_bug.cgi?id=40568

'Stepping Into' in the NetBeans debugger sometimes causes the 'Unexpected JDWP Error: 35' exception to be thrown. It turns out that it happens when the Netbeans JPDA debugger tries to evaluate 'this' object reference in the current stack frame. As a result, instance variables values cannot be inspected during debugging. It seems to be reliably reproducible with some test cases on some configurations only.

The exception stack trace starts with:

com.sun.jdi.InternalException: Unexpected JDWP
Error: 35
        at
com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47)
        at
com.sun.tools.jdi.StackFrameImpl.thisObject(StackFrameImpl.java:126)
        at
org.netbeans.modules.debugger.jpda.JPDACallStackFrame.getVariables(JPDACallStackFrame.java:220)

Steps to reproduce with NetBeans dev build (#200402261900):

1. Open the attached class source in the editor.
2. Place a breakpoint at line 35 -- 'Set s = ...'
3. Start the debugger via Alt-F5
4. After it stops at the breakpoint, start pressing F7 (confirm 'Step Out' / 'Don't Ask')
5. The first stack trace appears when the Name class constructor is stepped into for the first time. A series of stack traces is generated with each F7 after that.

I was not able to reproduce the behavior with JDK
1.4.2_03.

A test case and a full exception stack trace are attached.
###@###.### 2004-03-01
###@###.### 2004-03-01

                                    

Comments
EVALUATION

###@###.### 2004-03-01

This looks like a case of javac bug:
 4918173  GetLocalVariableTable returns two 'this'  variables for ctor

There were two javac bugs here:
1.  javac started outputting two 'this's in the LocalVariableTable
    for a constructor.
2.  javac was changed to not do this, but then it didn't output any
    'this's for a constructur.

This caused a JDWP Error 35 when one tried to access 'this' in
a constructor and the .java file was compiled with -g.

Jan, could you try your test again on b40 making sure that:
- you compile the .java file using b40 javac (ie, don't use a .class
  file compiled with b39 or older javac)
- compile with -g

Let us know if you still get the JDWP Error 35.
Thanks.

You're right. The class file I used during the test was compiled using b32c. I haven't recompiled it before running it in debugger on b40. After recompiling the problem disappeared. Closing as duplicate of #4918173.
###@###.### 2004-03-02
                                     
2004-03-02



Hardware and Software, Engineered to Work Together