Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Interfacing Eclipse Workbench UI with GNU debuggerfunctions

Hi!

That's quite a rough piece of code, but should work... ;-)
You may want to use it to better understand how that CDI stuff works.

//=====================

	CDebugTarget target;

	// retrieve a valid target here...
	
	if (target== null || target.isDisconnected() ||
target.isTerminated())
			return;

	MISession session =
((Target)(target.getCDITarget())).getMISession();
   
    	try {
		String myGdbCommand = "<type your command here>";
    		session.postCommand(new MICommand(MIVersion.MI1,
myGdbCommand));
	} 
	catch (Exception e) {
		// do whatever you need to handle the exception
	}

//=====================

Ciao,
	Giuseppe.

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Elena Laskavaia
> Sent: Tuesday, June 09, 2009 11:54 PM
> To: CDT General developers list.
> Subject: Re: [cdt-dev] Interfacing Eclipse Workbench UI with 
> GNU debuggerfunctions
> 
> If you need details you have to look in the code.
> In general CDT (CDI/gdb) launches gdb in mi mode and keeps 
> input/output stream for dbg.
> When command received it send text command to input stream of 
> gdb and wait for response, then parses response and update UI.
> 
> 
> Rohit Girme wrote:
> > 
> > 
> > Hello,
> > 
> > I am asking this question again because even after reading some 
> > articles I havent exactly understood what to do. So please 
> help me out.
> > 
> > I want to know how the Eclipse Workbench UI communicates 
> with the GNU 
> > debugger. What I mean is in the Eclipse for C/C++, when we 
> press the 
> > step over or resume or continue buttons in the menu, what happens 
> > behind the scenes? As in how is the GNU gdb invoked? How 
> does gdb know 
> > which function to execute? How does the UI communicate with gdb? I 
> > have added a custom function to the gdb(does not matter what the 
> > function is..) and I want to add a button to the Eclipse workbench 
> > such that pressing the button will call the gdb and that 
> function in 
> > particular. I want to know how Eclipse workbench UI 
> interacts with the 
> > GNU gdb. How do I go about doing this?
> > 
> > Thanks, Rohit
> > 
> > 
> > 
> ----------------------------------------------------------------------
> > --
> > 
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 



Back to the top