7 years, 7 months ago.

compiling using mbed cli with debug symbols

Hi, I'm trying to build an mbed project with debug symbols.

I found in the documentation that I need to add "-o debug-info" to my compiling options.

I ran the following command:

mbed compile -o debug-info

But I was not able to find where the debug symbols are stored. When I try to load the elf file to gdb it says it doesn't have debug symbols.

Do you know where the symbols are stored and how do I load them to gdb?

2 Answers

7 years, 3 months ago.

From Multitech's page:

  • If using mbed 2.0, include -o debug-info in your workspace_tools/build.py and workspace_tools/make.py commands to build with debug symbols.
  • If using mbed 5.1, add -o debug-info to your mbed compile command.
  • If using mbed 5.2+, add --profile mbed-os/tools/profiles/debug.json to your mbed compile command.

Make sure to clean your build folder first, before rebuilding.

I'm using mbed 2.0 can you elaborate on including

"-o debug-info in your workspace_tools/build.py and workspace_tools/make.py commands to build with debug symbols."

Previously I just used -o and the debug options I needed with mbed compile but the latest tools don't recognize -o as a valid option.

posted by Garrett LoVerde 26 Jan 2017

Nevermind.

I found the debug profiles under ./temp/tools/profiles, and am now succesfully using

mbed compile - -profile ./temp/tools/profiles/debug.json

posted by Garrett LoVerde 26 Jan 2017
7 years, 6 months ago.

I think you need to use a different "profile" i.e.

mbed compile --profile mbed-os/tools/profiles/debug.json