Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Customizing GDB Launch

So for my use case our developers have Windows dev boxes, but we support 8 platforms (1 of which being linux).

 

I have recently integrated our build system into eclipse CDT and am trying to get as many CDT features working in our environment. We have a custom built debugger that we use, but I wanted to be able to use the integrated debugger in eclipse. We do support debugging with gdb on our linux platform, but that requires launching our application on a linux box. This is the driving force that led me to implement this solution. Basically instead of launching gdb locally, I launch an ssh command that launches gdb on a remote server.

 

For this to work, the eclipse project had to be in a shared directory that was accessible from the window box and the remote server.

 

Basically what I did was create a class that inherited from GDBBackend and overrode:

 

getGDBCommandLine –     ssh [server] gdb --interpreter mi2 --nx

getProgramArguments  [args]

getProgramPath      [program path on remote server]

getGDBWorkingDirectory  [path to shared drive where gdb was launch from on remote server]

 

After this, all I had to do was create a launchDelegate  that inherits from  GdbLaunchDelegate and overrides at least launchDebugSession so that you can create your own GdbDebugServicesFactory that returns your Backend.

 

At this point launching should work, and all that is left is mapping the remote source path to the local source path. (I overrode getSourceLocator in GdbLaunchDelegate to provide these mappings, but you can do it manually)

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Phillips, Brandon
Sent: Tuesday, May 20, 2014 4:40 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Customizing GDB Launch

 

How does this approach handle interrupting the remote process to wake up GDB (for manual pause, setting new breakpoints, etc)?

 

When I glued together a gdb-over-ssh scheme for Eclipse, I ended up having to modify starter.exe to send a string command that triggered my gdb wrapper on the other side to interrupt the target process. (Not pretty.)

 

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Joseph Henry
Sent: Tuesday, May 20, 2014 4:17 PM
To: CDT General developers list.
Subject: EXTERNAL: Re: [cdt-dev] Customizing GDB Launch

 

I was able to get this working by following some of the documentation listed in: http://wiki.eclipse.org/CDT/cdt-debug-dsf-gdb-extensibility and http://wiki.eclipse.org/CDT/User/FAQ#How_can_I_choose_another_debugger_integration_for_CDT.3F

 

Thanks,

Joseph Henry.

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Marc Khouzam
Sent: Tuesday, May 20, 2014 4:08 PM
To: 'CDT General developers list.'
Subject: Re: [cdt-dev] Customizing GDB Launch

 

Hi,

 

we don’t use extension points in DSF (yet?)  As usual though, the way to extend things is to override one or more of the DSF services.

 

In this case, the IGDBBackend service was added to help do what you want.  By overriding this interface, you should be able to properly handle a GDB session launched over ssh.

 

Marc

 

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Joseph Henry
Sent: Wednesday, May 07, 2014 4:42 PM
To: CDT General developers list.
Subject: [cdt-dev] Customizing GDB Launch

 

Hi guys,

 

I want to be able to customize the gdb launch to invoke gdb over ssh instead of locally.

 

I found this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=240092 and it seems that this bug fix adds the functionality that I need, but I don’t really know where to start.

 

Is there an extension point that I use in order to provide my own GDBBackend implementation?

 

Thanks,

Joseph Henry.


Back to the top