Any news concerning this frame pointer issue?
I am trying to store/dump a backtrace in case of an exception in a NiosII system (without MPU) with ACDS 13.01 sp1 (gcc version 4.5.3). My observation matches exactly the OPs description. The compiler seems to calculate the frame pointer correctly as long as the called functions do not hold a lot of local variables. But with a more complex chain of function calls, the fp points somewhere near the stack pointer but NOT to the actual back link.
As for the
__builtin_return_address()
: still the same in gcc 4.5.3.
Does anyone know if this behaviour is still the same with the new compiler in Quartus/Nios 13.1?