views:

148

answers:

2

The current setup is that I'm developing a program for Linux (and debugging the binary with GDB via SSH), but using Eclipse and a remote file mount to do the editing from a Windows box. I'd really love to be able to debug in eclipse but I haven't yet found anything that would work.

Anyone know of anything I should look at?

BTW: I'm willing to use non eclipse tool but can't afford to buy anything.

A: 

Using Eclipse (assuming Java) this works great. Just start the program on the linux box with the following options:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=3000

Then, in Eclipse, click the down arrow by the bug(debugger) and select debug configurations. Create a new Remote Java Application, and add in the name of the linux box and the port you are using (3000 from above). Once the app is launched, it will wait for you to connect. Simply Click Debug or select the Debug Configuration from the drop down debug menu. Change suspend to 'n' if you don't want it to wait.

AdamC
That's nice to know, but I need something that works on an arbitrary binary. (I didn't know that would make a difference)
BCS
+1  A: 

From http://community.livejournal.com/shlomif%5Ftech/9932.html:

  1. Install CDT - The Eclipse C/C++ Development Tooling.
  2. Set up a C/C++ project so it will build and compile.
  3. Install gdb and gdbserver. The latter does not seem to be available in any Mandriva package and had to be compiled from the gdb source, where it is built by default.
  4. Run gdbserver on the generated executable using a command like gdbserver localhost:10900 ./my-exe
  5. In Eclipse go to Run → "Open Run Dialog...", and go to the upper debugger tab and select gdbserver Debugger in the Debugger drop-down. Afterwards, go to the "Connection" tab under Debugger Options and configure your connection. For my demonstration I've chosen "Type: TCP" "Host: localhost" and "Port number: 10900".
  6. Select the Run → Debug in Eclipse option and start debugging the application.
Thorbjørn Ravn Andersen
+1 wasn't aware of this
Pascal Thivent
Can this be made to work with only GDB and eclipse on the windows machine?
BCS