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 /firmware/panic.c | |
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 'firmware/panic.c')
-rw-r--r-- | firmware/panic.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/panic.c b/firmware/panic.c index fcfa8b2bb8..586ecb6e0a 100644 --- a/firmware/panic.c +++ b/firmware/panic.c | |||
@@ -32,9 +32,9 @@ | |||
32 | #include "system.h" | 32 | #include "system.h" |
33 | #include "logf.h" | 33 | #include "logf.h" |
34 | 34 | ||
35 | #if defined(CPU_ARM) | 35 | #ifdef HAVE_RB_BACKTRACE |
36 | #include "gcc_extensions.h" | 36 | #include "gcc_extensions.h" |
37 | #include <backtrace.h> | 37 | #include "backtrace.h" |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | static char panic_buf[128]; | 40 | static char panic_buf[128]; |
@@ -65,6 +65,12 @@ void panicf_f( const char *fmt, ...) | |||
65 | ); | 65 | ); |
66 | 66 | ||
67 | int pc = (int)__builtin_return_address(0); | 67 | int pc = (int)__builtin_return_address(0); |
68 | #elif defined(BACKTRACE_MIPSUNWINDER) | ||
69 | void panicf( const char *fmt, ... ) | ||
70 | { | ||
71 | /* NOTE: these are obtained by the backtrace lib */ | ||
72 | const int pc = 0; | ||
73 | const int sp = 0; | ||
68 | #else | 74 | #else |
69 | void panicf( const char *fmt, ...) | 75 | void panicf( const char *fmt, ...) |
70 | { | 76 | { |