From 10b25803ce879ee6ac832b884bfdabc79769486a Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Mon, 12 Feb 2024 01:26:34 -0500 Subject: Add thread_set_name RPC. Like task_set_name, we use the same size as the task name and will inherit the task name, whenever it exists. This will be used to implement pthread_setname_np. Message-ID: <20240212062634.1082207-2-flaviocruz@gmail.com> --- ddb/db_print.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ddb/db_print.c') diff --git a/ddb/db_print.c b/ddb/db_print.c index c8d85d26..f08dd6ce 100644 --- a/ddb/db_print.c +++ b/ddb/db_print.c @@ -222,10 +222,11 @@ db_print_thread( } } else { if (flag & OPTION_INDENT) - db_printf(" %3d (%0*X) ", thread_id, - 2*sizeof(vm_offset_t), thread); - else - db_printf("(%0*X) ", 2*sizeof(vm_offset_t), thread); + db_printf(" %3d ", thread_id); + if (thread->name[0] && + strncmp (thread->name, thread->task->name, THREAD_NAME_SIZE)) + db_printf("%s ", thread->name); + db_printf("(%0*X) ", 2*sizeof(vm_offset_t), thread); char status[8]; db_printf("%s", db_thread_stat(thread, status)); if (thread->state & TH_SWAPPED) { -- cgit v1.2.3