Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » gdbserver not started for remote debugging
gdbserver not started for remote debugging [message #1743652] Sun, 18 September 2016 09:03 Go to next message
ofer livny is currently offline ofer livnyFriend
Messages: 4
Registered: September 2016
Junior Member
Hi all

I have experience with remote debugging of c++ applications on linux ARM targets, and I'm trying to do the same on a new project I'm working on and need your assistance.

Linux target runs open-ssh server, and has gdbserver installed. (Yocto is used to build everything)
Ubuntu host runs eclipse NEON, has Linaro toolchain, and can connect to target using ssh (with name & password).

I've configured a c++ remote application configuration, that is supposed to run the remote binary using gdbserver and connect to it using gdb.

However, when I run this configuration, I get the following output in the console:
Last login: Wed Sep 14 11:53:29 2016 from ofer-pc.adas.local
/usr/bin/gdbserver  :2345 /some/path/bin/app;exit

78
root@target:~# 



console is then interactive, gdbserver did not start.
But I can now run the same gdbserver command in the interactive console, this time manually, successfully. gdb connects etc.

What am I doing wrong?
Can it be a target encoding support issue? Eclipse configuration?
I can't find a way to see what exactly is eclipse running to get connect to the target. Can anyone suggest a way to debug that?

Thanks!
Re: gdbserver not started for remote debugging [message #1743755 is a reply to message #1743652] Mon, 19 September 2016 13:05 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Is it normal that you get a root prompt?
Did the 'exit' command at the end of the gdbserver command actually run?

You can try to reproduce this by hand by looking at the type of connection you
are using in your remote launch to see what it is (ssh, telnet, etc).
Then try to do the same connection by hand and then give it the command:

/usr/bin/gdbserver :2345 /some/path/bin/app;exit

to see what happens.
Re: gdbserver not started for remote debugging [message #1743802 is a reply to message #1743755] Mon, 19 September 2016 17:19 Go to previous messageGo to next message
ofer livny is currently offline ofer livnyFriend
Messages: 4
Registered: September 2016
Junior Member
Hi Marc

It is normal to get a root prompt. It is an ARM target that is now in bring-up stage, and root access is all we require at this point.
The exit command at the end of the gdbserver command did not run. It was only printed to console along with the gdbserver command, and then the console became interactive - so I could choose to run gdbserver, exit, or whatever I wish to run on the target, interactively.

I'm using ssh, as mentioned in the original question, and I can easily run gdbserver manually with ssh from bash shell, or from the interactive shell I'm getting in eclipse after gdbserver doesn't start automatically.

Meanwhile I've found these links:
https://community.nxp.com/thread/395341
https://www.eclipse.org/forums/index.php/t/1077899/

which suggest the problem is common to targets that run stuff built by Yocto.
I've tried the same with a target that is setup using buildroot, and things work as expected.
I've verified its the same openssh version on both setups, so its not that.

What can be the difference between buildroot to yocto on this context? Can it be the locale? The shell itself?
Can eclipse be more verbose in the SSH actions it is taking? Can the logs be more verbose?

Thanks!
Re: gdbserver not started for remote debugging [message #1743959 is a reply to message #1743802] Wed, 21 September 2016 07:23 Go to previous messageGo to next message
ofer livny is currently offline ofer livnyFriend
Messages: 4
Registered: September 2016
Junior Member
Another piece of information:
Before I got to the originally described situation, I encountered another difficulty that might be related.
The ARM target file-system originally did not contain 'locale'.
When I initially tried to remote debug, eclipse failed connecting to the target giving the error: "org.eclipse.remote.core.exception.RemoteConnectionException: sh: locale: command not found"
Only after I manually added locale support (which I'm not sure I've done correctly), eclipse succeeded connecting to the target, but as I originally described - without being able to run anything.
Hope this helps someone to help me...
Re: gdbserver not started for remote debugging [message #1743988 is a reply to message #1743652] Wed, 21 September 2016 10:08 Go to previous messageGo to next message
adleyami ami is currently offline adleyami amiFriend
Messages: 1
Registered: September 2016
Junior Member
Hi guys,

I think other people have had that problem but I could not find an answer. I am working with Ubuntu 15.10 and followed all the instructions to set up the remote debugging. In the step to make the file system writable (ssh root@192.168.178.45 rw (change to your pitayas' ip!)) I get the following message:

bash: rw: command not found

GDBserver i copied manually into the filesystem. I can not find the error. I would be great full for any suggestions. The remote connection works perfect. That is the console output of the debugging:
Re: gdbserver not started for remote debugging [message #1818327 is a reply to message #1743988] Thu, 12 December 2019 15:28 Go to previous messageGo to next message
Benjamin Martin is currently offline Benjamin MartinFriend
Messages: 12
Registered: December 2019
Junior Member
Sorry to bump an old post here, but has anyone figured out the solution to this issue? I am using a resource-constrained target which does not have /usr/bin/locale installed. The first time that Eclipse tries to launch a remote debugging session, it will fail with a "sh: locale: command not found" error. What's weird though is that it works fine for subsequent remote debugging sessions until I reboot the target. (After a reboot, Eclipse will always return a "sh: locale: command not found" error the first time I try to debug and then operate normally after that.)

I tried manually specifying the encoding in the debug settings to side-step the call to /usr/bin/locale, but that did not help. Any suggestions on other things to try?
Re: gdbserver not started for remote debugging [message #1844707 is a reply to message #1818327] Wed, 22 September 2021 11:15 Go to previous messageGo to next message
Tim Howe is currently offline Tim HoweFriend
Messages: 1
Registered: September 2021
Junior Member
The year is Sept 2021 and I am experiencing this issue with eclipse 2019-09
The command sent to start the remote gdbserver is
gdbserver :2345 /home/analog/ned;exit
The error response is
7resize: unknown character, exiting.

Manually copying/pasting the same gdbserver launch string into the gdb console causes the whole debug sessionto run correctly.

This same installation of eclipse has operated completely normally with a different remote system, using a different local (cross) gdb and remote gdbserver, so it is likely that this problem is a quirk of either gdbserver or cross-gdb

Thanks

Update: If I cripple /usr/bin/resize on the target (by renaming it) then the debug launch goes through without a hitch. I dont yet know why eclipse would be attempting to use resize on the target or indeed if there is a problem with the resize app on the target (though it appears to work if used stand-alone)

Does anyone know if there is an eclipse script that I can edit to alter the command sequence used to remote launch gdbserver?

[Updated on: Wed, 22 September 2021 14:57]

Report message to a moderator

Re: gdbserver not started for remote debugging [message #1844710 is a reply to message #1844707] Wed, 22 September 2021 14:32 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

What happens with 2021-09?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: gdbserver not started for remote debugging [message #1844716 is a reply to message #1844710] Wed, 22 September 2021 18:32 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
How did you set up the debug configuration?

I have just open an Eclipse CDT + GDB connection to a Raspberry Pi gdbserver, works fine.


--

Tauno Voipio
Previous Topic:mpirun with arguments
Next Topic:Building class - what are these for - Final class , Unit test ?
Goto Forum:
  


Current Time: Fri Apr 19 23:25:09 GMT 2024

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

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

Back to the top