Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to get project reference associated with a given debug session?
How to get project reference associated with a given debug session? [message #1285513] Sat, 05 April 2014 17:33 Go to next message
Zoltan Vajda is currently offline Zoltan VajdaFriend
Messages: 2
Registered: April 2014
Junior Member
I start manually a gdb debug session (start debugging with a debug configuration with a C/C++ GDB Hardware Debugging plugin) and execute in my plugin a gdb command in the running debug session when my custom menu has been clicked like this:


// somewhere in Object MyHandler.execute(ExecutionEvent event)

BundleContext context = getBundleContext();
ServiceReference ref = context.getServiceReference(ICommandControlService.class.getName());
ICommandControlService commandControlService = (ICommandControlService) context.getService(ref);
MICommand<MIInfo> command = new MICommand<MIInfo>(commandControlService.getContext(), "<mygdbcommand> <some project specific options>");
MyRequestMonitor rm = new MyRequestMonitor(commandControlService.getExecutor(), null);
commandControlService.queueCommand(command, rm);
context.ungetService(ref);

This works fine. My problem is to get my project specific data for the options of my command which I have to send to gdb. I need a reference to the IProject interface of the project that is associated with the debug configuration. But I could not figure out yet how to achieve this. Does anybody have an idea?

Thanks in advance.
Re: How to get project reference associated with a given debug session? [message #1287605 is a reply to message #1285513] Mon, 07 April 2014 23:26 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 04/07/2014 06:35 AM, Zoltan Vajda wrote:
> I start manually a gdb debug session (start debugging with a debug
> configuration with a C/C++ GDB Hardware Debugging plugin) and execute in
> my plugin a gdb command in the running debug session when my custom menu
> has been clicked like this:
>
>
> // somewhere in Object MyHandler.execute(ExecutionEvent event)
>
> BundleContext context = getBundleContext(); ServiceReference ref =
> context.getServiceReference(ICommandControlService.class.getName());
> ICommandControlService commandControlService = (ICommandControlService)
> context.getService(ref); MICommand<MIInfo> command = new
> MICommand<MIInfo>(commandControlService.getContext(), "<mygdbcommand>
> <some project specific options>"); MyRequestMonitor rm = new
> MyRequestMonitor(commandControlService.getExecutor(), null);
> commandControlService.queueCommand(command, rm); context.ungetService(ref);
> This works fine. My problem is to get my project specific data for the
> options of my command which I have to send to gdb. I need a reference to
> the IProject interface of the project that is associated with the debug
> configuration. But I could not figure out yet how to achieve this. Does
> anybody have an idea?
>
> Thanks in advance.
>

Your question may garner more interest and support in the Eclipse CDT
forum assuming there's a tie-in with Eclipse.
Previous Topic:C++ compilers for CDT
Next Topic:Require assistance with the makefile
Goto Forum:
  


Current Time: Tue Apr 23 13:18:41 GMT 2024

Powered by FUDForum. Page generated in 0.03293 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top