From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id C63083858415 for ; Fri, 1 Dec 2023 15:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C63083858415 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C63083858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701446177; cv=none; b=DvpARz9NsxxCFk2h8QDZ4oYuvL9j6XLm4QOl++k48xYKWdj3dUL7eUQCAb8wveDN2v4uC2VMvZRjXNSjE/rDLGi01qOWjPHlSDeJwjARzbmMm6Ad/QfPxdnJUBFuqrjsnSN7b2a9SvaFzujLMg6R4Mde6Pc9uiL9/ARxAaNDAps= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701446177; c=relaxed/simple; bh=Yi3ML9CFXWpUalB1U9Q/rpcz+2FKOnOFXqsh79FZ2YM=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=OcVa3+IH+lyCnz6TYZRLmLEtxw1MXcQI20xARIqqGSGjSR8kLITIhp7RmleRp4itth3MRj+v10kEg9t+tfl7jm5b0pluFFVpCENR3YBRXDBUMG/dTpkTFBEP58NoLxgW+/vP5wwAX7ZKOkkIf8Ka8CHN33h4LK83RjRoigubUy0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r95sF-00060v-CJ; Fri, 01 Dec 2023 10:56:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=8/VHyMX8B44871FgO8dzF7XZOOzTXPbJrl5M0r80/hg=; b=pjMbiQKaV/fM 2ITg3QC8dLKtCzI+aYgsj08/SoP539YQNeToWsGZ23JpPlDhoqK4K9fMj/IX6o6n2nqyL+N9m9WoE l8MeraTP8IoGRWO1WGJ+U3qKUctoa5qq/D2mXHcsqNIkR8MJhpA0UEzuTFSN303iO3KMA6AKgZOPe P8Y/38YB7rjkMgq2gZ+UjKjmOzQcFdDCHnyqVZSIGR9aH1btx2/IfpkvUebbMEP4CTTL5oO/dwchq GgiPVzAYkKylbYZRCDB8VDqqwkwYpLfY3LaAtqzgApwVbVDx08+q2xrCTWScqjCB7SiELkCLWRqF/ KZdXB7HMxRd8mYnJta700g==; Date: Fri, 01 Dec 2023 17:56:08 +0200 Message-Id: <83edg5apd3.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: gdb-patches@sourceware.org In-Reply-To: <20231201-dap-cancel-v1-3-872022fc328a@adacore.com> (message from Tom Tromey on Fri, 01 Dec 2023 08:40:59 -0700) Subject: Re: [PATCH 3/6] Introduce gdb.interrupt References: <20231201-dap-cancel-v1-0-872022fc328a@adacore.com> <20231201-dap-cancel-v1-3-872022fc328a@adacore.com> X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > From: Tom Tromey > Date: Fri, 01 Dec 2023 08:40:59 -0700 > > DAP cancellation needs a way to interrupt whatever is happening on > gdb's main thread -- whether that is the inferior, a gdb CLI command, > or Python code. > > This patch adds a new gdb.interrupt() function for this purpose. It > simply sets the quit flag and lets gdb do the rest. Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index 1073e38dfc6..0c44f0253f6 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -57,6 +57,8 @@ show remote thread-options-packet > sub-classed to create handlers for objfiles with missing debug > information. > > + ** New function gdb.interrupt(), that interrupts GDB's main thread. > + > * New remote packets Do we have to mention the main thread? Why not say just that it interrupts GDB as Ctrl-C keypress would? > +@defun gdb.interrupt () > +This causes the main thread of @value{GDBN} to react as if the user > +had typed a control-C character at the terminal. Same here: I would avoid talking about the GDB's main thread, as I think it just muddies the waters, and could really confuse someone who doesn't have a good mental picture of what threads in general and the main thread in particular do in GDB. Reviewed-By: Eli Zaretskii