Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Remote C development
Remote C development [message #234592] Fri, 05 June 2009 15:06 Go to next message
Guillaume Le Priol is currently offline Guillaume Le PriolFriend
Messages: 7
Registered: July 2009
Junior Member
Hello,

I am using Eclipse CDT to try to make a remote C Project.
I am using this Eclipse on a Windows XP, and I would like to build, launch
an debug on a Linux server.
I explain what I would like to have:
- The goal is to edit files remotely, the files are not on the local
host, but everything is on the Linux server (RedHat Entreprise Linux 5.
- The build has to be made on the Linux Server
- The launch has to be made on the Linux Server
- The debug has to be made on the Linux Server
- And all of that have to be made from Eclipse on Windows

This is a realy difficult task, and I am working on it 8 hours a day since
a week.

Here's the thing I try to make:

- First I installed two plug-ins, RSE (Remote System Explorer) and RDT
(Remote Development Tools).With RDT, we can create a "Remoce C/C++
Project", by connectiong to the remote server.
(To connect to the remote server, I launch a server that waits for a
connection on Linux)
When I am connected to the Linux server, I can create a remote project
located on this server. I also can build a project on this server.
The problem comes when I try to launch or debug it. Under Windows, Eclipse
does not find any binaries. (For exemple I have a binary named "test",
under Linux I can launch it with a terminal)
I first thought it was a binary parser problem, so I check this way, but
when I put "Elf Parser" (the parser for Linux binaries) it doesn’t work.
(It does not work with any binary parser).

So I abort to use the "Remote C/C++ Project".

- Then I try to make a local C project, and to use another plug-in "RSE
Remote CDT" that offer a run/debug configuration for "Remote C
application".
To build my project I use a cross-compiler, with Cygwin, to build Linux
binaries from Windows.
(This point works fine, when I try to launch the program on Linux with a
terminal, it works)
I also try with Eclipse to run on the remote server, and it seems to work.
The problem I have is for debug. I made a cross gdb. And I debug with
Eclipse with gdbserver.
The debug seems to work remotely, but there is a problem I don't know how
to manage.
When the program tries to load a library, the debugger goes to look for it
on my Windows. I don't know why it doesn't look for it on Linux.

Here's what I would like to have:
The debug runs on the Linux server, and use the Linux paths, and load
everything on Linux.
I would like everything to be made on Linux (build, launch, and debug).

That's why I come to have some advices, because I think I tried a
everything, and I start to give up the idea it is possible.

Thank you for your help.

Guillaume.
Re: Remote C development [message #234637 is a reply to message #234592] Mon, 08 June 2009 09:31 Go to previous messageGo to next message
Igmar Palsenberg is currently offline Igmar PalsenbergFriend
Messages: 5
Registered: July 2009
Junior Member
hi,

> I am using Eclipse CDT to try to make a remote C Project.
> I am using this Eclipse on a Windows XP, and I would like to build,
> launch an debug on a Linux server.
> I explain what I would like to have:
> - The goal is to edit files remotely, the files are not on the local
> host, but everything is on the Linux server (RedHat Entreprise Linux 5.
> - The build has to be made on the Linux Server
> - The launch has to be made on the Linux Server
> - The debug has to be made on the Linux Server
> - And all of that have to be made from Eclipse on Windows
>
> This is a realy difficult task, and I am working on it 8 hours a day
> since a week.

We're in the same ship.


> Here's the thing I try to make:
>
> - First I installed two plug-ins, RSE (Remote System Explorer) and RDT
> (Remote Development Tools).With RDT, we can create a "Remoce C/C++
> Project", by connectiong to the remote server.
> (To connect to the remote server, I launch a server that waits for a
> connection on Linux)
> When I am connected to the Linux server, I can create a remote project
> located on this server. I also can build a project on this server.
> The problem comes when I try to launch or debug it. Under Windows,
> Eclipse does not find any binaries. (For exemple I have a binary named
> "test", under Linux I can launch it with a terminal)
> I first thought it was a binary parser problem, so I check this way, but
> when I put "Elf Parser" (the parser for Linux binaries) it doesn�t work.
> (It does not work with any binary parser).
>
> So I abort to use the "Remote C/C++ Project".

File a bugreport. I'll add my experience, since I came to the same
conclusion. It is broken, I haven't got it working, so I've reverted
back to using vim / make on the development machine.


> - Then I try to make a local C project, and to use another plug-in "RSE
> Remote CDT" that offer a run/debug configuration for "Remote C
> application".
> To build my project I use a cross-compiler, with Cygwin, to build Linux
> binaries from Windows.
> (This point works fine, when I try to launch the program on Linux with a
> terminal, it works)
> I also try with Eclipse to run on the remote server, and it seems to work.
> The problem I have is for debug. I made a cross gdb. And I debug with
> Eclipse with gdbserver.
> The debug seems to work remotely, but there is a problem I don't know
> how to manage.
> When the program tries to load a library, the debugger goes to look for
> it on my Windows. I don't know why it doesn't look for it on Linux.
>
> Here's what I would like to have:
> The debug runs on the Linux server, and use the Linux paths, and load
> everything on Linux.
> I would like everything to be made on Linux (build, launch, and debug).

This is the best you get. I suggest we cook up a bugreport together.



Regards,


Igmar
Re: Remote C development [message #234657 is a reply to message #234637] Mon, 08 June 2009 13:15 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
AFAIK (I am not a CDT developer) the next CDT release (6.0 comes with
Eclipse Galileo at the end of June) should make remote
compiling/running/debugging a lot easier/better. A release candidate is
available here
http://download.eclipse.org/tools/cdt/builds/6.0.0/index.htm l

Perhaps you should give it a try.

Axel


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Remote C development [message #234676 is a reply to message #234657] Tue, 09 June 2009 07:36 Go to previous messageGo to next message
Igmar Palsenberg is currently offline Igmar PalsenbergFriend
Messages: 5
Registered: July 2009
Junior Member
Axel Mueller wrote:
> AFAIK (I am not a CDT developer) the next CDT release (6.0 comes with
> Eclipse Galileo at the end of June) should make remote
> compiling/running/debugging a lot easier/better. A release candidate is
> available here
> http://download.eclipse.org/tools/cdt/builds/6.0.0/index.htm l
>
> Perhaps you should give it a try.

I've tried, and it's at least usuable. The C / C++ indexer still gives
NullPointer exceptions, and I can't share using GIT (yet).

Regards,


Igmar
Re: Remote C development [message #234854 is a reply to message #234676] Mon, 15 June 2009 08:06 Go to previous messageGo to next message
Anton Leherbauer is currently offline Anton LeherbauerFriend
Messages: 490
Registered: July 2009
Senior Member
Igmar Palsenberg wrote:
> Axel Mueller wrote:
>> AFAIK (I am not a CDT developer) the next CDT release (6.0 comes with
>> Eclipse Galileo at the end of June) should make remote
>> compiling/running/debugging a lot easier/better. A release candidate
>> is available here
>> http://download.eclipse.org/tools/cdt/builds/6.0.0/index.htm l
>>
>> Perhaps you should give it a try.
>
> I've tried, and it's at least usuable. The C / C++ indexer still gives
> NullPointer exceptions, and I can't share using GIT (yet).
>
> Regards,
>
>
> Igmar

Please report the NullPointerExceptions here:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT

Thanks!
--
Anton Leherbauer
Wind River Systems, Austria
CDT Committer - http://www.eclipse.org/cdt
Re: Remote C development [message #518475 is a reply to message #234854] Thu, 04 March 2010 09:10 Go to previous messageGo to next message
Inprise  is currently offline Inprise Friend
Messages: 2
Registered: March 2010
Junior Member
Hi ,

I am facing similar remote build issue,please guide me ,if you already fixed with your issue

Re: Remote C development [message #519469 is a reply to message #518475] Mon, 08 March 2010 22:31 Go to previous messageGo to next message
Corey Ashford is currently offline Corey AshfordFriend
Messages: 9
Registered: July 2009
Junior Member
I've experimented with remote build and debug support in the CDT in the last couple of weeks. I've found a couple of things:

1) If you create a project, and specify an RSE path for the directory (instead of in your workspace), it will successfully create a C/C++ project. The only problem is that if you'd like to be able to work on that project from multiple workstations (running Eclipse), it forces you to overwrite the Eclipse .project and .cproject files for every machine you set up. I haven't tried switching from one workstation to another afterwards to see how well that is handled.

2) The only way I've gotten remote make to work is to change the command to do "ssh <host> make -C <remote_dir>". If you have your ssh keys set up properly so that no password is needed on the remote machine, this should work.

3) I was unable to get remote debugging to work. I tried changing the command from "gdb" to "ssh <host> gdb", but I just get errors when attempting to launch the debugger. Thinking that perhaps the CDT was trying to use the whole string as the command name for gdb, I created a little C program locally that launches gdb on the remote machine with and passes the arguments onto the remote gdb. This didn't work either, even though I could successfully launch a remote gdb session just from the cygwin command line.

4) The binary parsers don't work for this case because they are local cygwin-based tools that have no access to the RSE filesystem in Eclipse. Also, the CDT doesn't provide any sort of customization for binary parsers, such that I could substitute a command like "ssh <host> addr2line" for addr2line.

So it seems this use case for remote development via CDT + RSE is only about 60% there.

Re: Remote C development [message #519500 is a reply to message #519469] Tue, 09 March 2010 03:14 Go to previous messageGo to next message
Corey Ashford is currently offline Corey AshfordFriend
Messages: 9
Registered: July 2009
Junior Member
Corey Ashford wrote on Mon, 08 March 2010 17:31

...4) The binary parsers don't work for this case because they are local cygwin-based tools that have no access to the RSE filesystem in Eclipse. Also, the CDT doesn't provide any sort of customization for binary parsers, such that I could substitute a command like "ssh <host> addr2line" for addr2line.
...


I was mistaken about this part. If I select GNU elf parser or Cygwin PE parser, I can modify the "addr2line" command to something else, but this functionality is broken because if you click OK after changing the command then re-open this dialog, the command goes back to its original setting of "addr2line". It doesn't appear to matter what I set that field to, it always returns to its original setting after clicking OK. So this is another bug. Even so, it's not clear that this could ever work, because I don't know what sort of pathname the CDT would provide to the binary parser. Is it an "rse://..." pathname or a raw, remote pathname or ... ? I have the same issue with the setting of the gdb command.

In general, CDT + RSE seems good enough to index and navigate C/C++ source code remotely, but it's not ready for prime time when it comes to building, executing or debugging remotely.
Re: Remote C development [message #519518 is a reply to message #519469] Tue, 09 March 2010 07:58 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Quote:
3) I was unable to get remote debugging to work. I tried changing the command from "gdb" to "ssh <host> gdb", but I just get errors when attempting to launch the debugger. Thinking that perhaps the CDT was trying to use the whole string as the command name for gdb, I created a little C program locally that launches gdb on the remote machine with and passes the arguments onto the remote gdb. This didn't work either, even though I could successfully launch a remote gdb session just from the cygwin command line.

Debugging works with a gdbserver on the target host.
http://www.embedded-linux.co.uk/tutorial/eclipse-rse


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Remote C development [message #519717 is a reply to message #519518] Tue, 09 March 2010 18:33 Go to previous messageGo to next message
Corey Ashford is currently offline Corey AshfordFriend
Messages: 9
Registered: July 2009
Junior Member
Axel Mueller wrote on Tue, 09 March 2010 02:58
Quote:
3) I was unable to get remote debugging to work. I tried changing the command from "gdb" to "ssh <host> gdb", but I just get errors when attempting to launch the debugger. Thinking that perhaps the CDT was trying to use the whole string as the command name for gdb, I created a little C program locally that launches gdb on the remote machine with and passes the arguments onto the remote gdb. This didn't work either, even though I could successfully launch a remote gdb session just from the cygwin command line.

Debugging works with a gdbserver on the target host.
http://www.embedded-linux.co.uk/tutorial/eclipse-rse


Thanks for your reply.

If my remote machine's architecture is different from x86 (on my Windows machine), will a standard cygwin gdb work with gdbserver on the remote machine?

I suspect not, and that I would need a cross gdb built for the target architecture. The link you cited uses as an example an ARM architecture board, but they also have Windows-hosted development tools (such as gdb, I would assume) for that architecture.

So I think what you're saying is possible, if I build a cross-targeted gdb, but I'd rather not have to do that, particularly when I already have an integrated GNU tool chain on the remote machine. In my case, the remote machine is a server running Linux, not an embedded board.

The other alternative is to run Eclipse on the remote machine, and then access that Eclipse session via X or VNC, but that has some downsides as well, especially over connections with large amounts of latency.
Re: Remote C development [message #519818 is a reply to message #519717] Wed, 10 March 2010 03:55 Go to previous messageGo to next message
Inprise  is currently offline Inprise Friend
Messages: 2
Registered: March 2010
Junior Member
Hi Experts,

I am new with Eclipse,what we trying to do is to create a makefile,build,execute from windows in Eclipse using RSE ,Remote machine is a Linux Box.

I tried using CDT,RDT and created a Remote C/C++ sample code ,which is not geting build from eclipse window

Is it because of compiler issue?

My sample code

main.cpp
#include <iostream>
using namespace std;

int main () {
// Say Hello five times
for (int index = 0; index < 5; ++index)
cout << "HelloWorld!" << endl;
char input = 'i';
cout << "To exit, press 'm'" << endl;
while(input != 'm') {
cin >> input;
cout << "You just entered " << input
<< " you need to enter m to exit." << endl;
}
exit(0);
}
and my make file works fine if i do the same from Linux box i am able to get the object file whereas if i try through eclipse to generate its failing with message
"Error launching external scanner info"

INCLUDES = -I ./include

CC = g++ -g -Wno-deprecated
CFLAGS = -c $(INCLUDES)

all : main

main : main.o
$(CC) main.o -o main
main.o : main.cpp
$(CC) $(CFLAGS) main.cpp

clean :
rm -f *.o

Please give me some pointers ....
Re: Remote C development [message #520043 is a reply to message #234592] Wed, 10 March 2010 22:37 Go to previous messageGo to next message
Artem Mygaiev is currently offline Artem MygaievFriend
Messages: 11
Registered: March 2010
Junior Member
Eclipse Galileo

System with Eclipse: Windows Vista 64bit (no toolchain installed)
System for build/debug: Linux Centos5 32bit (GCC 4.1.1)

RSE connection used - SSH for all connections.
When creating a simple C project (GNU toolchain, Elf parser) in Eclipse using RSE following issues observed:
* no way to build project, following error appear: **** Build of configuration Default for project test **** (Cannot run program "make": The directory name is invalid.)
* no way to perform checkout from CVS/SVN/Git
* Elf parser does not detect binaries

Conclusion: CDT/RSE is not usable at the moment at all Sad

Any chances to get this working in the near future?
Re: Remote C development [message #635760 is a reply to message #519717] Thu, 28 October 2010 02:20 Go to previous message
Rich is currently offline RichFriend
Messages: 1
Registered: October 2010
Junior Member
I'm curious if you were successful at remote c/c++ building/debugging on a linux machine from a windows instance of eclipse. I have a RSE connection working, but have not been successful at getting a remote build/debugger working. Any help would be appreciated
Previous Topic:Launch GDB with options from Eclipse
Next Topic:mingw/gdb: Problems debugging dll from another project
Goto Forum:
  


Current Time: Fri Mar 29 13:35:55 GMT 2024

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

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

Back to the top