1 of 1 people found this helpful
Many thanks to james_patterson for pointing a correct answer, quoted below:
You will want to look into using _Unwind_Backtrace.
Be sure to add #include <unwind.h> to your source file
Be sure to pass the -funwind-tables option to the compiler.
Reference http://stackoverflow.com/questions/3398664/how-to-get-a-call-stack-backtrace-deeply-embedded-no-library-support for an example that I just confirmed works with our arm none eabl toolchain. In this case I am running the simple app on our bundled qemu simulator and get the output:
#0: program counter at 000001fc
#1: program counter at 00000210
#2: program counter at 00000220
#3: program counter at 00000230
#4: program counter at 00000240
Checking the addresses in the disassembly view of the debugger, I was able to confirm that the addresses are correct for each function in the Stack Overflow example.