Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [jdt-debug-dev] JDIDebugTarget

Hi,

Oke, I didn't know about the remote debugging thing, and it sounds
logical.. However, I would have expected thread information messages
first then... since it is unknown if the "main thread" IS already
running. 
Currently it is first requesting for information about java.lang.Error
and java.lang.Throwable.

Anyway, I will file a 'bug' as you are requesting, and thank you for
your reply.

Tom van Dijck


-----Original Message-----
From: jdt-debug-dev-bounces@xxxxxxxxxxx
[mailto:jdt-debug-dev-bounces@xxxxxxxxxxx] On Behalf Of Darin Wright
Sent: Wednesday, September 21, 2005 11:29 PM
To: Eclipse JDT Debug developers list.
Subject: Re: [jdt-debug-dev] JDIDebugTarget


Please file a bug so we can improve on our VMStart event handling.
Currently, I believe the reason we do not obey the VMStart event has to
do with remote debugging. That is, if we attach to an already running VM
there may be no start event, but we still need to initialize our
requests on the target VM (and we can't wait for the event, as it may
never arrive). We need to determine if the start event is sent when
attaching to an application that has a main thread already running. If
not, then we need different ways to initialize a target, based on how it
was created. 

Darin Wright

jdt-debug-dev-bounces@xxxxxxxxxxx wrote on 09/21/2005 12:11:07 PM:

> Hi,
> 
> I've been developing a Java Virtual Machine, and have been using 
> eclipse a lot for testing, uptil now it pretty much runs all java code

> I've been testing in both the SunVM and my own, this week I've build a

> JDWP compliant transport debugger interface, and am now able to use 
> Eclipse as a debugger which is pretty cool.
> 
> The JDWP specification from SUN states that after I send the 
> 'JDWP-Handshake' message, I have to send:
> 'JDWP.EventKind.VM_START' to notify the debugger of VM Initialisation.
> The documentation states the following:
> http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html
> #J
> DWP_Event_Composite
> 
> 'Notification of initialization of a target VM. This event is received

> before the main thread is started and before any application code has 
> been executed. Before this event occurs a significant amount of system

> code has executed and a number of system classes have been loaded. 
> This event is always generated by the target VM, even if not 
> explicitly requested.'
> 
> Now the problem I have is, that this event may not occur directly 
> after my "javaw.exe" is started by Eclipse, this is largly based on 
> the fact that I use my VM as a scripting engine for our game, and it 
> may not be until after the game starts that the VM is active and
initialized.
> Eclipse seems to ignore this message and starts sending messages right

> away to set breakpoints, request for class information, thread 
> information and so on.
> 
> I have moved a few lines of code in "JDIDebugTarget.java" that solves 
> a part of the problem:
> >From 'protected synchronized void initialize() {' 
> I moved the following three lines:
>       initializeRequests();
>       initializeState();
>       initializeBreakpoints();
> 
> To 'public void handleVMStart(VMStartEvent event) {'
> 
> The SUN JRE 1.5.0_04 does not seem to have a problem with it, but 
> since I'm not the original author of this code I'm unaware of the real

> consequences, which is why I'm posting here.
> 
> Furthermore it is still sending a lot of messages that 'should' not be

> send until after the VM Start event, or I am misinterpreting the 
> specifications. The following list are the messages still send by 
> Eclipse before the VM Start event, in this specific order.
> 
> 1.7,  (11 bytes) request: IDSizes
> 15.1, (17 bytes) request: Set
> 1.1,  (11 bytes) request: Version
> 1.17, (11 bytes) request: CapabilitiesNew 15.1, (37 bytes) request: 
> Set (Include Pattern: java.lang.Error) 15.1, (39 bytes) request: Set 
> (Include Pattern: java.lang.Error$*) 1.2,  (32 bytes) request: 
> ClassesBySignature (Ljava/lang/Error;) 15.1, (28 bytes) request: Set 
> 2.1,  (19 bytes) request: Signature 15.1, (41 bytes) request: Set 
> (Include Pattern: java.lang.Throwable) 15.1, (43 bytes) request: Set 
> (Include Pattern: java.lang.Throwable$*) 1.2,  (36 bytes) request: 
> ClassesBySignature (Ljava/lang/Throwable;) 15.1, (28 bytes) request: 
> Set 2.1,  (19 bytes) request: Signature
> 
> Especially the 1.2, 2.1 and 15.1 messages are very related to the VM 
> and since that one has not been initialized yet, it cannot reply with 
> valid data. The other messages are oke to send, since they are related

> to static information about the JRE.
> 
> 
> Tom van Dijck
> Playlogic Game Factory BV.
> The Netherlands.
> _______________________________________________
> jdt-debug-dev mailing list
> jdt-debug-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jdt-debug-dev




Back to the top