Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Serial remote debugging with Eclipse CDT or Eclipse standalone debugger
Serial remote debugging with Eclipse CDT or Eclipse standalone debugger [message #1721625] Thu, 28 January 2016 17:17 Go to next message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
I am trying to debug with Eclipse a C application (u-boot) which is running on a proprietary embedded system. gdbserver is running on this target.
With gdb command line or ddd, this is working fine.
I usually do (more or less the same for ddd)
$ gdb /path/to/my/file.elf
(gdb) target remote /dev/ttyUSB1

With Eclipse CDT, I created a debug configuration in "C/C++ Attach to Application" (as it is the only one where I can specify the serial port to use with gdbserver). I also provided the name of my elf file in "C/C++ Application" (in main tab).
Then debug works fine. I hit my breakpoint but unfortunately, I only see disassembly code. I can fix it by typing "file /path/to/my/file.elf" in gdb console.
But then what's the purpose of specifying a file in "C/C++ Application"?

And I would also have expected to create a debug configuration in "C/C++ Remote Application" rather than in "C/C++ Attach to Application" but in the first one you can not define the use of a serial port for gdbserver.

Regarding Eclipse StandAlone debugger, I could not find a way to do the same. Any hint?

Thanks in advance.

Re: Serial remote debugging with Eclipse CDT or Eclipse standalone debugger [message #1721733 is a reply to message #1721625] Fri, 29 January 2016 14:46 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Hi Bernard,

1- you are right about using "C/C++ Remote Application". The automatic version of this launch only supports TCP connection (no one bothered supporting serial). However, you can use the manual version of this launch for serial connection; but you will need to start gdbserver yourself. Look for the section "Manual remote launch" in this wiki page: https://wiki.eclipse.org/CDT/User/FAQ#How_do_I_debug_a_remote_application.3F.

2- Sadly, the Standalone debugger also only supports TCP connection. Again, no one ever expressed interest in a serial connection. There is no "manual" option in this case.

Can you try #1 and see if it fixed your ability to see the code?

Marc

Re: Serial remote debugging with Eclipse CDT or Eclipse standalone debugger [message #1722063 is a reply to message #1721733] Tue, 02 February 2016 14:53 Go to previous message
Bernard Gautier is currently offline Bernard GautierFriend
Messages: 11
Registered: May 2011
Junior Member
Hello Marc,

Thanks for your answers.
I did a try on your point 1.
I succeed to set it up but there are some other issues now:
- There is no main() function in my target code and it seems Eclipse is searching for it for setting a breakpoint so I am getting this red message: "Function "main" not defined"
- But my code has a software breakpoint. I can see it is reached in the eclipse gdb console. Anyway, the source is not synchronized with this breakpoint and the debugger seems to be still running in eclipse. I can click on "suspend" button but nothing happens. I am wondering if it is link to the fact that the main function is not found.

After some investigations:
I found a way in the preferences to not stop on main. I uncheck it and after recreating the debug configuration (else it does not seem to be taken into account), I do not have anymore the "Function '"main" not defined" but still, the Eclipse gdb does not seem to see my breakpoint and is still running...
I don't have the same issue with "C/C++ Attach to Application" debug configuration.


Previous Topic:eclipse-SDK-4.0-macosx-carbon / CROSSGCC issue
Next Topic:debugger cant find fortran file on a non-existent fortran instllation
Goto Forum:
  


Current Time: Fri Apr 26 18:11:49 GMT 2024

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

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

Back to the top