GDB debug of SDK examples in Eclipse

wklimann gravatar image

asked 2015-02-19 11:56:39 +0200

updated 2015-02-19 11:58:44 +0200


I am using an Eclipse GCC environment with the following setup:

  • Ubuntu -> 14.04 (Trusty Tahr)
  • Eclipse IDE for C/C++ Developers -> Version: Luna Service Release 1a (4.4.1)
  • GNU ARM Embedded Toolchain -> gcc-arm-none-eabi=
  • J-Link -> jlink_4.96.8_x86_64.deb
  • Softdevice -> s110_nrf51822_7.1.0
  • Nordic SDK -> nRF51 SDK v. 7.2.0
  • GNU ARM Eclipse plug-ins
  • nRF51822-QFAA-G0

To compile the blinky project was not as much an afford as to start the first debug session. I needed to add the -g compiler flag per hand into the make file to make it work. As I have to change every makefile per hand to be able to compile the examples with debug properties I wondered if there is some form of (debug) compiling option which I did not figure out.

any help would be appreciated

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
Stian gravatar image

answered 2015-10-06 10:12:38 +0200

Since eclipse is using the existing makefile you would need to add the -g flag manually. You would also need to remove the -flto flag, because the LTO removes the debug symbols again.

You could edit the makefile to include two targets, one release and one debug target, and only use the -g flag on the debug target. Then you can switch between these two targets in eclipse. But you will still need to edit the makefiles.

edit flag offensive delete publish link more


In opposite to desktop or server software, debug informations in an embedded firmware usually do not end up in the final binary. So I think it’s a viable choice to add the -g switch even for release builds.

Torsten Robitzki ( 2015-10-06 15:48:45 +0200 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower


Asked: 2015-02-19 11:56:39 +0200

Seen: 610 times

Last updated: Oct 06 '15