From 58c11e94cbf7d305bc3694c251cd7e6426fdc541 Mon Sep 17 00:00:00 2001 From: fcasal Date: Wed, 27 Jun 2018 18:45:28 +0100 Subject: [PATCH] Added json version of dp* (#10518) --- libr/core/cmd_debug.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libr/core/cmd_debug.c b/libr/core/cmd_debug.c index 745f2f3e3e613..ae50bb8434634 100644 --- a/libr/core/cmd_debug.c +++ b/libr/core/cmd_debug.c @@ -280,7 +280,9 @@ static const char *help_msg_dp[] = { "Usage:", "dp", " # Process commands", "dp", "", "List current pid and children", "dp", " ", "List children of pid", - "dp*", "", "List all attachable pids", + "dpj", " ", "List children of pid in JSON format", + "dpl", "", "List all attachable pids", + "dplj", "", "List all attachable pids in JSON format", "dp-", " ", "Detach select pid", "dp=", "", "Select pid", "dpa", " ", "Attach and select pid", @@ -1067,8 +1069,15 @@ static void cmd_debug_pid(RCore *core, const char *input) { (int) r_num_math (core->num, input + 2), core->dbg->tid); core->dbg->main_pid = r_num_math (core->num, input + 2); break; - case '*': // "dp*" - r_debug_pid_list (core->dbg, 0, 0); + case 'l': // "dpl" + switch (input[2]) { + case '\0': // "dpl" + r_debug_pid_list (core->dbg, 0, 0); + break; + case 'j': // "dplj" + r_debug_pid_list (core->dbg, 0, 'j'); + break; + } break; case 'j': // "dpj" r_debug_pid_list (core->dbg, core->dbg->pid, 'j');