From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WFB9AnZkrGThER0AWB0awg (envelope-from ) for ; Mon, 10 Jul 2023 16:05:10 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=j6yg1niD; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 065A91E0BD; Mon, 10 Jul 2023 16:05:10 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 simark.ca (Postfix) with ESMTPS id E22521E0AC for ; Mon, 10 Jul 2023 16:05:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E52138582BD for ; Mon, 10 Jul 2023 20:05:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E52138582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689019507; bh=KgPJDgHV4tQFJCaUHRwXZBOu5Rq+SfBPOQdD/m24f0o=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=j6yg1niDrIGGBW0EztDwEW4Wk8azCydSx8V8Cr+zTw+TAmVndv6CyHd20Y5kaPn/h RZv6dv5rG4+y4YRxQSrfiDLS/bIe+eIIBoVSIhqPupkMtxsMk/t4AXmqrDsUy6O9nP XTwTiNG9GvPPe2GdWtG+zBK++BqL46yeu+bUKhEk= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.145.221.124]) by sourceware.org (Postfix) with ESMTPS id 30A003858CDA for ; Mon, 10 Jul 2023 20:04:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30A003858CDA Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-GIGz04YyOJyDxStTpj1IsQ-1; Mon, 10 Jul 2023 16:04:44 -0400 X-MC-Unique: GIGz04YyOJyDxStTpj1IsQ-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3fbdd5d09b8so33327775e9.1 for ; Mon, 10 Jul 2023 13:04:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689019483; x=1691611483; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KgPJDgHV4tQFJCaUHRwXZBOu5Rq+SfBPOQdD/m24f0o=; b=iH1V9rFDa4Tu6UpSx0iqpvsX30Zl4aGjBq6y6AkAmEI22dkHBc/8yTyWnxBWaO1lr2 qbYaWocV4kc5zPY3gFz+KtBmqCY39EQBOUObGaqHU8LWOmxE+igc+yhcLDIGN+i9C6JT 7aorHY9LvBMHhD1TmkKsG6QFWIBHZwiUOv1E551vwFj5cF9KkMWpedT8Ezk0jMcawB0p BuXyaXt1y7PB20KFH5M6LezdYe6EZb8yijez9mtR+36I9tJLL7YGPQIN7W+UDUcoe6vM zh/6LHZkPgjA/uX9Y2mPivp8LdnwIyIqSecsbtA+7KV9Trh1C3MSYp816AD4wR2fSkQc GORQ== X-Gm-Message-State: ABy/qLaznKFKX+gHU9pU2AS6zQFiy0/ZKThFsCDZJahlEgNBBosdiSDs Gh8/xfN1i284YTTUGbUzF7a8qZmV1amJ/tFMrwY/UCC5UjICI9gijiL6dGp5HmPIYA2pa2m2oyi srI7CZK1Z8+uTwhlMT5aoGHzwE9OG/g== X-Received: by 2002:a05:600c:2246:b0:3fa:8fc2:3969 with SMTP id a6-20020a05600c224600b003fa8fc23969mr12662660wmm.17.1689019483467; Mon, 10 Jul 2023 13:04:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlEVAzI9NO/MMMnKqAVKpYis/bjogOOmu0yQErb6HnNlo8Jq26VCSWTZQ8EZ/vy3jka4pqjfLQ== X-Received: by 2002:a05:600c:2246:b0:3fa:8fc2:3969 with SMTP id a6-20020a05600c224600b003fa8fc23969mr12662644wmm.17.1689019483099; Mon, 10 Jul 2023 13:04:43 -0700 (PDT) Received: from localhost (2.72.115.87.dyn.plus.net. [87.115.72.2]) by smtp.gmail.com with ESMTPSA id 16-20020a05600c029000b003fc04d13242sm8141178wmk.0.2023.07.10.13.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 13:04:42 -0700 (PDT) To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCHv8 4/6] gdb/remote: avoid SIGINT after calling remote_target::stop In-Reply-To: <0db81ff7-c2ca-0cf2-cd3a-6bb9704303f2@palves.net> References: <0d839e4d9288c80fb4cba0b7f02ea6fd52b20fc6.1686131880.git.aburgess@redhat.com> <0db81ff7-c2ca-0cf2-cd3a-6bb9704303f2@palves.net> Date: Mon, 10 Jul 2023 21:04:41 +0100 Message-ID: <87wmz7ild2.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Pedro Alves writes: > (I'll go back to reviewing the other patches in the series, but I wanted to > reply to this one immediately.) > > I think this patch is just incorrect, design wise, and we should not merge it. > > There is absolutely no connection between any selected thread in GDB to the > thread that eventually reports the SIGINT, because the \x03 packet carries no > thread context. So GDB could ask for target_stop({pid=123, lwpid=999}), and > if we end up sending \x03, the thread that gets the SIGINT could be > say, {pid=123, lwpid=123}, or even {pid=666, lwpid=666}. > > On Windows, both GenerateConsoleCtrlEvent and DebugBreakProcess (the functions > used by win32_process_target::request_interrupt()) inject a new thread > in the inferior and has _thread_ thread report the event. So the thread that > reports the interrupt is completely unknown to GDB at the time the \x03 is sent. > > Also, there's even no guarantee that you'll get a SIGINT instead of some > other signal. On Windows, DebugBreakProcess results in SIGTRAP. > > We should just not assume that target_stop with an all-stop backend is able > to stop a specific thread. Thanks for the feedback. Andrew