File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,30 @@ cont_continue:
5858 ret
5959 .size cont_yield, . - cont_yield
6060
61+ ////////////////////////////////////////////////////
62+
63+ /*
64+ The purpose of cont_wrapper is to signal to xtensa-gdb
65+ that we want to treat this function as the outermost one.
66+
67+ From: binutils-gdb-xtensa/gdb/xtensa-tdep.c:2677 <https://git.io/vA8Ps>
68+ "Special case for terminating backtrace at a function that wants to
69+ be seen as the outermost one. Such a function will clear it's RA (A0)
70+ register to 0 in the prologue instead of saving its original value."
71+ */
72+
73+ .text
74+ .align 4
75+ .literal_position
76+ .global cont_wrapper
77+ .type cont_wrapper, @function
78+ cont_wrapper:
79+ movi a0 , 0
80+ callx0 a3
81+ movi a2 , cont_norm
82+ jx a2
83+ .size cont_wrapper, . - cont_wrapper
84+
6185////////////////////////////////////////////////////
6286
6387 .text
@@ -91,8 +115,8 @@ cont_run:
91115 /* set new stack*/
92116 l32i a1 , a2 , 16 ;
93117 /* goto pfn */
94- movi a0 , cont_norm
95- jx a3
118+ movi a2 , cont_wrapper
119+ jx a2
96120
97121cont_resume:
98122 /* a1 <- cont_ctx.sp_yield */
You can’t perform that action at this time.
0 commit comments