Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Remote Debugging
Remote Debugging [message #4911] Wed, 24 January 2007 15:12 Go to next message
Eclipse UserFriend
Originally posted by: kieran.flynn.morganstanley.com

Hello,

I am tryiing to do a remote c++ debug from a local windows xp machine to a
remote linux machine. The XP machine is running eclipse sdk 3.2.0 with cdt
3.1.0 and RSE 1.0.1. The remote machine is running i686 Red Hat & gdb v6.0
(I think).

I can set up remote file and shell access and that works fine. I can also
remotely launch applications too. However when I try to launch a debug
session I get the mystery error of "Error creating session" Details: "Exec
error: launching failed" (3 times)

The last output from the Console is:
/my/home/dir>gdbserver :8888 /my/path/rse_test;exit
gdbserver :8888 /my/path/rse_test;exit
Process /my/path/rse_test created; pid = 16477

I don't really know where to begin in figuring out why it doesn't work.
Could you maybe point me in the right direction?

Also, the gdb-server continues to run after this fails, so I have to kill
it in the processes tree on the left before trying again. Is there a
smarter way around that?

Thank you for your help

Regards
Kieran
Re: Remote Debugging [message #5048 is a reply to message #4911] Thu, 25 January 2007 22:02 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
For remote debugging, you'll need a _local_ gdb executable that is
capable of understanding the remote exe file and architecture, and
connecting to the remote gdbserver. The remote gdbserver is only a very
thin layer, most work will be done locally.

I'm not sure what version of gdb you could get for Windows X Linux
debugging. Most vendors who do cross-compile / cross-debug in their
commercial products based on GNU Tools and Eclipse, build their own
versions of gdb for the cross-support from the sources. Therefore,
cygwin gdb or mingw gdb may not work out of the box unless you compile
them yourself and enable cross-support for linux. [building from source
may not be too difficult].

I do agree, though, that the error message should be more informative.

Ewa, can you help any further? Is there any point in running a whole gdb
remotely and piping the gdb/mi channel through the RSE IHostShell,
instead of just running the gdbserver remotely?

Cheers
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm

Kieran schrieb:
> Hello,
>
> I am tryiing to do a remote c++ debug from a local windows xp machine to
> a remote linux machine. The XP machine is running eclipse sdk 3.2.0 with
> cdt 3.1.0 and RSE 1.0.1. The remote machine is running i686 Red Hat &
> gdb v6.0 (I think).
> I can set up remote file and shell access and that works fine. I can
> also remotely launch applications too. However when I try to launch a
> debug session I get the mystery error of "Error creating session"
> Details: "Exec error: launching failed" (3 times)
>
> The last output from the Console is: /my/home/dir>gdbserver :8888
> /my/path/rse_test;exit
> gdbserver :8888 /my/path/rse_test;exit
> Process /my/path/rse_test created; pid = 16477
>
> I don't really know where to begin in figuring out why it doesn't work.
> Could you maybe point me in the right direction?
> Also, the gdb-server continues to run after this fails, so I have to
> kill it in the processes tree on the left before trying again. Is there
> a smarter way around that?
>
> Thank you for your help
>
> Regards
> Kieran
>
>
>
Re: Remote Debugging [message #5256 is a reply to message #5048] Mon, 12 February 2007 15:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kieran.flynn.morganstanley.com

Hi Martin,

Thanks for your help on that. I did as you said and it's working quite
well now! For the reference of anyone else who needs to do it, tryign to
build the "cygwin" package of gdb won't work, you need to get the "real"
gdb and compile it FOR cygwin (crossed with whatever architecture you
want).

I have a few other questions though and maybe you can help point me to a
solution. This might be a bit verbose, but hopefully that means you'll
find it easier to help me out...

The project is set up like this:
project/
project/src/
project/build/
project/install/
project/install/lib
project/install/bin

and so on. The windows machine is running eclipse and is also running
cygwin.
the machine with the project is a linux box. the project folder is
accessible both in windows under a drive letter, and in cygwin at a mount
point, so all edditing etc is done through windows side, only remote
debugging is done via rse. The first time the debugger starts, it can't
see the source code for main() so it shows the assembly. I can point it to
the code for _that_ file but I can't get it to see the code for any of the
library files. Also in modules in the top right corner it shows the main
binary and all the libraries from the project as not having symbols
loaded. After that a mixture of some libraries are loaded, some are not.
For example libraries like \lib\ld-linux.so.2 must have loaded via cygwin.
Some of the libraries that aren't in cygwin obviously didn't load as they
are on the linux machine.

It seems sort of hit and miss to get eclipse to see all the code, all the
binaries/libraries and link it all together and I have to do it almost one
file at a time. I'm sure there's a better way but I can't see it. Any
suggestions?

Second, we have a highly customised build process here, is there any way
of doing remote builds in the same nature as teh remote debugging?

I really appreciate your help on this

Kieran



Martin Oberhuber wrote:

> For remote debugging, you'll need a _local_ gdb executable that is
> capable of understanding the remote exe file and architecture, and
> connecting to the remote gdbserver. The remote gdbserver is only a very
> thin layer, most work will be done locally.

> I'm not sure what version of gdb you could get for Windows X Linux
> debugging. Most vendors who do cross-compile / cross-debug in their
> commercial products based on GNU Tools and Eclipse, build their own
> versions of gdb for the cross-support from the sources. Therefore,
> cygwin gdb or mingw gdb may not work out of the box unless you compile
> them yourself and enable cross-support for linux. [building from source
> may not be too difficult].

> I do agree, though, that the error message should be more informative.

> Ewa, can you help any further? Is there any point in running a whole gdb
> remotely and piping the gdb/mi channel through the RSE IHostShell,
> instead of just running the gdbserver remotely?

> Cheers
Re: Remote Debugging [message #6046 is a reply to message #5256] Wed, 14 February 2007 16:55 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hello Kieran,

it looks like there's two distinct problems you have:

1.) The Debugger's source path mapping is not what you
want it to be. Since you built on remote, the debug
info has pathes like /home/kieran/... embedded, these
need to be mapped to local F:\kieran\... etc.
This source path mapping can be edited in the Launch
Configuration Dialog, Source Path Mapping tab.

2.) Since you're debugging a Linux executable on Windows,
your debugger needs access to the Linux libs and
sharedlibs, and NOT the cygwin variants of these.
Basically, you need to setup a LINUX /usr/lib/...
structure that is visible from Windows, and point
your debugger's libraryLoadPath to it. Such a setup
is very typical, most embedded debuggers have a
/target/lib, /target/bin, /target/share etc. structure
somewhere to mimic the layout of the remote filesystem
for the debugger.
Looking at the ELDK (embedded linux development kit)
might help.

3.) Remote Builds - when you execute "make" in an RSE
Commandview, it will automatically parse any error
output and allow you navigate to it in the editor.
The other option is to edit the CDT's "make command"
to do something like "ssh remotesystem make".
Above that, the CDT project has a bug from HP where
they contribute a solution for remote edit & build.
I'd be keep to hear from you how it's working since
I haven't tried it so far:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=168048
https://bugs.eclipse.org/bugs/show_bug.cgi?id=88546
https://bugs.eclipse.org/bugs/show_bug.cgi?id=71484
https://bugs.eclipse.org/bugs/show_bug.cgi?id=30091

Thanks,
--
Martin Oberhuber
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm


Kieran wrote:
> Hi Martin,
>
> Thanks for your help on that. I did as you said and it's working quite
> well now! For the reference of anyone else who needs to do it, tryign to
> build the "cygwin" package of gdb won't work, you need to get the "real"
> gdb and compile it FOR cygwin (crossed with whatever architecture you
> want).
> I have a few other questions though and maybe you can help point me to a
> solution. This might be a bit verbose, but hopefully that means you'll
> find it easier to help me out...
>
> The project is set up like this: project/
> project/src/
> project/build/
> project/install/
> project/install/lib
> project/install/bin
>
> and so on. The windows machine is running eclipse and is also running
> cygwin.
> the machine with the project is a linux box. the project folder is
> accessible both in windows under a drive letter, and in cygwin at a
> mount point, so all edditing etc is done through windows side, only
> remote debugging is done via rse. The first time the debugger starts, it
> can't see the source code for main() so it shows the assembly. I can
> point it to the code for _that_ file but I can't get it to see the code
> for any of the library files. Also in modules in the top right corner it
> shows the main binary and all the libraries from the project as not
> having symbols loaded. After that a mixture of some libraries are
> loaded, some are not. For example libraries like \lib\ld-linux.so.2 must
> have loaded via cygwin. Some of the libraries that aren't in cygwin
> obviously didn't load as they are on the linux machine.
> It seems sort of hit and miss to get eclipse to see all the code, all
> the binaries/libraries and link it all together and I have to do it
> almost one file at a time. I'm sure there's a better way but I can't see
> it. Any suggestions?
>
> Second, we have a highly customised build process here, is there any way
> of doing remote builds in the same nature as teh remote debugging?
>
> I really appreciate your help on this
>
> Kieran
>
>
>
> Martin Oberhuber wrote:
>
>> For remote debugging, you'll need a _local_ gdb executable that is
>> capable of understanding the remote exe file and architecture, and
>> connecting to the remote gdbserver. The remote gdbserver is only a
>> very thin layer, most work will be done locally.
>
>> I'm not sure what version of gdb you could get for Windows X Linux
>> debugging. Most vendors who do cross-compile / cross-debug in their
>> commercial products based on GNU Tools and Eclipse, build their own
>> versions of gdb for the cross-support from the sources. Therefore,
>> cygwin gdb or mingw gdb may not work out of the box unless you compile
>> them yourself and enable cross-support for linux. [building from source
>> may not be too difficult].
>
>> I do agree, though, that the error message should be more informative.
>
>> Ewa, can you help any further? Is there any point in running a whole
>> gdb remotely and piping the gdb/mi channel through the RSE IHostShell,
>> instead of just running the gdbserver remotely?
>
>> Cheers
>
Re: Remote Debugging [message #566040 is a reply to message #4911] Thu, 25 January 2007 22:02 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
For remote debugging, you'll need a _local_ gdb executable that is
capable of understanding the remote exe file and architecture, and
connecting to the remote gdbserver. The remote gdbserver is only a very
thin layer, most work will be done locally.

I'm not sure what version of gdb you could get for Windows X Linux
debugging. Most vendors who do cross-compile / cross-debug in their
commercial products based on GNU Tools and Eclipse, build their own
versions of gdb for the cross-support from the sources. Therefore,
cygwin gdb or mingw gdb may not work out of the box unless you compile
them yourself and enable cross-support for linux. [building from source
may not be too difficult].

I do agree, though, that the error message should be more informative.

Ewa, can you help any further? Is there any point in running a whole gdb
remotely and piping the gdb/mi channel through the RSE IHostShell,
instead of just running the gdbserver remotely?

Cheers
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm

Kieran schrieb:
> Hello,
>
> I am tryiing to do a remote c++ debug from a local windows xp machine to
> a remote linux machine. The XP machine is running eclipse sdk 3.2.0 with
> cdt 3.1.0 and RSE 1.0.1. The remote machine is running i686 Red Hat &
> gdb v6.0 (I think).
> I can set up remote file and shell access and that works fine. I can
> also remotely launch applications too. However when I try to launch a
> debug session I get the mystery error of "Error creating session"
> Details: "Exec error: launching failed" (3 times)
>
> The last output from the Console is: /my/home/dir>gdbserver :8888
> /my/path/rse_test;exit
> gdbserver :8888 /my/path/rse_test;exit
> Process /my/path/rse_test created; pid = 16477
>
> I don't really know where to begin in figuring out why it doesn't work.
> Could you maybe point me in the right direction?
> Also, the gdb-server continues to run after this fails, so I have to
> kill it in the processes tree on the left before trying again. Is there
> a smarter way around that?
>
> Thank you for your help
>
> Regards
> Kieran
>
>
>
Re: Remote Debugging [message #566153 is a reply to message #5048] Mon, 12 February 2007 15:23 Go to previous message
Kieran is currently offline KieranFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Martin,

Thanks for your help on that. I did as you said and it's working quite
well now! For the reference of anyone else who needs to do it, tryign to
build the "cygwin" package of gdb won't work, you need to get the "real"
gdb and compile it FOR cygwin (crossed with whatever architecture you
want).

I have a few other questions though and maybe you can help point me to a
solution. This might be a bit verbose, but hopefully that means you'll
find it easier to help me out...

The project is set up like this:
project/
project/src/
project/build/
project/install/
project/install/lib
project/install/bin

and so on. The windows machine is running eclipse and is also running
cygwin.
the machine with the project is a linux box. the project folder is
accessible both in windows under a drive letter, and in cygwin at a mount
point, so all edditing etc is done through windows side, only remote
debugging is done via rse. The first time the debugger starts, it can't
see the source code for main() so it shows the assembly. I can point it to
the code for _that_ file but I can't get it to see the code for any of the
library files. Also in modules in the top right corner it shows the main
binary and all the libraries from the project as not having symbols
loaded. After that a mixture of some libraries are loaded, some are not.
For example libraries like \lib\ld-linux.so.2 must have loaded via cygwin.
Some of the libraries that aren't in cygwin obviously didn't load as they
are on the linux machine.

It seems sort of hit and miss to get eclipse to see all the code, all the
binaries/libraries and link it all together and I have to do it almost one
file at a time. I'm sure there's a better way but I can't see it. Any
suggestions?

Second, we have a highly customised build process here, is there any way
of doing remote builds in the same nature as teh remote debugging?

I really appreciate your help on this

Kieran



Martin Oberhuber wrote:

> For remote debugging, you'll need a _local_ gdb executable that is
> capable of understanding the remote exe file and architecture, and
> connecting to the remote gdbserver. The remote gdbserver is only a very
> thin layer, most work will be done locally.

> I'm not sure what version of gdb you could get for Windows X Linux
> debugging. Most vendors who do cross-compile / cross-debug in their
> commercial products based on GNU Tools and Eclipse, build their own
> versions of gdb for the cross-support from the sources. Therefore,
> cygwin gdb or mingw gdb may not work out of the box unless you compile
> them yourself and enable cross-support for linux. [building from source
> may not be too difficult].

> I do agree, though, that the error message should be more informative.

> Ewa, can you help any further? Is there any point in running a whole gdb
> remotely and piping the gdb/mi channel through the RSE IHostShell,
> instead of just running the gdbserver remotely?

> Cheers
Re: Remote Debugging [message #566291 is a reply to message #5256] Wed, 14 February 2007 16:55 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hello Kieran,

it looks like there's two distinct problems you have:

1.) The Debugger's source path mapping is not what you
want it to be. Since you built on remote, the debug
info has pathes like /home/kieran/... embedded, these
need to be mapped to local F:\kieran\... etc.
This source path mapping can be edited in the Launch
Configuration Dialog, Source Path Mapping tab.

2.) Since you're debugging a Linux executable on Windows,
your debugger needs access to the Linux libs and
sharedlibs, and NOT the cygwin variants of these.
Basically, you need to setup a LINUX /usr/lib/...
structure that is visible from Windows, and point
your debugger's libraryLoadPath to it. Such a setup
is very typical, most embedded debuggers have a
/target/lib, /target/bin, /target/share etc. structure
somewhere to mimic the layout of the remote filesystem
for the debugger.
Looking at the ELDK (embedded linux development kit)
might help.

3.) Remote Builds - when you execute "make" in an RSE
Commandview, it will automatically parse any error
output and allow you navigate to it in the editor.
The other option is to edit the CDT's "make command"
to do something like "ssh remotesystem make".
Above that, the CDT project has a bug from HP where
they contribute a solution for remote edit & build.
I'd be keep to hear from you how it's working since
I haven't tried it so far:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=168048
https://bugs.eclipse.org/bugs/show_bug.cgi?id=88546
https://bugs.eclipse.org/bugs/show_bug.cgi?id=71484
https://bugs.eclipse.org/bugs/show_bug.cgi?id=30091

Thanks,
--
Martin Oberhuber
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm


Kieran wrote:
> Hi Martin,
>
> Thanks for your help on that. I did as you said and it's working quite
> well now! For the reference of anyone else who needs to do it, tryign to
> build the "cygwin" package of gdb won't work, you need to get the "real"
> gdb and compile it FOR cygwin (crossed with whatever architecture you
> want).
> I have a few other questions though and maybe you can help point me to a
> solution. This might be a bit verbose, but hopefully that means you'll
> find it easier to help me out...
>
> The project is set up like this: project/
> project/src/
> project/build/
> project/install/
> project/install/lib
> project/install/bin
>
> and so on. The windows machine is running eclipse and is also running
> cygwin.
> the machine with the project is a linux box. the project folder is
> accessible both in windows under a drive letter, and in cygwin at a
> mount point, so all edditing etc is done through windows side, only
> remote debugging is done via rse. The first time the debugger starts, it
> can't see the source code for main() so it shows the assembly. I can
> point it to the code for _that_ file but I can't get it to see the code
> for any of the library files. Also in modules in the top right corner it
> shows the main binary and all the libraries from the project as not
> having symbols loaded. After that a mixture of some libraries are
> loaded, some are not. For example libraries like \lib\ld-linux.so.2 must
> have loaded via cygwin. Some of the libraries that aren't in cygwin
> obviously didn't load as they are on the linux machine.
> It seems sort of hit and miss to get eclipse to see all the code, all
> the binaries/libraries and link it all together and I have to do it
> almost one file at a time. I'm sure there's a better way but I can't see
> it. Any suggestions?
>
> Second, we have a highly customised build process here, is there any way
> of doing remote builds in the same nature as teh remote debugging?
>
> I really appreciate your help on this
>
> Kieran
>
>
>
> Martin Oberhuber wrote:
>
>> For remote debugging, you'll need a _local_ gdb executable that is
>> capable of understanding the remote exe file and architecture, and
>> connecting to the remote gdbserver. The remote gdbserver is only a
>> very thin layer, most work will be done locally.
>
>> I'm not sure what version of gdb you could get for Windows X Linux
>> debugging. Most vendors who do cross-compile / cross-debug in their
>> commercial products based on GNU Tools and Eclipse, build their own
>> versions of gdb for the cross-support from the sources. Therefore,
>> cygwin gdb or mingw gdb may not work out of the box unless you compile
>> them yourself and enable cross-support for linux. [building from source
>> may not be too difficult].
>
>> I do agree, though, that the error message should be more informative.
>
>> Ewa, can you help any further? Is there any point in running a whole
>> gdb remotely and piping the gdb/mi channel through the RSE IHostShell,
>> instead of just running the gdbserver remotely?
>
>> Cheers
>
Previous Topic:TM 2.0 project plan officially posted
Next Topic:How can i use own filters
Goto Forum:
  


Current Time: Fri Mar 29 11:23:32 GMT 2024

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

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

Back to the top