Bug 279390 - [fiximprove][debug]: Cannot debug static variables when running debugger
Summary: [fiximprove][debug]: Cannot debug static variables when running debugger
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P2 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted, investigate
: 281818 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-07 14:38 EDT by Mark Foo Bonasoro CLA
Modified: 2019-12-19 04:25 EST (History)
7 users (show)

See Also:


Attachments
patch (1.08 KB, patch)
2010-03-22 11:17 EDT, Darin Wright CLA
no flags Details | Diff
additional patch (3.58 KB, patch)
2010-03-22 12:17 EDT, Darin Wright CLA
no flags Details | Diff
patch (2.12 KB, patch)
2010-03-22 12:44 EDT, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Foo Bonasoro CLA 2009-06-07 14:38:13 EDT
Build ID: M20090211-1700

When I try to view the contents of the static variable, Eclipse throws an error,

'JDI thread evaluations', Exception processing async thread queue.

Steps To Reproduce:
1. Create or start using any J2ME project.
2. Create a class with at least one static variable as a member.
3. Set a breakpoint anywhere, setup a watch for that static variable that you want to view its contents.
Comment 1 David Marques CLA 2009-07-14 15:12:39 EDT
The Eclipse Java debugger uses "create string" when creating "String" 
arguments to call methods like "classForName(String)", etc. We do this to 
force load classes, as well as to retrieve classes. If the required class 
is already loaded, we can use an alternate protocol.

I'm on vacation this week and next, but perhaps David could push the bug 
back to JDT debug with his interesting find, and then we can try to 
improve behavior on the JDT side.

Thanks,

Darin

From:
David Marques <wtv368@motorola.com>
To:
Craig Setera <craigjunk@setera.org>
Cc:
Darin Wright/Ottawa/IBM@IBMCA, Paula Gustavo-WGP010 <WGP010@motorola.com>
Date:
07/14/2009 11:30 AM
Subject:
Re: RES: debug issue

Hello All,

    I have done a little research about this issue with Sun KVM and I 
have concluded that Netbeans DOES work on expression evaluation (adding 
watches to variables) while MTJ does not. I have scanned the 
debugger/KVM packet transfers and seen some differences on the packets 
that are sent on Netbeans and on MTJ. What is happening is that MTJ is 
trying to send a CreateString command 
(
http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_CreateString
) 
to the KVM and it does not support it so it returns an error reply and 
an exception is thrown on MTJ side.

Regards,

David Marques
Comment 2 David Marques CLA 2009-07-14 15:18:59 EDT
Pushing the bug to JDT as requested by Darin Wright.
Comment 3 David Marques CLA 2009-07-21 09:15:07 EDT
*** Bug 281818 has been marked as a duplicate of this bug. ***
Comment 4 Remy Suen CLA 2009-07-21 09:17:52 EDT
(In reply to comment #2)
> Pushing the bug to JDT as requested by Darin Wright.

Reassigning to default inbox.
Comment 5 Darin Wright CLA 2010-03-22 11:17:23 EDT
Created attachment 162678 [details]
patch

This patch avoids creating string objects when the class is already loaded in the target VM.
Comment 6 Darin Wright CLA 2010-03-22 11:18:17 EDT
Applied/Fixed. Someone on MTJ needs to test/verify the fix.
Comment 7 Darin Wright CLA 2010-03-22 12:17:15 EDT
Created attachment 162688 [details]
additional patch

Additional patch ensures class loaders are compatible.
Comment 8 Darin Wright CLA 2010-03-22 12:44:35 EDT
Created attachment 162695 [details]
patch

I broke array allocation, fixed by this patch.
Comment 9 jacques Mising name CLA 2010-05-12 11:33:06 EDT
Tested it with 3.6 M7 and it is still broken

Version: 3.6.0
Build id: I20100429-1549

Tested with: 

3.6 M7
MJT 1.1
Sony Ericsson 2.5.0.6 SDK

I'm sorry but this is VERY frustrating to code like this. please fix this T.T
Comment 10 Darin Wright CLA 2010-05-12 11:38:05 EDT
How does it fail? What stack traces/error messages appear now? Someone that has access to such a VM needs to attempt to fix/debug this.
Comment 11 jacques Mising name CLA 2010-05-12 11:49:21 EDT
Install the software I listed. create a hallo world j2me app. create a static variable. put a breakpoint anywhere in the app. run in debug mode. catch the breakpoint, and add the static variable to the watch list. BOOM!

Exception processing async thread queue
Exception processing async thread queue
java.lang.UnsupportedOperationException

Eclipse Platform

Version: 3.6.0.v20100427-9hF78GQHFvItsz0S5GyW7qqoQ6yMHokFS58
Build id: I20100429-1549

Mobile Tools Java

Version: 1.0.1.v200909181641-7W7D7EFFt6Zb-appdsJXo
Build id: 200909181641
Comment 12 Eclipse Genie CLA 2019-12-19 04:25:44 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.