Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] automatic dsf remote debugging launcher won't start gdbserver on remote target

I am cross-posting to TM group.

RSE component does reuse the same ssh session. However it creates when needed a dedicated ssh “shell” channel for each remote debug session, terminal view or other service The race is between
SSH_MSG_CHANNEL_REQUEST when sshd is forking a shell and sent a reply that request is fulfilled, and the following SSH_MSG_CHANNEL_DATA that do carry stream of characters for shell input (see https://tools.ietf.org/html/rfc4254#page-7)
 

BTW, Indigo SR1 did not helped in my case, as ssh daemon sends last login text before forked shell is able to handle input characters. Disabling last login text did help somewhat to reduce the occurrence.

 

Teo

p.s.

I have created https://bugs.eclipse.org/bugs/show_bug.cgi?id=467833 on how RSE could be improved to be reliable even with such issues.

 

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Tim Black
Sent: Thursday, May 21, 2015 04:21
To: CDT General developers list.
Subject: Re: [cdt-dev] automatic dsf remote debugging launcher won't start gdbserver on remote target

 

Also, the problem in that bug is that the eclipse RSE component is sending the command characters to the target immediately after the ssh session, but that the ssh server is not ready somehow. I don’t think this is the case here bc the problem happens even when the SSH session to the remote target has been "connected" long before invoking the GDB/DSF launcher. (I can manually connect the remote target using Remote Systems Explorer) This would appear to say that it is not a timing issue of the server "dropping characters" because Eclipse/RSE talks to it "too soon" or "before it is ready".

 

I am of course glibly ASSuming that RSE doesn't create a new SSH session for each remote debug session, that if I "pre-connect" the session using RSE (e.g. to browse files on the remote target), then when I launch CDT will reuse this session. Please comment on the accuracy of my assumption.

 

On Wed, May 20, 2015 at 6:05 PM, Tim Black <timblaktu@xxxxxxxxx> wrote:

Thanks Teo. Indeed I had been seeing the same shell-hanging behavior as was reported in this bug, when using other RSE functionality, such as listing all shell processes and seeing the connection hang. I will consider filing a new bug, but first I think I should look at our target's ssh server configuration to make sure there's nothing causing it to drop characters sent by Eclipse/RSE immediately after the ssh session is established.

 

Teo, in your case, was the situation resolved with patch fixing the bug you referenced, i.e. in Indigo SR1?

 

On Wed, May 20, 2015 at 6:25 AM, Madan Teo <teodor.madan@xxxxxxxxxxxxx> wrote:

I have encountered a similar situation with OpenSSH and dropbear servers on some embedded linux setup.

 

RSE opens a ssh shell channel and sends commands for shell execution e.g. “echo “ or “gdbserver ..” that are not executed. You can notice this with the fact that echo result has not been printed in the remote shell.

 

It seems to be a variation of https://bugs.eclipse.org/bugs/show_bug.cgi?id=356132 but with worse condition, i.e. it is not enough for RSE ssh shell support to wait for the first character to be received before deciding that the shell channel is fully functional.

 

Teo

 

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Marc Khouzam
Sent: Tuesday, May 19, 2015 21:27
To: CDT General developers list.
Subject: Re: [cdt-dev] automatic dsf remote debugging launcher won't start gdbserver on remote target

 

My guess is that your PATH is not set when doing the Eclipse remote connection and CDT cannot find gdbserver.
I recommend putting the full path to gdbserver in your launch configuration (Debugger tab -> Gdbserver Settings subtab -> Gdbserver path text box)

Marc


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Tim Black [timblaktu@xxxxxxxxx]
Sent: May 19, 2015 1:00 PM
To:
cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] automatic dsf remote debugging launcher won't start gdbserver on remote target

Eclipse CDT isn't automatically starting gdbserver on my remote target, when using a GDB/DSF Automatic Remote Debugging Launcher. Instead it presents a "Remote Shell" console with the correct gdbserver command printed, but nothing happens:

 

 

 

Code: [Select all] [Show/ hide]

 

Last login: Sat May  9 04:11:26 2015 from tblack-wheezy.local
echo $PWD'>'
gdbserver :2345 /tmp/MyApp;exit
zynq:~$ 

 


From this prompt, I can manually run gdbserver by entering the same command manually:

 

 

 

Code: [Select all] [Show/ hide]

 

gdbserver :2345 /tmp/MyApp
Process /tmp/MyApp created; pid = 993
Listening on port 2345
Remote debugging from host 172.20.15.8

 



and Eclipse CDT then starts the local gdb and connect to gdbserver, and successfully runs/debugs my remote app. 

Dev Host is intel i686 Debian Linux.
Remote target is Zynq/ARM Linux
gdb/gdbserver versions are 7.7.1. 
(Eclipse installation details below)
Remote debugging using gdb/gdbserver with same platform and application work fine.

