Direct Remote C++ Debugging

Add this URL to your Eclipse Installation to reach this solution's update site.

2021-03 (4.19), 2020-12 (4.18), 2020-09 (4.17), 2020-06 (4.16), 2020-03 (4.15), 2019-12 (4.14), 2019-09 (4.13), 2019-06 (4.12), 2019-03 (4.11), 2018-12 (4.10), 2018-09 (4.9), Photon (4.8), Oxygen (4.7), Neon (4.6)

https://mabdelazim.github.io/DirectRemoteDebug/RemotDebugUpdateSite_1_2/

Mars (4.5), Luna (4.4)

https://mabdelazim.github.io/DirectRemoteDebug/RemotDebugUpdateSite/

Learn more...
Solution Description

A plugin to debug C++ Application remotely The gdb is running on remote system using ssh protocol It is only required to have gdb installed in the remote server. (The gdbsever is not required by this plugin). The debugger invokes the program in the remote system and starts debugging it. The source code files in the eclipse project can be a copy of the remote source code which is used to build the program. In this case an automatic mapping between the local and remote source code happens so you can set breakpoints in Eclipse project as you do in normal debugging. Eclipse and the debugged program can be on different platforms . For example you can debug from Eclipse running on Windows a program which runs on Linux system. To use it,: Open "Debug Configurations", select "C/C++ Remote Application", right click and click "New". From the bottom of the page click "Select other..", click "Use configuration specific settings", then select ""Direct Remote Debugging Launcher" from launchers list. Enter your remote settings and start debugging Note: "Remote workspace directory" field points to the location of the source code copy on the remote machine. While you select any field in the Main tab you can click Help icon (in bottom right), then click on "Launching Remote C/C++ Applications Directly" to get help about the pluging including the settings fields All standard C++ debugging features in Eclipse are supported ( the plugin is based on DSF framework).

Categories: Languages, Tools

Additional Details

Eclipse Versions: 2021-03 (4.19), 2020-12 (4.18), 2020-09 (4.17), 2020-06 (4.16), 2020-03 (4.15), 2019-12 (4.14), 2019-09 (4.13), 2019-06 (4.12), 2019-03 (4.11), 2018-12 (4.10), 2018-09 (4.9), Photon (4.8), Oxygen (4.7), Neon (4.6), Mars (4.5), Luna (4.4)

Platform Support: Windows, Mac, Linux/GTK

Organization Name: mabdelazim@gmail.com

Development Status: Mature

Date Created: Saturday, June 6, 2015 - 16:03

License: GPL

Date Updated: Monday, December 5, 2022 - 22:31

Submitted by: Mohamed Abdelazim

Date Ranking Installs Clickthroughs
October 2024 186/598 47 1
September 2024 196/642 102 13
August 2024 219/641 69 11
July 2024 208/663 81 10
June 2024 225/681 77 12
May 2024 197/682 108 13
April 2024 202/687 112 7
March 2024 226/694 97 3
February 2024 199/687 109 9
January 2024 195/691 121 9
December 2023 195/671 115 7
November 2023 182/686 153 12
View Data for all Listings

Unsuccessful Installs

Unsuccessful Installs in the last 7 Days: 3

Download last 500 errors (CSV)

Marketplace Drag to Install Button

By adding the following code below to your website you will be able to add an install button for Direct Remote C++ Debugging.

HTML Code:

Markdown Syntax:

Output:

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

Reviews Add new review

Eclipse 2022-03 (4.23.0) for windows - looks like the same problem as described below in 'Stuck in "Starting program"'. Launching (gdb at Linux) just stuck at "Starting program" - in my case at 20%, the same error message and nothing in console at all.

    I am running  "Eclipse IDE for C/C++ Developers (includes Incubating components) Version: 2022-03 (4.23.0) Build id: 20220310-1457" locally on a Mac,
    and debugging c & C++ executables running in a Linux machine, running "GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7".
    I installed "Direct Remote C++ Debugging 1.2.0.0" on my Eclipse and finished the setup.
    The very begining of the debug worked well, But then after a while, the 'Variable's view showed errors on some variables, then all variables are empty now.
    Even worse, now it is stuck in a step, none of 'Step Over', 'Step Into' or 'Resume' could move a step!
    I could not even terminate the debugging. Seems Eclipse doesn't recognize any instruction from me.
    What could I do? Any help is appreciated!

