mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
automate crash for GDBStub
This commit is contained in:
parent
1c4a48dbd8
commit
8c7d1b780e
@ -45,6 +45,8 @@ static void uart1_write_char_d(char c);
|
||||
static void print_stack(uint32_t start, uint32_t end);
|
||||
//static void print_pcs(uint32_t start, uint32_t end);
|
||||
|
||||
bool __attribute((weak)) crash_for_gdb = 0;
|
||||
|
||||
extern void __custom_crash_callback( struct rst_info * rst_info, uint32_t stack, uint32_t stack_end ) {
|
||||
(void) rst_info;
|
||||
(void) stack;
|
||||
@ -54,6 +56,7 @@ extern void __custom_crash_callback( struct rst_info * rst_info, uint32_t stack,
|
||||
extern void custom_crash_callback( struct rst_info * rst_info, uint32_t stack, uint32_t stack_end ) __attribute__ ((weak, alias("__custom_crash_callback")));
|
||||
|
||||
void __wrap_system_restart_local() {
|
||||
if (crash_for_gdb) *((int*)0) = 0;
|
||||
register uint32_t sp asm("a1");
|
||||
|
||||
struct rst_info rst_info = {0};
|
||||
|
@ -3,4 +3,6 @@
|
||||
|
||||
// this header is intentionally left blank
|
||||
|
||||
bool crash_for_gdb = 1;
|
||||
|
||||
#endif //GDBSTUB_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user