Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Direct Remote C++ Debugging error running gdb
Direct Remote C++ Debugging error running gdb [message #1733559] Mon, 30 May 2016 07:13 Go to next message
Christian Mouilleron is currently offline Christian MouilleronFriend
Messages: 1
Registered: May 2016
Junior Member
Hi

I am currently trying to debug an application on a Embedded linux (generated with yocto). Cross compiling with the generated toolchain works like a charm but when I try to debug with the Direct Remote Debuuger from the market place, the progress bar remains stucked at 57% and canceling the action returns the error : "Could not start gdb on the remote host by ssh". GDB is installed on both target and host and I can run it over ssh using a terminal (even in eclipse RSE).
The remote debugging using gdbserver works but it is way to slow.

Thanks for helping me solving this problem.

Re: Direct Remote C++ Debugging error running gdb [message #1734460 is a reply to message #1733559] Wed, 08 June 2016 14:06 Go to previous messageGo to next message
star bright is currently offline star brightFriend
Messages: 17
Registered: September 2015
Junior Member
I found it is hard to find someone to help. No ideas, what other use for debugging?!?

I am in simular situation. I followed the tutorial here: http://janaxelson.com/eclipse5.htm

I get connection via ssh, and the binary is uploaded. BUT: neither the chmod command nor the gdb server is started.
Eclipse idles with Launching gdb: 57%.

On Console I can see the command (below), but is will not executed. But I can execute the commands, an than it goes on with debugging. Looks like a timing problem or something like that.



Last login: Mon Jun 6 08:04:30 2016 from 172.20.20.171
echo $PWD'>'
chmod 777 /opt/sp_shell.o;gdbserver :2345 /opt/sp_shell.o;exit
root@sp:/opt#


Re: Direct Remote C++ Debugging error running gdb [message #1734468 is a reply to message #1734460] Wed, 08 June 2016 14:41 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Are you attempting to run an object file?
It seems to me that you're missing the target file linkage processing phase.

The debugger (or the target system directly) cannot run an unlinked object file. If this is not the case, please do not name a run file to .o.


--

Tauno Voipio
Re: Direct Remote C++ Debugging error running gdb [message #1734510 is a reply to message #1734468] Thu, 09 June 2016 05:16 Go to previous messageGo to next message
star bright is currently offline star brightFriend
Messages: 17
Registered: September 2015
Junior Member
Sorry, naming it *.o is not correct, it is an elf executable. So this is not nice, but not the issue.
On console I can see the correct comandline is transferred to remote device, but (due to timing, permission,????) not executed.
But again. Typing this command (which is issued by Eclipse) to the shell in Eclipse, it works.

Eclipse opens ssh connection
it transfer the file in the proper directory on remote device
But: it transfers commandline to remote device (chmod 777 /opt/sp_shell.o;gdbserver :2345 /opt/sp_shell.o;exit), but device will not execute this.

Does someone know where this line is coming from (and what is it for?) : echo $PWD'>' ?

Because if I login via ssh I just get :
Last login: Mon Jun 6 07:58:54 2016

May be this the reason for this misbehaviour?

Re: Direct Remote C++ Debugging error running gdb [message #1734524 is a reply to message #1734510] Thu, 09 June 2016 07:23 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Can you start gdbserver on the target if you connect using ssh and use the ssh console?

Do you use the proper gdb to connect to the gdbserver? It is easy to make the mistake of using the host gdb at the development machine instead of the cross-gdb for the target.

Depending on the setup of the target system, your gdbserver may need root privileges to run on the target.

---

On most current GNU toolchains, even the .o files are ELF. You mean that the .o file is now an absolute linked run module for the target processor, right?

---

The 'echo $PWD>' is the shell prompt. It is set up in the startup scripts. There are different ways to organize them, depending on your distribution.


--

Tauno Voipio
Re: Direct Remote C++ Debugging error running gdb [message #1734679 is a reply to message #1734524] Fri, 10 June 2016 09:24 Go to previous messageGo to next message
star bright is currently offline star brightFriend
Messages: 17
Registered: September 2015
Junior Member
Yes, I can operate completly remote.
This is, what Eclipse shows me in its terminal:

Last login: Mon Jun 6 08:04:30 2016 from 172.20.20.171
echo $PWD'>'
chmod 777 /opt/sp_shell.o;gdbserver :2345 /opt/sp_shell.o;exit
root@sp:/opt#


The only I have to do is copy this line "chmod ..." and paste it in exactly the same eclipse window. So it's not an issue of timing or wrong versions. ... And I am logged in as root, as you can see...

[Updated on: Fri, 10 June 2016 09:24]

Report message to a moderator

Re: Direct Remote C++ Debugging error running gdb [message #1734709 is a reply to message #1734679] Fri, 10 June 2016 13:30 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Try the following:

Start gdbserver in the target, using ssh.

Start cross-gdb on the development host with the proper run file specified,
and set target to the remote_ip:gdbserver_port.

If it does not work, there is an option in GDB to start tracing the remote connection.


--

Tauno Voipio
Re: Direct Remote C++ Debugging error running gdb [message #1735087 is a reply to message #1734709] Wed, 15 June 2016 13:22 Go to previous messageGo to next message
star bright is currently offline star brightFriend
Messages: 17
Registered: September 2015
Junior Member
Mh, thats even more work than do the copy and paste I described.
I am wondering why this transfer of command line (or better its execution) failes.
Re: Direct Remote C++ Debugging error running gdb [message #1743658 is a reply to message #1735087] Sun, 18 September 2016 12:15 Go to previous messageGo to next message
ofer livny is currently offline ofer livnyFriend
Messages: 4
Registered: September 2016
Junior Member
Is there a resolution to this problem?
I encounter the same issue - the gdbserver command is printed to console but not executed. but when I copy and paste it to the same console - it works.
Using eclipse NEON on Ubuntu host and linux+openSSH (built using Yocto) on target.
icon5.gif  Re: Direct Remote C++ Debugging error running gdb [message #1744038 is a reply to message #1743658] Wed, 21 September 2016 15:57 Go to previous messageGo to next message
Michael McCarthy is currently offline Michael McCarthyFriend
Messages: 1
Registered: September 2016
Junior Member
I have the exact same issue here and also running a yocto ARM build. From the console output it sure looks like it sends the shell commands too early, prior to the shell actually starting and giving a prompt so they don't get invoked. Here is a console shot of what happens in my environment:

gdbserver :2345 /home/root/neon/ecanProcess;exit

Last login: Wed Sep 21 11:22:00 2016 from 192.168.243.63

78root@ls1021aiot:~#

If I simply cut and paste the first line at the prompt, eclipse seems to attach and run the debug session just fine. I also tried a manual ssh and executing the command line and it seems to work. I have got to think there is something wrong in the sshd on the target?
Re: Direct Remote C++ Debugging error running gdb [message #1793892 is a reply to message #1744038] Sun, 19 August 2018 09:59 Go to previous messageGo to next message
Mohamed Abdelazim is currently offline Mohamed AbdelazimFriend
Messages: 4
Registered: July 2015
Junior Member
The "Direct Remote C++ Debugger" plugin from Marketplace has been just updated. You can try the new version is more stable and could fix your problem.
Re: Direct Remote C++ Debugging error running gdb [message #1844179 is a reply to message #1733559] Sun, 05 September 2021 02:03 Go to previous message
h zy is currently offline h zyFriend
Messages: 1
Registered: September 2021
Junior Member
I met the same situation. I clone the src from github and find out the proce,ss has got the remote cmd "gdb -version" output but except the output contains "This GDB was configured as" otherwise process would waiting. But excute 'gdb -version'(version 9) from my remote (ubuntu20.04) got output
"GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 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."
which does not contains the pattern "This GDB was configured as".
Previous Topic:Eclipse with ESP-IDF plugin: I keep having to rebuild the index for no reason
Next Topic:Build not configured correctly
Goto Forum:
  


Current Time: Tue Mar 19 11:02:37 GMT 2024

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

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

Back to the top