Hi,

I am running  "Eclipse IDE for C/C++ Developers (includes Incubating components) Version: 2022-03 (4.23.0) Build id: 20220310-1457" locally on a Mac, and debugging c & C++ executables running in a Linux machine, running "GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7". I installed "Direct Remote C++ Debugging 1.2.0.0" on my Eclipse and finished the setup.

 

The very begining of the debug worked well, But then after a while, the 'Variable's view showed errors on some variables, then all variables are empty now. Even worse, now it is stuck in a step, none of 'Step Over', 'Step Into' or 'Resume' could move a step! What could I do? Any help is appreciated!

Thank you in advance,

Jamie

launching the debug configuration gets stuck at "starting program" (45%).

It gets stuck like this forever. Then if I try to abort I get the error: "Could not start gdb on the remote host by ssh. See console output for more details"

note: the console has no output at all. Even when I redirect to a local file.

 

How can I pass arguements to the application being debugged? (the arguments tab in the normal debug configurations)

Hello, I am trying to debug a program on a remote Linux server from my Windows laptop using your plugin. I set up a remote debug configuration, but when I try to start debugging, it asks me for SSH credentials, and then gives me this error: Error creating Terminal Do you have any idea what it means and where to get more information? I am not sure if I specified all the parameters for my debug configuration correctly - is there a tutorial on how to use your plugin? Any help would be greatly appreciated -- thank you!

I have installed version 1.2.0.0 in Eclipse Neon.

When I try and create a new Connection after selecting "Direct Remote Debugging Launcher", it pops up a dialogue box to "Select remote system type", but the list is empty?  Am I supposed to setup the system types somewhere else in eclipse?

Regards

The version 1.2 is avaible now. It includes  a fix for "Error with command: gdb --version Cannot run program 'gdb': Launching failed" problem and many others problem as well. 

 

Hi,

 

I am running Eclipse Neon on Linux and my target is a centos virtual box. I am using vagrant to contact the virtual box.

What SSH ports or GDBServer ports does your plugin use? I will have to set up port forwarding in my vagrant config file to allow this to work.

 

Thanks!

 

jheaff

In reply to by Jack Heaff

So I now have the remote debugging plugin working perfectly! It seems that if any of the "prerun commands" in the debug configuration contained commands that printed to stdout, like "pushd or popd", then the plugin seemed to fail. By piping stdout to >/dev/null it now works!

I got the following error :

Error with command: gdb --version Cannot run program "gdb": Launching failed

 

It seems I'm not the only one : (see stackoverflow.com/questions/42143458/debugging-in-eclipse-with-remote-gdb). It is exactly the same behavior.

 

 

Hi,

I think that I missed something in the configuration.

I have a Linux dev server with Eclipse  and a solaris 10 Sparc target.

Workspace/ eclipse project and sources are shared via NFS

When I launch debugging, the process get stalled on "Starting Program".

On the server side, I see a new sshd process launched.

When I stop, I got the error "Could not start gdb on the remote host by ssh. See console output for more details"

In the debugger tab, the GDB debugger refers to one defined on the Solaris server.

Is there someone who had this pb ?

Thank you very much

Regards

Gael

 

I have the same problem as reported by Mohammad Abdo
I'm also running Windows 10 on my local PC with Eclipse Neon (4.6.0) and trying to connect to a linux machine over ssh.
The ssh connection itself is succesful, but launch of the debug configuration gets stuck with no error or debug messages.

Getting the fallowing error message while drag the download on this page into eclipse:
Unable to read repository at http : //mabdelazim.github.io/DirectRemoteDebug/RemotDebugUpdateSite_1_1/content.xml.
org.apache.http.client.ClientProtocolException

