anonymous wrote on Saturday, April 14, 2007:
I see the GCC ARM port issue regarding thread unsafe function returns is still biting people. I find the use of -fomit-frame-pointer interferes with some debuggers’ abilities to unwind the stack. Some time ago I suggested a FreeRTOS port fix for it. I have been using the fix successfully for some time now. It seems to take care of the issue. I think it should be in the official ARM port so that the problem doesn’t keep coming back.
Here it is again (without explanation):
In the portSAVE_CONTEXT() macro of portmacro.h add the commented line in the position shown below
____/* Set R0 to point to the task stack pointer. */
________"STMDB SP,{SP}^ \n\t"
________"NOP \n\t"
________"SUB SP, SP, #4 \n\t"
________"LDMIA SP!,{R0} \n\t"
/*gb - step over possible GCC stacked items (GCC bug)*/
________"SUB R0, R0, #8 \n\t" \