summaryrefslogtreecommitdiff
path: root/ddb
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2024-02-12 01:26:34 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-02-12 18:52:21 +0100
commit10b25803ce879ee6ac832b884bfdabc79769486a (patch)
tree75aa37ab8f0f8ed3ae2e7009027329cf6937df29 /ddb
parentdf9270ef134498d4fffb921286375137d3639ae5 (diff)
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>
Diffstat (limited to 'ddb')
-rw-r--r--ddb/db_print.c9
1 files changed, 5 insertions, 4 deletions
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) {