Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] Debugging one jvm with multiple targets

Hello,

> 
> I would appreciate your design input on the following use case. A 
> custom java debugger changes the presentation in Debug, Breakpoint, 
> Variables view and source display (the debugged process is shown 
> graphically on a GEF-like canvas editor).

I don't quite understand your existing design. Do you have an 
implementation of (1) a debugger that talks JDI to a JVM, or do you have 
an implementation of (2) a debugger that is a proxy to an 
IJavaDebugTarget?

> In addition, it should 
> support regular java debug for the java classes "embedded" into the 
> canvas. This debug process should be a continuous process, which 
> switches between java and graphical editors as needed.
> What would be a design pattern for this? The custom debugger is set 
> using its own CustomDebugTarget. Shall java debugger be attached to 
> the same jvm by adding a JDIDebugTarget to the debug launch?
> 

If your implementation is (1), then I think there will be problems - as 
only one client can connect via JDI/JDWP to a VM's debug interface at a 
time. I'm not sure how hard it would be to disconnect your client and 
connect the JDT client. Perhaps it could be done.

If your implementation is (2), then you might experiment with the 
following. Assume your ILaunch starts out containing an instance of your 
"CutsomDebugTarget" (which is a proxy to an IJavaDebugTarget). When you 
want to switch to the "Java" view of things you could try removing the 
"CustomDebugTarget" from the launch, and adding the IJavaDebugTarget. This 
would change the visible debugger to the standard Java debugger (and 
uninstall/install appropriate model proxies to update the view). I've 
never tried this, but if feels like it might be a simple solution worth 
trying.

Darin Wright



Back to the top