From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id EEE813858D38 for ; Mon, 11 Dec 2023 16:02:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEE813858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EEE813858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702310542; cv=none; b=eSIwesAzK/NAojDwqairAxoSj3XfXuWxgFrrCArszSeIHXtFFNFlUIqJj1ATncL9DfpeXLuMuK7CzSc/sjLhX6raGdnFRQGJY18ph3N7FnmZrhC76y3dkDPreQLdWJCtCUoGE/XYsvWLlI1J7KSKgkanQnIpVa4BTstnzVaG/Sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702310542; c=relaxed/simple; bh=4hV5zW6wE5YkGSwv4GRcgxZBsiP2dMUBvXvx6gN7lOk=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=U6EU29nRvV7Uxony/1W7vFAvZ2ia/q3npUVK3Z+kNazzzNifHf9vUOR+G8CFuK0VYef84Eg3vUNUTnz4XEFhMBGjsyC+s5hwu5wTGCsmY3bncqS5N1yFSLMtb7x/s82sRxd3TgXJvSx40yi0S76Ogz1Z3tfDcNlnOd4EK/8/di4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7b37405f64aso190903339f.2 for ; Mon, 11 Dec 2023 08:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1702310540; x=1702915340; darn=sourceware.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=JkJviKDcuh1O96A3UvObGIedCnOdYZE5fYrsW629gNk=; b=HGXzkTOFuAC+Wef/h2dN/QUs3bkgsU3ubc3Oj+ODq2P53XdjzSHtuXEig0tnYE+mPu HYN3y7Uq34xBNXFMzyxiOZqMu9dLIJ/tfc9tTjgZAoPK5mlzL/aDPS0AJDIz+Tp+C4vR 7WymQhbPy813Hh7MkDCTfMh1/WZDwrM3JXVDpwX6uru9JHceJG85ugPJMhpBBFA4VnnE ZZb5PGeLMmLaYi3FqZCV0JkkVFDlZcgzNNx1+GTUjNgPNjHymj2WQgwGPxY5/e5KR7zx 64kbdMGUVLodBr14/jPq/n81m2vSCqzS8SKXyj+soKozlsRgUTE8Yz+frxFvcT/eGMa/ 106Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702310540; x=1702915340; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JkJviKDcuh1O96A3UvObGIedCnOdYZE5fYrsW629gNk=; b=HRkXqx8IA2yq97TMOYcMDDIWhpQBvNrhXH+h2Og8Hd78xOnnxLMc3XuprzQrCIV/8g ZFbfU82V3xFZt+P5b9Ie89yGArAj2+BXfgL0R0jtvMxfYDchLP+SRs1rmNZuVi3PidzZ vfhbOKGV4K3K5oiWi4qIrhVW7uoO3oqTlRzsB/zqwPPk0Qay7+THniAcyGn9ZhdFvp3A P3fnQ5OZerTbjSRzB1f3EqJMLCA3O9kngbAfmZotEgmcJ4W5SHsyVsKRnNfS3Lvc8cqi vQ25Ko9R2HUXNhnJCtwUiCb9ErVBlMIr1pj21+Ax1EVncn2GVeyARhhJPox65Y/W0Q5I Sp1Q== X-Gm-Message-State: AOJu0YxMb+sWVs5CI0UrTbLC75KQAgwAdblvVkJ0eqUD6uSuYCbTAw4D 8W5TLJLjjz3ZuyENXh2ctZxPcA== X-Google-Smtp-Source: AGHT+IFcLWdtG7dNWBIM3NZnDB3bQ8f4Fl215Kqi4jFliKmb4M30zXQtLycZ04ZBdRQKGDl0y2ic6g== X-Received: by 2002:a6b:ec18:0:b0:7b6:f2a7:187c with SMTP id c24-20020a6bec18000000b007b6f2a7187cmr6330153ioh.3.1702310540157; Mon, 11 Dec 2023 08:02:20 -0800 (PST) Received: from localhost.localdomain (71-211-161-25.hlrn.qwest.net. [71.211.161.25]) by smtp.gmail.com with ESMTPSA id h25-20020a02cd39000000b0042acf934cbasm1879113jaq.72.2023.12.11.08.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 08:02:19 -0800 (PST) From: Tom Tromey Subject: [PATCH v2 0/6] Implement DAP cancellation Date: Mon, 11 Dec 2023 09:02:17 -0700 Message-Id: <20231211-dap-cancel-v2-0-db7b52cf0329@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAIkyd2UC/22NMQ6DMAxFr4I811ViBmin3qNiMIkpkQpBDopaI e7ewNzxye8/b5BEgyS4Vxuo5JBCnAvQpQI38vwSDL4wkKHakrHoeUHHs5M3kqMb+db0XDdQBov KED5n7NkV7jkJ9lrk8UhMnFbRQxxDWqN+z6fZHvrffrZosG3KiQZXU8sP9uyiytXFCbp9338uo i8YvwAAAA== To: gdb-patches@sourceware.org Cc: =?utf-8?q?K=C3=A9vin_Le_Gouguec?= , Eli Zaretskii X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_ABUSEAT,RCVD_IN_DNSWL_NONE,RCVD_IN_XBL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: DAP specifies a way to cancel requests. Previously, I didn't implement this, because it didn't seem necessary. However, I realized later that a 'repl' evaluation can cause the inferior to continue (or gdb to invoke a long-running CLI or Python command), and a request like this will not finish -- cancellation is necessary. This series implements this feature. I've split it into bite-sized pieces. Tested on x86-64 Fedora 38. --- Changes in v2: - Updated documentation per review - Link to v1: https://inbox.sourceware.org/gdb-patches/20231201-dap-cancel-v1-0-872022fc328a@adacore.com --- Tom Tromey (6): Clean up handling of DAP not-stopped response Move DAP JSON reader to its own thread Introduce gdb.interrupt Rename a couple of DAP procs in the testsuite Catch KeyboardInterrupt in send_gdb_with_response Implement DAP cancellation gdb/NEWS | 5 ++ gdb/doc/gdb.texinfo | 16 ++++++ gdb/doc/python.texi | 11 ++++ gdb/python/lib/gdb/dap/server.py | 115 ++++++++++++++++++++++++++++++++++++-- gdb/python/lib/gdb/dap/startup.py | 4 +- gdb/python/python.c | 19 +++++++ gdb/testsuite/gdb.dap/pause.exp | 71 +++++++++++++++++++++++ gdb/testsuite/lib/dap-support.exp | 10 ++-- 8 files changed, 239 insertions(+), 12 deletions(-) --- base-commit: 9a099bc220fbc97e9ccff6a7e1861e11665e8899 change-id: 20231201-dap-cancel-2c292d80ba37 Best regards, -- Tom Tromey