Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » remote debugging - Windows/Unix
remote debugging - Windows/Unix [message #14212] Thu, 23 August 2007 12:05 Go to next message
Eclipse UserFriend
Originally posted by: johanna.bostrom.gmail.com

Hi

We want to use RSE for remote debugging.

Our localhost is a Windows nt machine and the target is a Unix server. We
have Eclipse Europa with CDT4.0 and RSE2.0.
How can we do this?

We tried to debug the program by choosing the Debug dialog, and then
"Remote connection", then we specified the debugger options. The system
started to debug, but it stopped at 57 % so we are not sure what actually
happened. Does anyone know?

Thanks!
//Johanna
Re: remote debugging - Windows/Unix [message #14229 is a reply to message #14212] Thu, 23 August 2007 12:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johanna.bostrom.gmail.com

sorry, we meant "C/C++ remote application" and not "remote connection"

//Johanna
Re: remote debugging - Windows/Unix [message #14246 is a reply to message #14229] Fri, 24 August 2007 19:52 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hello Johanna,

I think you'll need to debug this.

Just put a breakpoint in
REmoteRunLaunchDelegate.remoteShellExec()
and step through it from that point on.

Problem might be that the "gdbserver" program cannot
be started on the remote machine, because it is not
installed or not found by the PATH. Or, the default
port of gdbserver is already in use. Or, firewall
forbids connecting to the gdbserver port.

Also note that you need a local CROSS gdb! That is,
a version of gdb on Windows that's capable of
debugging Linux apps. You'll probably need to compile
such a gdb yourself, since I'm not aware of any
out-of-the-box open source cross toolkit -- some
commercial vendors provide it though. See also
http://dev.eclipse.org/mhonarc/lists/dsdp-tm-dev/msg00831.ht ml

I'd recommend setting up the remote debug scenario
Linux X Linux first, then you don't need the cross
gdb. You can also set it up by hand once:
* Log in to remote box
* launch gdbserver manually on the remote
* launch gdb <programname>

For a great summary of Eclipse / CDT remote development, see
http://dev.eclipse.org/mhonarc/lists/dsdp-tm-dev/msg01369.ht ml

It has some good pointers, especially this one for a different
setup where the gdb exectuable itself runs on the remote:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=30094#c13

Yet a different approach might be possible through the
gdb implementation of the Eclipse Device Debugging Project,
http://wiki.eclipse.org/DSDP/DD/GDB

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


Johanna wrote:
> sorry, we meant "C/C++ remote application" and not "remote connection"
>
> //Johanna
>
Re: remote debugging - Windows/Unix [message #14280 is a reply to message #14246] Fri, 24 August 2007 21:11 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hi,

here is a nice pointer for a paper about cross
development (remote debugging) with Eclipse, the tools
required and also a little bit about the cross toolchains
(gcc, gdb, binutils):
http://www.macraigor.com/downloads/Macraigor_with_Eclipse.pd f

and here is another old E-Mail I just dug out, which you might
find interesting: Unfortunately, the E-Mail address that I have from
Kieran Flynn is not correct any more, so I cannot ask him personally.

------------------------------------------------------------ -

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
>

Cheers,
--
Martin Oberhuber
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Re: remote debugging - Windows/Unix [message #19653 is a reply to message #14212] Thu, 27 March 2008 09:56 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
FYI, a Remote Debugging FAQ is now on
http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_D ebugging_with_CDT.3F

Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Re: remote debugging - Windows/Unix [message #569969 is a reply to message #14212] Thu, 23 August 2007 12:08 Go to previous message
Eclipse UserFriend
Originally posted by: johanna.bostrom.gmail.com

sorry, we meant "C/C++ remote application" and not "remote connection"

//Johanna
Re: remote debugging - Windows/Unix [message #569992 is a reply to message #14229] Fri, 24 August 2007 19:52 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hello Johanna,

I think you'll need to debug this.

Just put a breakpoint in
REmoteRunLaunchDelegate.remoteShellExec()
and step through it from that point on.

Problem might be that the "gdbserver" program cannot
be started on the remote machine, because it is not
installed or not found by the PATH. Or, the default
port of gdbserver is already in use. Or, firewall
forbids connecting to the gdbserver port.

Also note that you need a local CROSS gdb! That is,
a version of gdb on Windows that's capable of
debugging Linux apps. You'll probably need to compile
such a gdb yourself, since I'm not aware of any
out-of-the-box open source cross toolkit -- some
commercial vendors provide it though. See also
http://dev.eclipse.org/mhonarc/lists/dsdp-tm-dev/msg00831.ht ml

I'd recommend setting up the remote debug scenario
Linux X Linux first, then you don't need the cross
gdb. You can also set it up by hand once:
* Log in to remote box
* launch gdbserver manually on the remote
* launch gdb <programname>

For a great summary of Eclipse / CDT remote development, see
http://dev.eclipse.org/mhonarc/lists/dsdp-tm-dev/msg01369.ht ml

It has some good pointers, especially this one for a different
setup where the gdb exectuable itself runs on the remote:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=30094#c13

Yet a different approach might be possible through the
gdb implementation of the Eclipse Device Debugging Project,
http://wiki.eclipse.org/DSDP/DD/GDB

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


Johanna wrote:
> sorry, we meant "C/C++ remote application" and not "remote connection"
>
> //Johanna
>
Re: remote debugging - Windows/Unix [message #570017 is a reply to message #14246] Fri, 24 August 2007 21:11 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hi,

here is a nice pointer for a paper about cross
development (remote debugging) with Eclipse, the tools
required and also a little bit about the cross toolchains
(gcc, gdb, binutils):
http://www.macraigor.com/downloads/Macraigor_with_Eclipse.pd f

and here is another old E-Mail I just dug out, which you might
find interesting: Unfortunately, the E-Mail address that I have from
Kieran Flynn is not correct any more, so I cannot ask him personally.

------------------------------------------------------------ -

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
>

Cheers,
--
Martin Oberhuber
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Re: remote debugging - Windows/Unix [message #573050 is a reply to message #14212] Thu, 27 March 2008 09:56 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
FYI, a Remote Debugging FAQ is now on
http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_D ebugging_with_CDT.3F

Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Previous Topic:Custom RSE view - observations & help needed
Next Topic:DSDP-TM is Eclipse BugDay Featured Project of the month August!
Goto Forum:
  


Current Time: Fri Apr 19 19:28:28 GMT 2024

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

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

Back to the top