1
0
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:
david gauchard 2017-05-18 00:22:47 +02:00 committed by Ivan Grokhotkov
parent 1c4a48dbd8
commit 8c7d1b780e
2 changed files with 5 additions and 0 deletions

View File

@ -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};

View File

@ -3,4 +3,6 @@
// this header is intentionally left blank
bool crash_for_gdb = 1;
#endif //GDBSTUB_H