Can an IDE/Netbeans connect to a remote computer and compile/run/debug code on it? - c++

I'm developing a program for a specific environment. That means it needs to run on the OS and compile using its compiler. I have a different environment at home (Windows 8) is there a way Netbeans can be used to connect to the target environment and use its compiler? It is enabled for remote login.
So basically right now I write code on my home computer, connect using Putty to the target computer, copy the source code over, compile it and run it. I'm trying to simplyfy this process so I only have to use Netbeans.
Why don't I just get same compiler and do everything locally? The target computer is running Linux and the program has a lot of system calls.
I know Aptana has a simillar feature, but Aptana is so crappy in general I don't want to use it.
Let me know if my question doesn't make sense and I'll try and reword it.

Yes, you can do remote development in NetBeans. It's described in its Help subsystem:

Related

Can I remote debug a C++ makefile project from a windows vm using Eclipse?

I am on a Windows VM which has eclipse installed.
I connect to a remote centos machine using putty (yes command line)
I work on a large C++ makefile project there.
I have learnt to use gdb within putty and everything is ok.
Is there any way I can use Eclipse present in my Windows to debug the C++ makefile project present in my remote CentOS machine ?
I have the following installed on my windows VM
Winscp
Putty
Eclipse
I wont be able to install anything else.
I also wont be able to install anything else into my centos machine unless I can justify the reason.
I believe this is NOT an exact duplicate.
I searched high and low for a solution to this, most answers seem to be for a different application or requires some additional installations or maybe the instructions are not clear.
Please provide me a step to step guide as I am new to Eclipse, and 2yrs old into linux.
Basically a windows programmer, I have seen a VS solution to remote debugging, but I wont be able to install VS into my remote machine so thats out of question.
So the above ... or ... any GUI (Visual Studio kind) type solution that would make the remote command line GDB ... a breeze.

How to pass source files to gdbserver

I'm trying to debug a remote C++ application using.
My setup is two machines (1) remote (where the c++ application and gdbserver runs) and (2) dev where I like to debug from and where the source code is accessable.
Important: The remote doesn't contain the source code (And I can't add it to the remote).
The only please I have seen referring to this kind of setup is here using the monitor command. But I wasn't able to make sense of it.
Is it possible to have the source code on one machine and the application running on the other?
Using gdb on dev can I debug the application with source code support?
Can it be achieved via vscode?
The remote doesn't contain the source code
That is the usual setup.
The only please I have seen referring to this kind of setup is here using the monitor command.
Please correct your grammar, and note that the monitor command should only be used under rare circumstances, and likely has nothing to do with your problem.
Is it possible to have the source code on one machine and the application running on the other?
Yes. That is how remote debugging usually works.
Using gdb on dev can I debug the application with source code support?
Yes. That is exactly what remote debugging is. It just works.
Can it be achieved via vscode?
Probably, but I don't know much about vscode.

Eclipse Remote Debugging CDT tutorial

TL;DR: is there a step by step tutorial to do remote code debugging using Eclipse Neon?
I have the source code in a Linux machine with a GCC dev environment. Normally, I ssh to the box, edit the file, and compile/debug using gdb, and it works, but it is a bit clunky for me.
I am now trying to debug the code from my Windows machine using the latest Eclipse version (Neon as of this writing).
I've tried following the instructions online (like this one), but they all seem to point towards (cross-)compiling the code locally, deploying it remotely and debugging there. This is not what I'm after. I essentially want to use Eclipse as a remote text editor+gdb interface, with the building and compiling being done in the remote system.
I've installed CDT, plus pretty much any plugin remotely related to remote development
Remote System Explorer
Remote Launch
GCC Cross compiler support
Remote (over TCF/TE) Run/Debug Launcher
Direct Remote C++ Debugging
TCF C/C++ Debugger
TM Terminal
So far, I can connect to the remote system, create a Remote Project and edit the source code.
I don't need Eclipse to compile the code (I can do that separately) but I'm unable to debug the code.
Using C/C++ Remote Application fails in many creative ways when trying to find gdb in the remote system.
Using GDB (DSF) Automatic Remote Debugging Launcher ends in a java.lang.NullPointerException, which also invalidates the configuration
Using Direct Remote Debugging Launcher asks about a remote workspace, then complains with "Error with command: gdb --version Cannot run program "gdb": Launching failed"
Remote Application complains about the Process/Image field. Setting it to the binary output doesn't enable the Debug button, so no dice.
TCF is dead in the water. It doesn't recognize the SSH connections I set up on RSE, it asks for the username password (I use public keys) and root password (?!) Even when entering that info, it fails to continue.
On a whim, I tried NetBeans, and followed the instructions here, and got it working in five minutes. The mode I'm following is the "Full Remote Development" according to NetBeans. The reason I'll still need to stick to Eclipse is that it is the dev environment that we use in the company, and it makes little sense to me to add another IDE to do something that Eclipse by all rights should do no problem.
What I find is that the walkthroughs for Eclipse I've found are either
Using plugins that are now either deprecated, not supported or have been completely reworked. Eclipse crashes and burns on these.
Trying to compile locally and deploy remotely, doing things like embedded even, but that's not what I'm looking for.
Using the Eclipse DStore client-server combo, which is essentially an alternative to SSH, but not what I'm looking for either.
I'm then hoping someone has written/found a tutorial that is relatively simple to follow (it is, after all, a relatively simple thing to do, as NetBeans has proven), and that works on any version of Eclipse.
I'll consider using an older version of Eclipse, but if so, please be specific in which version I should use, and which plugins I should install.

Can I configure C++ build and run options in eclipse CDT to point to a g++ on another computer

I have a server with a very slow connection. Hence installing eclipse on the server and taking an xwindow was not a good option.So What I attempted was to install eclipse on my client, set up sftp via nautilus and open my c++ files on my server inside my local eclipse. This works great. But to run the files, I need several libraries that are installed in the server which would be painful to install on every client I use. I am now opening an ssh connection separately in a terminal and using it to compile and run. But I felt it would be better if it is integrated with eclipse as I can make use of eclipse's debug tools and stuff. Hence I was wondering if I can make eclipse CDT point to the server's version of G++ compiler and linker, so When I press the debug or run button on eclipse it would actually run on the server and just give me the output in eclipse's console? Is this even possible?
PS - I am not addicted to eclipse. It would be great even if you can suggest any other software that would allow me to do this. I am basically doing all this just to debug my code faster with a number of break points.
I finally made it possible using Netbeans remote C++ development I found here. Works like a charm.

How to debug a linux C++ program from Windows with Eclipse?

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 :
Remote gdb
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 ?
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.
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.
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