From f663fb0298c8e0200fdff824b88b2da1648ffd05 Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 29 Dec 2022 23:14:29 +0100 Subject: [PATCH] Implement `dpt.` command to print the current selected process ##debug --- libr/core/cmd_debug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libr/core/cmd_debug.c b/libr/core/cmd_debug.c index 0b63dfdbde..ffd927581a 100644 --- a/libr/core/cmd_debug.c +++ b/libr/core/cmd_debug.c @@ -319,10 +319,11 @@ static const char *help_msg_dp[] = { "dpf", "", "attach to pid like file fd // HACK", "dpk", " []", "send signal to process (default 0)", "dpn", "", "create new process (fork)", - "dptn", "", "create new thread (clone)", "dpt", "", "list threads of current pid", - "dptj", "", "list threads of current pid in JSON format", "dpt", " ", "list threads of process", + "dpt.", "", "show current thread id", + "dptj", "", "list threads of current pid in JSON format", + "dptn", "", "create new thread (clone)", "dptj", " ", "list threads of process in JSON format", "dpt=", "", "attach to thread", NULL @@ -1082,6 +1083,9 @@ static void cmd_debug_pid(RCore *core, const char *input) { case '\0': // "dpt" r_debug_thread_list (core->dbg, core->dbg->pid, 0); break; + case '.': + r_cons_printf ("%d\n", core->dbg->tid); + break; case 'j': // "dptj" if (input[3] != ' ') { // "dptj" r_debug_thread_list (core->dbg, core->dbg->pid, 'j');