From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689019486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KgPJDgHV4tQFJCaUHRwXZBOu5Rq+SfBPOQdD/m24f0o=; b=JVwRbGzxeT6JSA+83s5OB835hwg/fajvirhCmSXe043VTruDhK1mb3JehcpkI4EGYmQ5+i FPVi67+uDsuFiyqoz7AKKgg0iRXQHYaq9Gn+mOd7Yo1xBsYklLpgoUw/Be0lBkIuW5/vaD Yr//8YoSpInsbyNh7Gotdl4bQoYx4RA= 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) From: Andrew Burgess 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 List-Id: 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