I want to dump stacktrace of my program as the example demonstrated at backtrace[3], but I got result below, instead.
I am using linux 2.6, and arm-linux-gcc 4.3.2.
Running:
arm-linux-gcc prog.c -o prog -rdynamic
the result is:
backtrace() returned 1 addresses
/lib/ld-linux.so.3 [0x40025000]
Could you please help me to solve this problem?
Thanks
I don't have any problem with gcc, But I cant get traces with arm-linux-gcc.
According to the GCC ARM Options documentation, you need to pass the -mapcs-frame option to GCC to generate stack frames on the ARM platform.
-mapcs-frame
Generate a stack frame that is compliant with the ARM Procedure Call Standard for all functions, even if this is not strictly necessary for correct execution of the code. Specifying -fomit-frame-pointer with this option causes the stack frames not to be generated for leaf functions. The default is -mno-apcs-frame.
This was pointed out to me in a comment to my Linux specific answer to How to generate a stacktrace when my gcc C++ app crashes, which you may also find useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With