Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 3 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, 11 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
to your mbed compile command.--profile mbed-os/tools/profiles/debug.json
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 26 Jan 20178 years, 1 month ago.
I think you need to use a different "profile" i.e.
mbed compile --profile mbed-os/tools/profiles/debug.json