From 677ccfbc1a9e004f95d90961b002aa018f7a8c0f Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Tue, 19 Sep 2023 07:30:49 +0300 Subject: [PATCH] target/espressif: change pseudo_ex_reason name as panic_reason --- src/target/espressif/esp.c | 8 ++++---- src/target/espressif/esp.h | 6 +++--- src/target/espressif/esp_semihosting.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/target/espressif/esp.c b/src/target/espressif/esp.c index 048bb9cfa4..99cddf8554 100644 --- a/src/target/espressif/esp.c +++ b/src/target/espressif/esp.c @@ -270,15 +270,15 @@ void esp_common_assist_debug_monitor_restore(struct target *target, uint32_t add int esp_common_read_pseudo_ex_reason(struct target *target) { struct esp_common *esp = target_to_esp_common(target); - if (esp && esp->pseudo_ex_reason.addr) { - uint8_t str[esp->pseudo_ex_reason.len + 1]; + if (esp && esp->panic_reason.addr) { + uint8_t str[esp->panic_reason.len + 1]; memset(str, 0x00, sizeof(str)); - int retval = target_read_memory(target, esp->pseudo_ex_reason.addr, 1, esp->pseudo_ex_reason.len, str); + int retval = target_read_memory(target, esp->panic_reason.addr, 1, esp->panic_reason.len, str); if (retval == ERROR_OK) LOG_TARGET_INFO(target, "Halt cause (%s)", str); else LOG_TARGET_ERROR(target, "Pseudo exception reason read failed (%d)", retval); - esp->pseudo_ex_reason.addr = 0; + esp->panic_reason.addr = 0; return ERROR_OK; } diff --git a/src/target/espressif/esp.h b/src/target/espressif/esp.h index ae3c88a940..6959ff4b52 100644 --- a/src/target/espressif/esp.h +++ b/src/target/espressif/esp.h @@ -80,8 +80,8 @@ struct esp_dbg_stubs { struct esp_dbg_stubs_desc desc; }; -struct esp_pseudo_ex_reason { - target_addr_t addr; +struct esp_panic_reason { + uint32_t addr; uint32_t len; }; @@ -118,7 +118,7 @@ struct esp_common { struct esp_flash_breakpoints flash_brps; const struct algorithm_hw *algo_hw; struct esp_dbg_stubs dbg_stubs; - struct esp_pseudo_ex_reason pseudo_ex_reason; + struct esp_panic_reason panic_reason; }; struct esp_ops { diff --git a/src/target/espressif/esp_semihosting.c b/src/target/espressif/esp_semihosting.c index 4669b48f90..748789df63 100644 --- a/src/target/espressif/esp_semihosting.c +++ b/src/target/espressif/esp_semihosting.c @@ -307,8 +307,8 @@ int esp_semihosting_common(struct target *target) if (retval == ERROR_OK) { struct esp_common *esp = target_to_esp_common(target); if (esp) { - esp->pseudo_ex_reason.addr = semihosting_get_field(target, 0, fields); - esp->pseudo_ex_reason.len = semihosting_get_field(target, 1, fields); + esp->panic_reason.addr = semihosting_get_field(target, 0, fields); + esp->panic_reason.len = semihosting_get_field(target, 1, fields); } } break;