Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsdebugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997479/#msg_997479
i have written a plug-in and added him as debugContextListener through the debugUITools, and i know that if i want to send commands to the gdb i need to wait till the target being debugged is suspended, otherwise any action of sending commands to the gdb will end in exception of 'Target is not Suspended' or 'Target is Terminated'.
my question, when i enter the 'if' in debugContextChanged(debugContextEvent event) method, how can i know if the target being debugged is suspended in order to send commands to the gdb?
here is the debugContextChanged(debugContextEvent event) method:
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
//check if the target is suspended before
//sending commands to the gdb
}
}
and this is how i added the plug-in as debugContextListener:
thanks in advance.]]>ben agai2013-01-07T17:42:19-00:00Re: debugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997495/#msg_997495
The code for that integration is in
o.e.cdt.dsf.gdb
o.e.cdt.dsf.gdb.ui
DSF is the Debugger Services Framework and provides Services for the different debugger features. In your case, to know about the run state you would use the IRunControl.java service. For example you would call IRunControl.isSuspended(...). You could also listen for IRunControl.ISuspendedDMEvent and keep track of the current run state in your class.
To send command to GDB, you would use the ICommandControlService.
You will need to look at the code to learn how to use these services.
Marc]]>Marc Khouzam2013-01-07T19:21:22-00:00Re: debugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997584/#msg_997584
currently i'm using the debugger process output stream to send commands to the gdb.
what i wanted to ask is, if you can show me the syntax of checking if the process being debugged is suspended, throught IRunControl?
if you could show me the syntax inside the debugContextChanged method, i would be grateful.
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
//check if the target is suspended before
//sending commands to the gdb
}
}
thanks a lot, ben.]]>ben agai2013-01-08T13:23:26-00:00Re: debugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997585/#msg_997585
thanks]]>ben agai2013-01-08T13:27:17-00:00Re: debugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997593/#msg_997593
BreakpointVMProvider.fDebugContextListener.debugContextChanged
and at any code that calls IRunControl.isSuspended()
Marc
]]>Marc Khouzam2013-01-08T14:07:48-00:00Re: debugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997681/#msg_997681
is there somewhere else i can see it?
thanks.]]>ben agai2013-01-08T14:38:38-00:00Re: debugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997698/#msg_997698
Marc Khouzam2013-01-08T15:11:16-00:00Re: debugContextEvent information
https://www.eclipse.org/forums/index.php/mv/msg/446568/997805/#msg_997805
but i have a question, i see that the IRunControl.isSuspended method receives IRunControl.IExecutionDMContext context as parameter.
from where can i get the IRunControl.IExecutionDMContext to give as a parameter to the function?
and do i need to create an IRunControl, or can i somehow get one?