1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Fix stack trace unwinding within continuation lib (#4385)

This commit is contained in:
Kyle Fleming 2018-03-08 12:21:47 -08:00 committed by Develo
parent 7f0b9d1be9
commit 70f522cff8

View File

@ -58,6 +58,30 @@ cont_continue:
ret ret
.size cont_yield, . - cont_yield .size cont_yield, . - cont_yield
////////////////////////////////////////////////////
/*
The purpose of cont_wrapper is to signal to xtensa-gdb
that we want to treat this function as the outermost one.
From: binutils-gdb-xtensa/gdb/xtensa-tdep.c:2677 <https://git.io/vA8Ps>
"Special case for terminating backtrace at a function that wants to
be seen as the outermost one. Such a function will clear it's RA (A0)
register to 0 in the prologue instead of saving its original value."
*/
.text
.align 4
.literal_position
.global cont_wrapper
.type cont_wrapper, @function
cont_wrapper:
movi a0, 0
callx0 a3
movi a2, cont_norm
jx a2
.size cont_wrapper, . - cont_wrapper
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
.text .text
@ -91,8 +115,8 @@ cont_run:
/* set new stack*/ /* set new stack*/
l32i a1, a2, 16; l32i a1, a2, 16;
/* goto pfn */ /* goto pfn */
movi a0, cont_norm movi a2, cont_wrapper
jx a3 jx a2
cont_resume: cont_resume:
/* a1 <- cont_ctx.sp_yield */ /* a1 <- cont_ctx.sp_yield */