Bug 305449 - CDT Remote debugging error: Cannot run program "plink.exe -load mydevbox gdb": Launching failed
Summary: CDT Remote debugging error: Cannot run program "plink.exe -load mydevbox gdb"...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 6.0.2   Edit
Hardware: PC Windows 7
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-10 21:30 EST by Artem Russakovskii CLA
Modified: 2020-09-04 15:21 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Russakovskii CLA 2010-03-10 21:30:25 EST
I'm trying to set up simple remote debugging for my Windows dev PC that would remotely debug C++ programs running on a Linux box.

First of all, I have not found an adequate tutorial that shows all the steps needed to make this happen (or maybe I have but this bug is making me feel like I'm doing everything wrong).

What steps will reproduce the problem?
1. I made a debug configuration and put this line as the path to gdb: c:\Putty\plink.exe -load mydevbox gdb
2. I set this session up with pageant and verified many times that it works and logs in without a password prompt. I am using plink.exe version 0.58 just in case, as I heard 0.59+ have a certain bug, probably unrelated. I tried 0.60 anyway without luck.

However, when I launch I get the error below, no matter what.

What am I doing wrong or did I hit a bug?

Thank you.

-- Error Details --
Date: Wed Mar 10 18:09:39 PST 2010
Message: Error creating session
Severity: Error
Product: Eclipse 1.2.2.20100122-1337 (org.eclipse.epp.package.php.product)
Plugin: org.eclipse.cdt.debug.mi.core
Session Data:
eclipse.buildId=
java.version=1.6.0_17
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.php.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product


Exception Stack Trace:
java.io.IOException: Cannot run program "c:\Putty\plink.exe -load mydevbox gdb": Launching failed
at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:251)
at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:59)
at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:87)
at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:79)
at org.eclipse.cdt.utils.spawner.ProcessFactory.exec(ProcessFactory.java:63)
at org.eclipse.cdt.debug.mi.core.MIProcessAdapter.getGDBProcess(MIProcessAdapter.java:51)
at org.eclipse.cdt.debug.mi.core.MIProcessAdapter.<init>(MIProcessAdapter.java:38)
at org.eclipse.cdt.debug.mi.core.command.CommandFactory.createMIProcess(CommandFactory.java:456)
at org.eclipse.cdt.debug.mi.core.MIPlugin.createSession(MIPlugin.java:453)
at org.eclipse.cdt.debug.mi.core.AbstractGDBCDIDebugger.createGDBSession(AbstractGDBCDIDebugger.java:114)
at org.eclipse.cdt.debug.mi.core.AbstractGDBCDIDebugger.createSession(AbstractGDBCDIDebugger.java:68)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchDebugSession(LocalCDILaunchDelegate.java:343)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.createCDISession(LocalCDILaunchDelegate.java:468)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchLocalDebugSession(LocalCDILaunchDelegate.java:145)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchDebugger(LocalCDILaunchDelegate.java:112)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launch(LocalCDILaunchDelegate.java:72)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Robin Fernandes CLA 2010-08-18 04:55:10 EDT
This still seems to be an issue in Eclipse 3.6, CDT 7.0. 

A workaround is to wrap the "plink remotehost gdb" call in in batch script and set that script as the gdb command.

However, the next issue is that the launch attempts to set environment settings in gdb which are specific to the local system on which CDT is running, and are not valid on the remote system on which gdb is running. So you get errors like:

Error in final launch sequence
Failed to execute MI command:
-environment-cd "C:/local_project_path"
Error message from debugger back end:
C:/local_project_path: No such file or directory.


It is unfortunate that this approach does not work so well, since it is documented on on the RSE FAQ (http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F).

Or perhaps we are just missing a setup step?
Comment 2 Robin Fernandes CLA 2010-08-18 07:32:40 EDT
Issue described in previous comment is related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=252758.