Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » "C/C++ Remote Application" debug launch configuration issues
"C/C++ Remote Application" debug launch configuration issues [message #990500] Wed, 12 December 2012 18:42 Go to next message
Jason Millard is currently offline Jason MillardFriend
Messages: 4
Registered: December 2012
Location: NEPA
Junior Member
Hello. I'm trying to set up Eclipse for remote building and debugging and am having issues with the "C/C++ Remote Application" launch configuration screen.

I have Eclipse CDT running on OS X with PTP and RDT plugins. I'm connecting to an Ubuntu machine using RSE.

Here are the steps I've taken:

1) In Ubuntu, installed and started the RDT server.

2) In Eclipse (OS X), created a new "Remote System Explorer" -> "Connection" to Ubuntu RDT server.

3) In Eclipse (OS X), created a new "Remote C/C++ Project"

Project name: application
Remote Provider: RSE
Connection: Ubuntu
Location: /home/jsm174/workspace/application
Project Type: Remote Makefile Project -> Empty Project
Toolchains: Remote Linux GCC Tool Chain

4) In Eclipse (OS X), right-click "application" project and selected "Build Project"

5) In Eclipse (OS X), right-click "application" project and selected "Debug as" -> "Debug configurations"

Now is where I hit my issue. In the "Main" tab of the launch configuration, it is asking for a C/C++ Application. When I click Search Project everything is blank. When I click browse, the local file browser is displayed.

index.php/fa/12682/0/

Since my application binary is on a remote server, I'm not sure why "Browse" would bring up the local directory.

Any help / ideas would be greatly appreciated.

Thanks,
-- Jason

Re: "C/C++ Remote Application" debug launch configuration issues [message #990518 is a reply to message #990500] Wed, 12 December 2012 20:51 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
When you debug a remote application you have gdbserver running on the remote host, and GDB running on the local host. GDB needs to know about the debug symbols and therefore needs to know where your application is, on the local file system.

Another way to say this is that you need two binaries: one on the local host and one on the remote host.

Marc
Re: "C/C++ Remote Application" debug launch configuration issues [message #990521 is a reply to message #990518] Wed, 12 December 2012 21:13 Go to previous messageGo to next message
Jason Millard is currently offline Jason MillardFriend
Messages: 4
Registered: December 2012
Location: NEPA
Junior Member
Thank you for the response. So basically my thoughts on what remote debugging could do was wrong.

Since I'm targeting Ubuntu and using OS X to edit the source via RSE, I can't really build the application locally.

If I had another Ubuntu box, I could build the application locally, and then it would transfer over to the remote machine and then I could debug correct?
Re: "C/C++ Remote Application" debug launch configuration issues [message #990660 is a reply to message #990521] Thu, 13 December 2012 16:21 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
I haven't tried from two different operating-systems, but I know you can debug a 64-bit target from a 32-bit host, and vice-versa. To do that, you would use the 64-bit binary of the target also on the host, and GDB would figure things out.

Why don't you try using the Ubuntu binary for GDB on your OS X? The binary cannot run, but GDB only needs it to look at debug symbols. So, take it from your target and put it on your host, and point GDB to it.

Marc
Re: "C/C++ Remote Application" debug launch configuration issues [message #990666 is a reply to message #990500] Thu, 13 December 2012 16:41 Go to previous messageGo to next message
Jason Millard is currently offline Jason MillardFriend
Messages: 4
Registered: December 2012
Location: NEPA
Junior Member
Okay, I just tried that, but it looks like GDB on OS X might not be able to handle a binary from a different platform:

Error in final launch sequence
Failed to execute MI command:
-file-exec-and-symbols /Users/jsm174/Desktop/application
Error message from debugger back end:
"/Users/jsm174/Desktop/application": not in executable format: File format not recognized
"/Users/jsm174/Desktop/application": not in executable format: File format not recognized
Re: "C/C++ Remote Application" debug launch configuration issues [message #990671 is a reply to message #990666] Thu, 13 December 2012 17:10 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
This is now a use-case for GDB. If you can get GDB to do this remote debugging, Eclipse will support it.

So, when you want to get GDB to debug a different remote target, you need to compile GDB differently.
I've never compile GDB on OS X but on Linux I add the --enable-targets=i686-pc-linux-gnu or --enable-targets=x86_64-pc-linux-gnu to the 'configure' command when I want to debug a different remote target. You can even use --enable-targets=all to play it safe.

Marc
Re: "C/C++ Remote Application" debug launch configuration issues [message #990693 is a reply to message #990671] Thu, 13 December 2012 20:12 Go to previous messageGo to next message
Jason Millard is currently offline Jason MillardFriend
Messages: 4
Registered: December 2012
Location: NEPA
Junior Member
Thanks for getting me down the right path. I'm getting closer!

I downloaded GDB, compiled it with --enable-targets=all.

Then I got:

Error in final launch sequence
Failed to execute MI command:
-file-exec-and-symbols /Users/jsm174/Desktop/application
Error message from debugger back end:
"/Users/jsm174/Desktop/application": not in executable format: File format is ambiguous.
Matching formats: elf32-i386-nacl elf32-i386-sol2 elf32-i386-vxworks elf32-i386.
Use "set gnutarget format-name" to specify the format.
"/Users/jsm174/Desktop/application": not in executable format: File format is ambiguous.
Matching formats: elf32-i386-nacl elf32-i386-sol2 elf32-i386-vxworks elf32-i386.
Use "set gnutarget format-name" to specify the format.


So I modified .gdbinit to include "set gnutarget elf32-i386" and then got:

Error in final launch sequence
Failed to execute MI command:
-file-exec-and-symbols /Users/jsm174/Desktop/application
Error message from debugger back end:
I'm sorry, Dave, I can't do that.  Symbol format `elf32-i386' unknown.
I'm sorry, Dave, I can't do that.  Symbol format `elf32-i386' unknown.


I'll keep working on it!
Re: "C/C++ Remote Application" debug launch configuration issues [message #990728 is a reply to message #990693] Thu, 13 December 2012 20:43 Go to previous message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 285
Registered: July 2009
Senior Member
Nice progress. You're beyond anything I've done, so I can't help much more. However, to speed your progress, you can skip using eclipse and simply start gdb from the console specifying the binary:

> gdb /Users/jsm174/Desktop/application

I'd expect you to get the same error as what Eclipse is showing you, but a little faster Smile
Thanks for reporting back your progress, it will prove helpful to others.

Marc
Previous Topic:Function parameter hovers / tooltips
Next Topic:Mysql.h showing compile errors in eclipse
Goto Forum:
  


Current Time: Wed Nov 26 17:53:53 GMT 2014

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

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