So I'm trying to figure out why Eclipse CDT is hanging up at the very beginning. I've not had this problem with other targets. Since the problem is happening at the very beginning of the launch process, there is no useful information in the "Remote Shell" console and there is not yet any gdbtraces console (since gdb hasn't been started at the time of the problem). 

The tail of the eclipse .log file acknowledges the error:

 

 

 

Code: [Select all] [Show/ hide]

 

tblack@tblack-wheezy:~/workspace$ tail ~/workspace/.metadata/.log
 
!ENTRY org.eclipse.cdt.launch.remote 4 106 2015-05-18 13:55:02.717
!MESSAGE Could not start gdbserver on the remote host. See console output for more details.

 



But as I said, the console doesn't show any information. When I run the launcher, the Remote Shell console is opened and I am dumped to a shell prompt on the remote target. No commands are uttered by Eclipse CDT.

Here is the relevant portion of my launcher file:

 

 

 

Code: [Select all] [Show/ hide]

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.cdt.launch.remoteApplicationLaunchType">
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="/opt/poky/1.7.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value="zynq.gdbinit"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.HOST" value="172.20.102.15"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.PORT" value="2345"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TCP" value="true"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="true"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdbserver"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="MyApp"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="MyProject"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
<booleanAttribute key="org.eclipse.cdt.launch.remote.RemoteCDSFDebuggerTab.DEFAULTS_SET" value="true"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_GDBSERVER_COMMAND" value="gdbserver"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_GDBSERVER_PORT" value="2345"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_PRERUN_CMDS" value=""/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_SKIP_DOWNLOAD_TO_TARGET" value="true"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_TARGET_PATH" value="/tmp/MyApp"/>
</launchConfiguration>

 


I have tried also with org.eclipse.cdt.launch.DEBUGGER_ID using the full path to gdbserver on the remote target. No dice. (I knew it wouldn't work bc gdbserver is on that user's PATH).

And, for completeness, the gdbinit file zynq.gdbinit contains:

 

 

 

Code: [Select all] [Show/ hide]

 

set sysroot /opt/poky/1.7.1/sysroots/armv7a-vfp-neon-poky-linux-gnueabi
show sysroot
show solib-search-path

 



Installation Details:

 

 

 

Code: [Select all] [Show/ hide]

 

Kepler Service Release 2
Build id: 20140212-2123
 
CollabNet Merge Client 2.2.4    com.collabnet.subversion.merge.feature.feature.group CollabNet
  Eclipse CORBA Plug-in        0.7.0.218        net.sf.eclipsecorba.feature.group  eclipsecorba.sf.net
  Eclipse IDE for C/C++ Developers      2.0.2.20140210-0834       epp.package.cpp  null
    C/C++ Call Graph Visualization      1.1.0.201402102340        org.eclipse.linuxtools.callgraph.feature.feature.group     Eclipse Linux Tools
    C/C++ Library API Documentation Hover Help  1.0.0.201402102340        org.eclipse.linuxtools.cdt.libhover.feature.feature.group  Eclipse Linux Tools
    ChangeLog Management Tools for C/C++        2.8.0.201402102340        org.eclipse.linuxtools.changelog.c.feature.group  Eclipse Linux Tools
    Eclipse Platform  4.3.2.M20140206-1000      org.eclipse.platform.ide  null
    EPP CPP Feature   2.0.2.20140210-0834       org.eclipse.epp.package.cpp.feature.feature.group Eclipse Packaging Project
    GCov Integration  1.1.0.201402102340        org.eclipse.linuxtools.gcov.feature.group   Eclipse Linux Tools
    GDB Tracepoint Analysis    1.2.1.201402102340        org.eclipse.linuxtools.gdbtrace.feature.group     Eclipse Linux Tools
    GProf Integration 2.0.0.201402102340        org.eclipse.linuxtools.gprof.feature.feature.group        Eclipse Linux Tools
    Library Hover help for devhelp documentation 1.0.0.201402102340        org.eclipse.linuxtools.cdt.libhover.devhelp.feature.feature.group  Eclipse Linux Tools
    LTTng - Linux Tracing Toolkit       2.2.1.201402102340        org.eclipse.linuxtools.lttng2.feature.group       Eclipse Linux Tools
    LTTng Kernel Analysis      2.2.1.201402102340        org.eclipse.linuxtools.lttng2.kernel.feature.group Eclipse Linux Tools
    OProfile Integration       1.1.1.201402102340        org.eclipse.linuxtools.oprofile.feature.feature.group      Eclipse Linux Tools
    Perf Integration  1.2.0.201402102340        org.eclipse.linuxtools.perf.feature.feature.group Eclipse Linux Tools
    RPM Import/Export/Building and Editing Tool 1.0.0.201402102340        org.eclipse.linuxtools.rpm.feature.group Eclipse Linux Tools
    SystemTap IDE and Visualization Tools       2.1.0.201402102340        org.eclipse.linuxtools.systemtap.feature.group    Eclipse Linux Tools
    Valgrind Tools Integration 2.0.0.201402102340        org.eclipse.linuxtools.valgrind.feature.group     Eclipse Linux Tools
  JNA Library 3.2.7    com.sun.jna.feature.group null
  PyDev for Eclipse   3.4.1.201403181715        org.python.pydev.feature.feature.group      Aptana
  Pydev Mylyn Integration      0.4.0    org.python.pydev.mylyn.feature.feature.group        Fabio Zadrozny
  Subclipse (Required) 1.6.18   org.tigris.subversion.subclipse.feature.group       tigris.org
  Subclipse Integration for Mylyn 3.x (Optional) 3.0.0    org.tigris.subversion.subclipse.mylyn.feature.group        tigris.org
  Subversion Client Adapter (Required)  1.6.12   org.tigris.subversion.clientadapter.feature.feature.group tigris.org
  Subversion JavaHL Native Library Adapter (Required)    1.6.17   org.tigris.subversion.clientadapter.javahl.feature.feature.group    tigris.org
  Subversion Revision Graph    1.0.9    org.tigris.subversion.subclipse.graph.feature.feature.group        tigris.org
  SVNKit Client Adapter (Not required)  1.6.15   org.tigris.subversion.clientadapter.svnkit.feature.feature.group   tigris.org
  SVNKit Library      1.3.5.7406       org.tmatesoft.svnkit.feature.group TMate Software

 

 

 

 

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev

 

 


Back to the top