Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] How can I implement a listener for the termination of a RuntimeProcess

> 
> My question was exactly this: why is the IDebugTarget.terminated() not
> called anymore when a process is terminated.

Actually, there is no such method as IDebugTarget.terminated(). The Java 
debug target (JDIDebugTarget) has a protected implementation of a method 
called "terminated()", but this is part of the implementation of the Java 
debug target. The method is called when a "VM Death" JDI event is 
received, when the VM is disconnected, or when the VM is explicitly 
terminated - but this is part of the private implementation of the target 
- it is not API.

(But I'm not sure which debugger implementation you are referring to...)

> 
> Because of this problem I need such a listener for the IProcess
> termination. I haven't found any methods to handle
> IDebugEventListener's in either: IProcess, ITerminate or
> IDebugElement.

The debug elements don't generally handle events - they produce the events 
so the debug UI can update. Each debug implementation generally has a 
model specific implementation of events to handle (for example, the Java 
debugger handles JDI events).

> 
> Therefore, what am I missing or how can I listen to the termination of
> the IProcess from an IDebugTarget?

If your target knows about its process (via the enclosing launch, 
perhaps), just add an IDebugEventSetListener to the DebugPlugin and listen 
for TERMINATE events that originate from the desired target.

Darin



Back to the top