Hi, I have a completely different issue:
I am running windows 10 on my local (laptop) with Eclipse mars (4.5.2), where as my server runs linux with gdb 7.5.1
This GDB was configured as "x86_64-unknown-linux-gnu".

I have tried to perform the process and it did not give me any errors but when it starts launching it takes forever at 24% and nothing happens after that.

In reply to by Mohammad Abdo

I have the same problem,
I'm also running Windows 10 on my local PC with Eclipse Neon (4.6.0) and trying to connect to a linux machine over ssh.
The ssh connection itself is succesful, but launch of the debug configuration gets stuck with no error or debug messages.

Hi All
The version 1.1 has been published for Eclipse Neon version.
The problems similar to /dev/ttyp0 are solved now.
Please give me feedback about any new problems.

In reply to by bryan fok

I got some idea what is happening now. Each time the plugin hit the debug it try to connect to a dev/pts for input/output. But the plugin didn't get the one belong to my account (there are different users using the debug server aswell), therefore, it return a "permission denied" error. I have observed, each time the plugin try increment 1 on the /dev/pts, e.g. /dev/pts/14, /dev/pts/15, /dev/pts/16, etc.

Solution suggestion?

Just what i had been searching for more than a year. The existing remote debugging with gdb-server and gdb was not very easy to use, as we already had to do lot of cross compilations on linux and configurations on windows eclipse.

I used this and tried to attach a debugged to a running process of linux, it listed all my windows processes, i figured that it was because my version of gdb does not support listing the threads and process, so i had to write a hack to change the "listtasks.exe" to actually do a connect to the linux machine and get all the processes. Thought i will check with you and see if we can have an easy way.
Additionally, i have been trying to load a core file using the windows gdb to load a core. This means that i need to have a target gdb on my machine and it was not easy. Can we adapt this project to also work for loading core file. I would actually like to contribute. You could probably guide me how to start contributing and let me know ur email id.

Hey there,

I got the following error when I tried to debug a remote application.

/dev/pts/5: No such file or directory.

My gdb version is 7.2

gdb --version
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-75.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
www.gnu.org/software/gdb/bugs/.

Anyone else seeing this? Solution?

Cheers!
Bharath

HI
Thanks for the information.
It sounds the plugin has problem with version 7.10 now. This version is not tested yet.
Please send me your contact email so we can add a support for it.
As as a temporary workaround you can install gdb version 7.2 on the server and make it the default gdb

Thanks a lot for sharing this with us.

Best Regards
Mohamed Abdelazim

I couldn't get it to work. I set up the debug launcher as you mentioned in the description. I did run the debugger but I'm getting the error:

/dev/ttyp0: No such file or directory.

I'm not sure how to solve this issue. It'll be great if you could give more information about the error and any ways to solve this will be greatly appreciated.

Thanks

In reply to by Pranav Ladkat

Please make sure the ssh server is running on your server and gdb is installed.
You can check this by connect by ssh to the sever from command line or from putty and run gdb manually .

Please send me the OS you run Eclipse on it, the server OS and the gdb version.
Please also send the whole console output when you run the debugger.

In reply to by Mohamed Abdelazim

I do have a running ssh with the server, I'm using eclipse's synchronized C++ project to sync between local and remote through ssh. The remote and local machine has same version of gdb but the OS is different. I have mac on local machine and ubuntu on remote. Following is the console output I get when launched debugger through this plug-in:
###############################
GNU gdb (GDB) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:

Find the GDB manual and other documentation resources online at:

For help, type "help".
Type "apropos word" to search for commands related to "word".

/dev/ttyp2: No such file or directory.

###############################

In reply to by Pranav Ladkat

I got the same error. I use Mac OS 10.10 as host machine and Ubuntu 14.04 64 bit as remote machine.

As gdb cannot find /dev/ttyp2 on the remote machine, I create a link to /dev/tty1 as a temporary solution:
e.g., sudo ln /dev/tty1 /dev/ttyp2

PS. You may want start from 0: sudo ln /dev/tty1 /dev/ttyp0

Hope this can help!