How to debug a C ++ Linux program from Windows using Eclipse?

I am using a standalone (i.e. no) remote ubuntu x64 server to develop a C ++ application (without an interface).

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

So far I have heard of two solutions:

  • Remote gdb
  • Remote Server X

I worked on solution 1: built cross gdb, copied my program and libraries on windows. I can remove -gdb from the cygwin command line, but not from the eclipse (stuck in "start ... 85%" without error message or in the log)

I also worked on solution 2: installed xauth, installed forwarding X, installed xming in its windows, installed DISPLAY in the linux field. But no β€œcannot open DISPLAY xxx” effect without easy troubleshooting.

When searching for these problems, I find outdated pages or various problems.

Has anyone done this? Can you share tips or fresh pointers on how to remove debugging Linux C ++ applications from Windows?

+4
source share
3 answers

I suggest installing an X11 server on your Windows computer (for example, is Xming possible?) And make ssh -X with some X11 client applications (for example, emacs , ddd , if necessary, xterm ) on your Linux server. Do not use a complicated thing like Eclipse. You could just use emacs (remotely on a Linux server, displaying the Windows desktop on the X11 server) ...

Once emacs works well (running on a remote Linux server, displayed on the X11 server for Windows desktops), you can run gdb inside it.

To get ssh -X working, you need to configure it accordingly. You may have forgotten this step. To test it, just use ssh -X yourlinuxhost xterm and work on the setup until this step works.

Of course, you can also install Linux on your laptop or desktop, possibly inside a virtual machine over your Windows.

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

+1
source

There is an eclipse RSE (Remote System Explorer) plugin that can pretty much do what you expect. The code base can be in the linux server, the eclipse uses telnet / ssh to enter the system. Execution may happen again on the server, using its own gdb for debugging.

0
source

You can use the following simple plugin for Eclipse.

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

He just needs an ssh connection to the server and he cares about something else

0
source

Source: https://habr.com/ru/post/1390838/


All Articles