File tree 1 file changed +26
-2
lines changed
1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,30 @@ cont_continue:
58
58
ret
59
59
.size cont_yield, . - cont_yield
60
60
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
+
61
85
////////////////////////////////////////////////////
62
86
63
87
.text
@@ -91,8 +115,8 @@ cont_run:
91
115
/* set new stack*/
92
116
l32i a1 , a2 , 16 ;
93
117
/* goto pfn */
94
- movi a0 , cont_norm
95
- jx a3
118
+ movi a2 , cont_wrapper
119
+ jx a2
96
120
97
121
cont_resume:
98
122
/* a1 <- cont_ctx.sp_yield */
You can’t perform that action at this time.
0 commit comments