From patchwork Mon Mar 14 04:17:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1604889 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P/FawBe8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KH3DX23kwz9sG2 for ; Mon, 14 Mar 2022 15:18:04 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KH3DX0dMCz30HZ for ; Mon, 14 Mar 2022 15:18:04 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P/FawBe8; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::534; helo=mail-pg1-x534.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P/FawBe8; dkim-atps=neutral Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KH3DF4d9Rz303H for ; Mon, 14 Mar 2022 15:17:47 +1100 (AEDT) Received: by mail-pg1-x534.google.com with SMTP id t187so12700372pgb.1 for ; Sun, 13 Mar 2022 21:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b1Q53NeNU0zjYZWNhFHufQKkqWRB66gA4zzsadL2dV0=; b=P/FawBe8biWnd8edDsDu28BJJ7BSvthIawtfQH9EI8j692xqfetcysIoU9i+9Obequ 8xSQItRIAz5GXYaheTRLVeBAKNi8n44FgU9eTq/yQ9NzPKv4GaigbY3JX06KvbGLZHwq wGjIc5d/qK4b5MT89Dc+/6wrTGAVHWqSgK0jmLEQwviO0/JoU5B9KV1gMv6FMn6QDx8v gqyTyzbhxl340ZFFv4++w16ECNkDZ/4F3XZWXOTlH81+Aiqv8N7C821FLbky+o+qaLgd MzXfPSwKFL/G6rKqS0Wh6CvmZRBUv/pGvOR3ekxyRt12mQ6+JhtGOLzeMRk87wkAdczY IFgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b1Q53NeNU0zjYZWNhFHufQKkqWRB66gA4zzsadL2dV0=; b=cwJI5EM6ZDkkWg1QvTVf5X5x+5EB7TfWz7N1S0iPSCE9URpeH6R/z7svyxI4WlO8aj VsL0pMv2SsSpntVWIXn4Jo4lBCs1h7Rm9vg6VZviWLnyMl2D1H7XYf5+BC0DNDHV+qWQ xtAsOwhnrG8tivb2Qiazj/zlYGWHpH3m+Te6H3r29KAynLDmvBV6le2AN4k936sX/RtL wFnFyfjwWsAIC++OjmN8b3fzHbniyPbvRebS6/jfSHKlaN3GEjdR+x7dR2ES90Pnak4e wbuOZ/9wag7gtD9uv8Ix8RCB5HtyyLT+uOK0PEI17OTRnzlPaLEzHDO9sJnyx8uY4Fy6 XajQ== X-Gm-Message-State: AOAM530jpxu8LG7vImY6vIOaPiSNyTy8BPZj9oX/9UCLEkeKGNSB5+9l 7o8IIizZfOBgl4YnkbMlgqRH/njzToI= X-Google-Smtp-Source: ABdhPJysJbF/6so4BE3PCg33EiJfgQeyFbF3VlzgcgjgAwmbGNEuEkWN5U8mldIH6swa0/EcZu8v6g== X-Received: by 2002:a63:4186:0:b0:378:b438:c7ac with SMTP id o128-20020a634186000000b00378b438c7acmr18176809pga.291.1647231465031; Sun, 13 Mar 2022 21:17:45 -0700 (PDT) Received: from bobo.ibm.com (110-175-148-108.static.tpgi.com.au. [110.175.148.108]) by smtp.gmail.com with ESMTPSA id d16-20020a056a00245000b004f771b48736sm14283018pfj.194.2022.03.13.21.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 21:17:44 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Mon, 14 Mar 2022 14:17:21 +1000 Message-Id: <20220314041735.542867-2-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220314041735.542867-1-npiggin@gmail.com> References: <20220314041735.542867-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 01/14] gdbserver: update gdb_parser_precompile.c, rename detach command X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" gdb_parser_precompile.c had not been updated since adding support for the detach command, resulting in client error messages like this: Detaching from program: /home/npiggin/images/vmlinux, process 42000 Remote doesn't know how to detach The command handler should not be named disconnect, because that is a different concept in gdb (disconnect leaves the target in the same state, detach ends the debugging session). Signed-off-by: Nicholas Piggin --- src/gdb_parser.rl | 4 +- src/gdb_parser_precompile.c | 231 ++++++++++++++++++------------------ src/pdbgproxy.c | 6 +- src/pdbgproxy.h | 2 +- 4 files changed, 124 insertions(+), 119 deletions(-) diff --git a/src/gdb_parser.rl b/src/gdb_parser.rl index 6259b96..93213e4 100644 --- a/src/gdb_parser.rl +++ b/src/gdb_parser.rl @@ -76,7 +76,7 @@ set_thread = ('H' any* @{cmd = SET_THREAD;}); - disconnect = ('D' @{cmd = DISCONNECT;} + detach = ('D' @{cmd = DETACH;} xdigit+ $hex_digit %push); # TODO: We don't actually listen to what's supported @@ -94,7 +94,7 @@ commands = (get_mem | get_gprs | get_spr | stop_reason | set_thread | q_attached | q_C | q_supported | qf_threadinfo | q_C | - v_contq | v_contc | v_conts | put_mem | disconnect ); + v_contq | v_contc | v_conts | put_mem | detach ); cmd = ((commands & ^'#'*) | ^'#'*) $crc ('#' xdigit{2} $hex_digit @end); diff --git a/src/gdb_parser_precompile.c b/src/gdb_parser_precompile.c index 715cdd7..cee2fd0 100644 --- a/src/gdb_parser_precompile.c +++ b/src/gdb_parser_precompile.c @@ -5,10 +5,10 @@ #include #include -#include "pdbgproxy.h" +#include "src/pdbgproxy.h" -#line 105 "src/gdb_parser.rl" +#line 108 "src/gdb_parser.rl" static enum gdb_command cmd = NONE; @@ -29,56 +29,56 @@ static const char _gdb_actions[] = { 1, 2, 9, 1, 2, 10, 1, 2, 11, 1, 2, 12, 1, 2, 13, 1, 2, 14, 1, 2, 15, 1, 2, 16, - 1, 2, 17, 1, 2, 18, 0, 3, - 1, 18, 0, 3, 6, 2, 1, 3, - 6, 3, 1 + 1, 2, 17, 1, 2, 18, 1, 2, + 19, 0, 3, 1, 19, 0, 3, 6, + 2, 1, 3, 6, 3, 1 }; -static const char _gdb_key_offsets[] = { - 0, 0, 2, 13, 14, 20, 26, 29, - 37, 45, 46, 53, 61, 68, 77, 84, - 92, 99, 107, 114, 121, 126, 128, 130, - 132, 134, 136, 138, 140, 142, 149, 151, - 153, 155, 157, 159, 161, 163, 165, 167, - 168, 170, 172, 174, 176, 178, 180, 182, - 184, 186, 188, 190, 192, 194, 196, 199, - 202, 203, 204, 206 +static const unsigned char _gdb_key_offsets[] = { + 0, 0, 2, 14, 15, 21, 27, 30, + 38, 46, 53, 60, 61, 68, 76, 83, + 92, 99, 107, 114, 122, 127, 129, 131, + 133, 135, 137, 139, 141, 143, 150, 152, + 154, 156, 158, 160, 162, 164, 166, 168, + 169, 171, 173, 175, 177, 179, 181, 183, + 185, 187, 189, 191, 193, 195, 197, 200, + 203, 204, 205, 207 }; static const char _gdb_trans_keys[] = { - 3, 36, 35, 43, 45, 63, 72, 77, - 103, 109, 112, 113, 118, 35, 48, 57, - 65, 70, 97, 102, 48, 57, 65, 70, - 97, 102, 3, 35, 36, 3, 36, 48, - 57, 65, 70, 97, 102, 3, 36, 48, - 57, 65, 70, 97, 102, 35, 35, 48, - 57, 65, 70, 97, 102, 35, 44, 48, - 57, 65, 70, 97, 102, 35, 48, 57, - 65, 70, 97, 102, 35, 44, 58, 48, + 3, 36, 35, 43, 45, 63, 68, 72, + 77, 103, 109, 112, 113, 118, 35, 48, + 57, 65, 70, 97, 102, 48, 57, 65, + 70, 97, 102, 3, 35, 36, 3, 36, + 48, 57, 65, 70, 97, 102, 3, 36, + 48, 57, 65, 70, 97, 102, 35, 48, 57, 65, 70, 97, 102, 35, 48, 57, + 65, 70, 97, 102, 35, 35, 48, 57, 65, 70, 97, 102, 35, 44, 48, 57, 65, 70, 97, 102, 35, 48, 57, 65, + 70, 97, 102, 35, 44, 58, 48, 57, + 65, 70, 97, 102, 35, 48, 57, 65, 70, 97, 102, 35, 44, 48, 57, 65, 70, 97, 102, 35, 48, 57, 65, 70, - 97, 102, 35, 48, 57, 65, 70, 97, - 102, 35, 65, 67, 83, 102, 35, 116, - 35, 116, 35, 97, 35, 99, 35, 104, - 35, 101, 35, 100, 35, 58, 35, 48, - 57, 65, 70, 97, 102, 35, 117, 35, - 112, 35, 112, 35, 111, 35, 114, 35, - 116, 35, 101, 35, 100, 35, 58, 35, - 35, 84, 35, 104, 35, 114, 35, 101, - 35, 97, 35, 100, 35, 73, 35, 110, - 35, 102, 35, 111, 35, 67, 35, 111, - 35, 110, 35, 116, 35, 59, 63, 35, - 99, 115, 35, 35, 3, 36, 3, 35, - 36, 0 + 97, 102, 35, 44, 48, 57, 65, 70, + 97, 102, 35, 65, 67, 83, 102, 35, + 116, 35, 116, 35, 97, 35, 99, 35, + 104, 35, 101, 35, 100, 35, 58, 35, + 48, 57, 65, 70, 97, 102, 35, 117, + 35, 112, 35, 112, 35, 111, 35, 114, + 35, 116, 35, 101, 35, 100, 35, 58, + 35, 35, 84, 35, 104, 35, 114, 35, + 101, 35, 97, 35, 100, 35, 73, 35, + 110, 35, 102, 35, 111, 35, 67, 35, + 111, 35, 110, 35, 116, 35, 59, 63, + 35, 99, 115, 35, 35, 3, 36, 3, + 35, 36, 0 }; static const char _gdb_single_lengths[] = { - 0, 2, 11, 1, 0, 0, 3, 2, - 2, 1, 1, 2, 1, 3, 1, 2, - 1, 2, 1, 1, 5, 2, 2, 2, + 0, 2, 12, 1, 0, 0, 3, 2, + 2, 1, 1, 1, 1, 2, 1, 3, + 1, 2, 1, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, @@ -88,7 +88,7 @@ static const char _gdb_single_lengths[] = { static const char _gdb_range_lengths[] = { 0, 0, 0, 0, 3, 3, 0, 3, - 3, 0, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -98,71 +98,72 @@ static const char _gdb_range_lengths[] = { }; static const short _gdb_index_offsets[] = { - 0, 0, 3, 15, 17, 21, 25, 29, - 35, 41, 43, 48, 54, 59, 66, 71, - 77, 82, 88, 93, 98, 104, 107, 110, - 113, 116, 119, 122, 125, 128, 133, 136, - 139, 142, 145, 148, 151, 154, 157, 160, - 162, 165, 168, 171, 174, 177, 180, 183, - 186, 189, 192, 195, 198, 201, 204, 208, - 212, 214, 216, 219 + 0, 0, 3, 16, 18, 22, 26, 30, + 36, 42, 47, 52, 54, 59, 65, 70, + 77, 82, 88, 93, 99, 105, 108, 111, + 114, 117, 120, 123, 126, 129, 134, 137, + 140, 143, 146, 149, 152, 155, 158, 161, + 163, 166, 169, 172, 175, 178, 181, 184, + 187, 190, 193, 196, 199, 202, 205, 209, + 213, 215, 217, 220 }; static const char _gdb_indicies[] = { 1, 2, 0, 4, 5, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 3, 4, - 3, 14, 14, 14, 15, 16, 16, 16, - 15, 18, 19, 20, 17, 1, 2, 21, - 21, 21, 0, 1, 2, 16, 16, 16, - 0, 4, 22, 4, 24, 24, 24, 23, - 4, 25, 24, 24, 24, 23, 4, 26, - 26, 26, 23, 4, 25, 27, 26, 26, - 26, 23, 4, 28, 28, 28, 23, 29, - 25, 28, 28, 28, 23, 4, 30, 30, - 30, 3, 4, 31, 30, 30, 30, 3, - 4, 32, 32, 32, 3, 29, 32, 32, - 32, 3, 4, 33, 34, 35, 36, 3, - 4, 37, 3, 4, 38, 3, 4, 39, - 3, 4, 40, 3, 4, 41, 3, 4, - 42, 3, 4, 43, 3, 4, 44, 3, - 4, 45, 45, 45, 3, 4, 46, 3, - 4, 47, 3, 4, 48, 3, 4, 49, - 3, 4, 50, 3, 4, 51, 3, 4, - 52, 3, 4, 53, 3, 4, 54, 3, - 4, 55, 4, 56, 3, 4, 57, 3, - 4, 58, 3, 4, 59, 3, 4, 60, - 3, 4, 61, 3, 4, 62, 3, 4, - 63, 3, 4, 64, 3, 4, 65, 3, - 4, 66, 3, 4, 67, 3, 4, 68, - 3, 4, 69, 3, 4, 70, 71, 3, - 4, 72, 73, 3, 4, 74, 4, 75, - 1, 2, 0, 18, 19, 20, 17, 0 + 8, 9, 10, 11, 12, 13, 14, 3, + 4, 3, 15, 15, 15, 16, 17, 17, + 17, 16, 19, 20, 21, 18, 1, 2, + 22, 22, 22, 0, 1, 2, 17, 17, + 17, 0, 4, 23, 23, 23, 3, 24, + 23, 23, 23, 3, 4, 25, 4, 27, + 27, 27, 26, 4, 28, 27, 27, 27, + 26, 4, 29, 29, 29, 26, 4, 28, + 30, 29, 29, 29, 26, 4, 31, 31, + 31, 26, 24, 28, 31, 31, 31, 26, + 4, 32, 32, 32, 3, 4, 33, 32, + 32, 32, 3, 4, 34, 35, 36, 37, + 3, 4, 38, 3, 4, 39, 3, 4, + 40, 3, 4, 41, 3, 4, 42, 3, + 4, 43, 3, 4, 44, 3, 4, 45, + 3, 4, 46, 46, 46, 3, 4, 47, + 3, 4, 48, 3, 4, 49, 3, 4, + 50, 3, 4, 51, 3, 4, 52, 3, + 4, 53, 3, 4, 54, 3, 4, 55, + 3, 4, 56, 4, 57, 3, 4, 58, + 3, 4, 59, 3, 4, 60, 3, 4, + 61, 3, 4, 62, 3, 4, 63, 3, + 4, 64, 3, 4, 65, 3, 4, 66, + 3, 4, 67, 3, 4, 68, 3, 4, + 69, 3, 4, 70, 3, 4, 71, 72, + 3, 4, 73, 74, 3, 4, 75, 4, + 76, 1, 2, 0, 19, 20, 21, 18, + 0 }; static const char _gdb_trans_targs[] = { 1, 2, 2, 3, 4, 59, 3, 9, - 10, 3, 16, 18, 20, 50, 5, 0, - 58, 6, 2, 7, 2, 8, 9, 10, - 11, 12, 13, 14, 15, 4, 17, 18, - 19, 21, 3, 30, 40, 22, 23, 24, - 25, 26, 27, 28, 29, 29, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 39, - 41, 42, 43, 44, 45, 46, 47, 48, - 49, 3, 51, 52, 53, 54, 55, 3, - 56, 57, 56, 57 + 11, 12, 3, 18, 9, 20, 50, 5, + 0, 58, 6, 2, 7, 2, 8, 10, + 4, 11, 12, 13, 14, 15, 16, 17, + 19, 9, 21, 3, 30, 40, 22, 23, + 24, 25, 26, 27, 28, 29, 29, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 39, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 3, 51, 52, 53, 54, 55, + 3, 56, 57, 56, 57 }; static const char _gdb_trans_actions[] = { - 0, 60, 1, 3, 0, 3, 33, 3, - 3, 27, 21, 30, 3, 3, 7, 0, - 18, 3, 63, 0, 9, 7, 36, 24, - 71, 67, 71, 67, 71, 5, 15, 12, - 15, 3, 42, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 39, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 45, + 0, 63, 1, 3, 0, 3, 33, 39, + 3, 3, 27, 21, 30, 3, 3, 7, + 0, 18, 3, 66, 0, 9, 7, 15, + 5, 36, 24, 74, 70, 74, 70, 74, + 15, 12, 3, 45, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 42, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 48, 3, 3, 3, 3, 3, 51, - 3, 3, 54, 57 + 48, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 51, 3, 3, 3, 3, 3, + 54, 3, 3, 57, 60 }; static const int gdb_start = 58; @@ -172,17 +173,17 @@ static const int gdb_error = 0; static const int gdb_en_main = 58; -#line 116 "src/gdb_parser.rl" +#line 119 "src/gdb_parser.rl" void parser_init(command_cb *callbacks) { -#line 181 "src/gdb_parser.c" +#line 182 "src/gdb_parser.c" { cs = gdb_start; } -#line 120 "src/gdb_parser.rl" +#line 123 "src/gdb_parser.rl" command_callbacks = callbacks; } @@ -193,7 +194,7 @@ int parse_buffer(char *buf, size_t len, void *priv) char *pe = p + len + 1; -#line 197 "src/gdb_parser.c" +#line 198 "src/gdb_parser.c" { int _klen; unsigned int _trans; @@ -349,38 +350,42 @@ _match: {cmd = SET_THREAD;} break; case 11: -#line 80 "src/gdb_parser.rl" - {rsp = "1";} +#line 79 "src/gdb_parser.rl" + {cmd = DETACH;} break; case 12: -#line 81 "src/gdb_parser.rl" - {rsp = "QC1";} +#line 83 "src/gdb_parser.rl" + {rsp = "1";} break; case 13: -#line 82 "src/gdb_parser.rl" - {rsp = "multiprocess+;vContSupported+";} +#line 84 "src/gdb_parser.rl" + {rsp = "QC1";} break; case 14: -#line 83 "src/gdb_parser.rl" - {rsp = "m1l";} +#line 85 "src/gdb_parser.rl" + {rsp = "multiprocess+;vContSupported+";} break; case 15: #line 86 "src/gdb_parser.rl" - {rsp = "vCont;c;C;s;S";} + {rsp = "m1l";} break; case 16: -#line 87 "src/gdb_parser.rl" - {cmd = V_CONTC;} +#line 89 "src/gdb_parser.rl" + {rsp = "vCont;c;C;s;S";} break; case 17: -#line 88 "src/gdb_parser.rl" - {cmd = V_CONTS;} +#line 90 "src/gdb_parser.rl" + {cmd = V_CONTC;} break; case 18: -#line 90 "src/gdb_parser.rl" +#line 91 "src/gdb_parser.rl" + {cmd = V_CONTS;} + break; + case 19: +#line 93 "src/gdb_parser.rl" {command_callbacks[INTERRUPT](stack, priv);} break; -#line 384 "src/gdb_parser.c" +#line 389 "src/gdb_parser.c" } } @@ -393,7 +398,7 @@ _again: _out: {} } -#line 130 "src/gdb_parser.rl" +#line 133 "src/gdb_parser.rl" return 0; } diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c index bb7c7b3..3e27ba0 100644 --- a/src/pdbgproxy.c +++ b/src/pdbgproxy.c @@ -95,9 +95,9 @@ static void stop_reason(uint64_t *stack, void *priv) send_response(fd, TRAP); } -static void disconnect(uint64_t *stack, void *priv) +static void detach(uint64_t *stack, void *priv) { - PR_INFO("Terminating connection with client. pid %16" PRIi64 "\n", stack[0]); + PR_INFO("Detach debug session with client. pid %16" PRIi64 "\n", stack[0]); send_response(fd, OK); } @@ -416,7 +416,7 @@ command_cb callbacks[LAST_CMD + 1] = { v_conts, put_mem, interrupt, - disconnect, + detach, NULL}; int gdbserver_start(struct pdbg_target *thread, struct pdbg_target *adu, uint16_t port) diff --git a/src/pdbgproxy.h b/src/pdbgproxy.h index 1fe67f2..1910fdb 100644 --- a/src/pdbgproxy.h +++ b/src/pdbgproxy.h @@ -3,7 +3,7 @@ enum gdb_command {NONE, GET_GPRS, GET_SPR, GET_MEM, STOP_REASON, SET_THREAD, V_CONTC, V_CONTS, - PUT_MEM, INTERRUPT, DISCONNECT, LAST_CMD}; + PUT_MEM, INTERRUPT, DETACH, LAST_CMD}; typedef void (*command_cb)(uint64_t *stack, void *priv); void parser_init(command_cb *callbacks);