diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-05-16 14:33:26 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-05-22 07:16:11 -0400 |
commit | 981e9728390b401404c36241e2ce6bd4cfcb723d (patch) | |
tree | b68a7eaf7bf53dcd0dea8b29324c1e303bbb48f7 /lib/mipsunwinder/init_context_32.S | |
parent | cade488b089667f1252220d6b613c6795f960852 (diff) | |
download | rockbox-981e9728390b401404c36241e2ce6bd4cfcb723d.tar.gz rockbox-981e9728390b401404c36241e2ce6bd4cfcb723d.zip |
mips: add native backtrace implementation
Should make debugging crashes on native MIPS targets far easier.
This is by no means a 100% complete or robust implementation but
it seems to handle the vast majority of functions.
Change-Id: Id5f430270e02b5092b79026b6876675c784aa649
Diffstat (limited to 'lib/mipsunwinder/init_context_32.S')
-rw-r--r-- | lib/mipsunwinder/init_context_32.S | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/mipsunwinder/init_context_32.S b/lib/mipsunwinder/init_context_32.S new file mode 100644 index 0000000000..a943d13dc3 --- /dev/null +++ b/lib/mipsunwinder/init_context_32.S | |||
@@ -0,0 +1,12 @@ | |||
1 | #include "mips.h" | ||
2 | |||
3 | .text | ||
4 | .global mips_bt_start | ||
5 | |||
6 | mips_bt_start: | ||
7 | addiu v0, ra, -8 | ||
8 | sw v0, 0(a0) /* ctx->pc = ra - 8 */ | ||
9 | sw sp, 4(a0) /* ctx->sp = sp */ | ||
10 | sw zero, 8(a0) /* ctx->depth = 0 */ | ||
11 | sw zero, 12(a0) /* ctx->valid = 0 */ | ||
12 | jr ra | ||