4

I use a headless (i.e. no screen) remote ubuntu server x64 for developping a C++ application (with no UI either).

I want to conveniently (IDE like, not command line) debug this program from windows (7/64), with Eclipse if possible. I have a windows share between the two and full root access on both machines.

So far I have heard of two solutions :

  1. Remote gdb
  2. Remote X server

I have worked on solution 1 : built a cross gdb, copied my program and libs on windows. I'm able to remote-gdb from cygwin command line, but not from eclipse (stuck at "launching... 85%" with no error message nor log)

I have also worked on solution 2 : installed xauth, set X forwarding, installed xming on my windows, set DISPLAY on the linux box. But no effect "can't open DISPLAY xxx" with no easy troubleshoot.

When googling for those problems, I only find outdated pages or different problems.

Did anyone do it ? Can you share advices or fresh pointers on how to remote debug a C++ linux app from Windows ?

Offirmo
  • 18,962
  • 12
  • 76
  • 97

3 Answers3

1

I suggest to install an X11 server on your Windows machine (e.g. Xming perhaps?) and to do ssh -X with some X11 client applications (like emacs, ddd if needed, xterm) on your Linux server. Don't use a complex thing like Eclipse. You could just use emacs (remotely on the Linux server, displaying on the Windows desktop X11 server)...

Once emacs works well (running on the remote Linux server, displaying on the Windows desktop X11 server), you can run gdb inside it.

To get ssh -X working, you need to configure it appropriately. Maybe you forgot that step. To test it, just use ssh -X yourlinuxhost xterm, and work on configuration till that step works.

Of course you could also install Linux on your laptop or desktop, perhaps inside a virtual machine above your Windows.

NB. I never used Windows, but I do know that some X11 servers exist for it.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • It works now. The only thing I was missing was telling xming to accept connections from everyone with -ac. I was able to run the full fledged Eclipse and debug my program. Thanks ! – Offirmo Jan 13 '12 at 23:25
  • I'm not sure that you need `-ac` (which I guess is same as `xhost +` on Unix). Perhaps some `ssh` (AKA `putty` on Windows) trick could do ... I have no idea which trick on Windows. – Basile Starynkevitch Jan 14 '12 at 00:18
0

You can use the following simple plugin for Eclipse.

http://marketplace.eclipse.org/content/direct-remote-c-debugging

It needs just ssh connection to the server and it cares about anything else

0

There is a eclipse plugin RSE (Remote System Explorer), it can pretty much do what you are expecting. The code base can be in linux server, eclipses uses telnet / ssh to login. Execution again can happen on a server, native gdb is used to debug.

Kamath
  • 4,461
  • 5
  • 33
  • 60
  • 1
    Emacs does the same, and this feature is there way before Eclipse existed. –  Jan 13 '12 at 13:43
  • This is exactly what I use. And it doesn't work. Stuck at 85% while launching the debug configuration. No error message, no log. Do you have a link to a tutorial ? – Offirmo Jan 13 '12 at 13:50