Skip to content

Commit

Permalink
target/espressif: change pseudo_ex_reason name as panic_reason
Browse files Browse the repository at this point in the history
  • Loading branch information
erhankur committed Sep 19, 2023
1 parent 2a486de commit 677ccfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/target/espressif/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/target/espressif/esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/target/espressif/esp_semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 677ccfb

Please sign in to comment.