Remote debugging a Linux process from CDT on Windows [message #553452] |
Tue, 17 August 2010 11:04  |
Eclipse User |
|
|
|
Hi all,
I am running Eclipse CDT on Windows to develop C code that is built & tested on remote Linux systems. Currently, the code is only compiled on Linux - never on Windows.
My aim is to remotely debug a Linux process from the Windows CDT environment. The RSE FAQ describes two general approaches to achieve this:
- Option 1: Launch the gdb client on the remote system over ssh.
- Option 2: Use a cross-debugging version of the gdb client that can run on the Windows development system and understand the remote Linux process data fed to it by gdbserver.
Option 1 seems more simple. The idea is simply to replace the gdb command in the debug launch configuration with e.g. "plink remotehost gdb". However, this fails, because many fields in the launcher are forcefully tied to the local system. For example, the project directory must be a path on the system on which CDT is running. Consequently, when gdb runs on the remote host, it fails with errors like:
Error in final launch sequence
Failed to execute MI command:
-environment-cd "C:/code/helios.workspace/Build Test C"
Error message from debugger back end:
C:/code/helios.workspace/Build Test C: No such file or directory.
Where "C:\code\helios.workspace\Build Test C" is a path on the Windows system where CDT is running, so is of course not found on the remote Linux system where gdb is running. So question 1 is: has anyone ever successfully launched a debug session from CDT using gdb over ssh from CDT, and if so, how?
Option 2 should be as simple as getting hold of / building the appropriate flavour of gdb. So question 2 is: does anyone know where I can find a cross-build of gdb that will allow me to debug Linux processes from a Windows system, or where I can find instructions to build one myself? 
Many thanks,
-R
[Updated on: Tue, 17 August 2010 11:42] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Remote debugging a Linux process from CDT on Windows [message #635046 is a reply to message #634901] |
Mon, 25 October 2010 10:20  |
Eclipse User |
|
|
|
pablo wrote on Sun, 24 October 2010 21:44 | pablo wrote on Sun, 24 October 2010 19:45 | Axel, I installed the RSE plugin but the debug configurations options still are "C/C++ Application, Attach to Application and Postmortem Debugger".
How can I execute the remote debug?
Sorry for my bad english
Thank you very much in advance.
|
Well. I configured an entry under "C/C++ Application" using "Standar create process launcher" instead of "GDB (DSF) create process launcher" and gdb.cmd (according andreyvo's tip) as the "GDB Debugger".
The debug process is launched correctly (progress = 57% according to the status bar) but after a few seconds an error occurs:
Error creating session
Target is not responding (timed out)
The console show:
13-gdb-set confirm off
(gdb)
14-gdb-exit
In the remote host I created a file containing the gdb output (using tee). The content is:
(gdb)
13^done
(gdb)
I am clueless. Somebody can help me?
Thanks again!
I'm using gdb 6.3 under OpenBSD 4.5
|
I try it on SUSE Linux Enterprise Server 10 (gdb 6.6) on the server side and everything works OK! (without any RSE plugin).
Only two mods to andreyvo's script:
1.- options=${@//C:\\/\/} instead of options=${@//C:\\/}
2.- convert back paths to windows' paths on gdb output
Regards
|
|
|
Powered by
FUDForum. Page generated in 0.05270 seconds