|
From: openocd-gerrit <ope...@us...> - 2025-02-11 11:54:32
|
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 7f2db80ebc168d74a56dc8b76be5355ee4878be6 (commit)
from eb6f2745b7d9924d0dddeab91c1743867c4e812c (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 7f2db80ebc168d74a56dc8b76be5355ee4878be6
Author: Marc Schink <de...@za...>
Date: Sat Dec 7 10:53:56 2024 +0100
rtos/hwthread: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() to indicate which target the message belongs to.
While at it, fix some coding style issues.
Change-Id: Iac0296498557a689468a4a19d0bc64f03178a0d0
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8727
Reviewed-by: Antonio Borneo <bor...@gm...>
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c
index c9f1a1792..6332bd8ad 100644
--- a/src/rtos/hwthread.c
+++ b/src/rtos/hwthread.c
@@ -119,7 +119,7 @@ static int hwthread_update_threads(struct rtos *rtos)
if (current_threadid <= thread_list_size)
rtos->current_threadid = current_threadid;
else
- LOG_WARNING("SMP node change, disconnect GDB from core/thread %" PRId64,
+ LOG_TARGET_WARNING(target, "SMP node change, disconnect GDB from core/thread %" PRId64,
current_threadid);
/* create space for new thread details */
@@ -204,7 +204,8 @@ static int hwthread_update_threads(struct rtos *rtos)
else
rtos->current_thread = threadid_from_target(target);
- LOG_DEBUG("%s current_thread=%i", __func__, (int)rtos->current_thread);
+ LOG_TARGET_DEBUG(target, "%s current_thread=%i", __func__,
+ (int)rtos->current_thread);
return 0;
}
@@ -270,7 +271,8 @@ static int hwthread_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
if (!reg_list[i]->valid) {
retval = reg_list[i]->type->get(reg_list[i]);
if (retval != ERROR_OK) {
- LOG_ERROR("Couldn't get register %s.", reg_list[i]->name);
+ LOG_TARGET_ERROR(curr, "Couldn't get register %s",
+ reg_list[i]->name);
free(reg_list);
free(*rtos_reg_list);
return retval;
@@ -297,7 +299,8 @@ static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id,
struct target *curr = hwthread_find_thread(target, thread_id);
if (!curr) {
- LOG_ERROR("Couldn't find RTOS thread for id %" PRId64 ".", thread_id);
+ LOG_TARGET_ERROR(target, "Couldn't find RTOS thread for id %" PRId64,
+ thread_id);
return ERROR_FAIL;
}
@@ -308,8 +311,8 @@ static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id,
struct reg *reg = register_get_by_number(curr->reg_cache, reg_num, true);
if (!reg) {
- LOG_ERROR("Couldn't find register %" PRIu32 " in thread %" PRId64 ".", reg_num,
- thread_id);
+ LOG_TARGET_ERROR(curr, "Couldn't find register %" PRIu32 " in thread %" PRId64,
+ reg_num, thread_id);
return ERROR_FAIL;
}
@@ -372,17 +375,17 @@ static bool hwthread_detect_rtos(struct target *target)
static int hwthread_thread_packet(struct connection *connection, const char *packet, int packet_size)
{
- struct target *target = get_target_from_connection(connection);
-
- struct target *curr = NULL;
- int64_t current_threadid;
-
if (packet[0] == 'H' && packet[1] == 'g') {
+ int64_t current_threadid;
sscanf(packet, "Hg%16" SCNx64, ¤t_threadid);
+ struct target *target = get_target_from_connection(connection);
+
if (current_threadid > 0) {
+ struct target *curr = NULL;
if (hwthread_target_for_threadid(connection, current_threadid, &curr) != ERROR_OK) {
- LOG_ERROR("hwthread: cannot find thread id %"PRId64, current_threadid);
+ LOG_TARGET_ERROR(target, "hwthread: cannot find thread id %" PRId64,
+ current_threadid);
gdb_put_packet(connection, "E01", 3);
return ERROR_FAIL;
}
@@ -402,7 +405,7 @@ static int hwthread_thread_packet(struct connection *connection, const char *pac
static int hwthread_create(struct target *target)
{
- LOG_INFO("Hardware thread awareness created");
+ LOG_TARGET_INFO(target, "Hardware thread awareness created");
target->rtos->rtos_specific_params = NULL;
target->rtos->current_thread = 0;
-----------------------------------------------------------------------
Summary of changes:
src/rtos/hwthread.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|