|
From: openocd-gerrit <ope...@us...> - 2023-03-25 18:07:08
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via faeae51d7f497d83ab166329abb1f06aa5903774 (commit)
from ee31f1578a333a75737bc5b183cd4ae98cdaf798 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit faeae51d7f497d83ab166329abb1f06aa5903774
Author: Erhan Kurubas <erh...@es...>
Date: Wed Mar 15 01:22:10 2023 +0300
target/espressif: check common_magic instead of gdb_arch string
The value returned by target_get_gdb_arch() is something specific for GDB.
There could be several variants of the same CPU.
If we start implementing all the variants, checking the string value,
could become incorrect.
It's better to check for xtensa->common_magic == XTENSA_COMMON_MAGIC
Signed-off-by: Erhan Kurubas <erh...@es...>
Change-Id: I20f3fdced176c3b9ab00f889743161ecad7280f9
Reviewed-on: https://review.openocd.org/c/openocd/+/7536
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/espressif/esp_semihosting.c b/src/target/espressif/esp_semihosting.c
index 5e9cb9457..51d499866 100644
--- a/src/target/espressif/esp_semihosting.c
+++ b/src/target/espressif/esp_semihosting.c
@@ -17,12 +17,10 @@
static struct esp_semihost_data __attribute__((unused)) *target_to_esp_semihost_data(struct target *target)
{
- const char *arch = target_get_gdb_arch(target);
- if (arch) {
- if (strncmp(arch, "xtensa", 6) == 0)
- return &target_to_esp_xtensa(target)->semihost;
- /* TODO: add riscv */
- }
+ struct xtensa *xtensa = target->arch_info;
+ if (xtensa->common_magic == XTENSA_COMMON_MAGIC)
+ return &target_to_esp_xtensa(target)->semihost;
+ /* TODO: add riscv */
LOG_ERROR("Unknown target arch!");
return NULL;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/espressif/esp_semihosting.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|