ppc-eabi, get stack backtrace
Posted: Wed Oct 31, 2012 1:42 pm
Hi,
I was wondering, if an exception occurs the stack backtrace is shown, and code locations can be looked up with addr2line. According to GNU C++, the same can be achieved using the backtrace function that is defined in execinfo.h.
This file doesn't seem to be available in devkitPPC. My question is if devkitPPC has alternatives to request the backtrace. I figure that if the exception handler can do it, there must be code to do so in libc (or whatever other lib) and we might be able to use it.
My other question is if it is possible to fetch the contents of GPR01 (using asm or so), which, if I'm not mistaken, should contain the stackpointer. From there on I could browse the stackframes and check the method pointers to implement backtrace like behaviour myself.
Thanks,
Danny
I was wondering, if an exception occurs the stack backtrace is shown, and code locations can be looked up with addr2line. According to GNU C++, the same can be achieved using the backtrace function that is defined in execinfo.h.
This file doesn't seem to be available in devkitPPC. My question is if devkitPPC has alternatives to request the backtrace. I figure that if the exception handler can do it, there must be code to do so in libc (or whatever other lib) and we might be able to use it.
My other question is if it is possible to fetch the contents of GPR01 (using asm or so), which, if I'm not mistaken, should contain the stackpointer. From there on I could browse the stackframes and check the method pointers to implement backtrace like behaviour myself.
Thanks,
Danny