From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id B0707395BC0E for ; Thu, 14 May 2020 11:25:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B0707395BC0E Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-9-1Olxm0BrOdCerwZ8EG-WGw-1; Thu, 14 May 2020 07:25:52 -0400 X-MC-Unique: 1Olxm0BrOdCerwZ8EG-WGw-1 Received: by mail-wm1-f71.google.com with SMTP id v23so8412374wmj.0 for ; Thu, 14 May 2020 04:25:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c+VmP5sg0AztBzrxPhsEOsn9hEJa59xet6wpWcpaWWI=; b=mMdMes4iroZofNYTjOsyDs8ha0Wfn9yDEhN88zd8JOUHwrK/HxZlRAsHrnA7jFxayW FK85m15pnrxCf4c6ucb5R0R+G9q2zo1psepjgrVsshgBq5P/GFdIHjV/l/JuUiLpNM5l OKcL0GBml5NXRuMH8+GF8akOl9ufHRqFFxw4UJpWnXLh+N3pREKCmUHfatqqVX+zbG5N gFYWrb1zFTYWDidXa5zDPSkEevNCueH0ooEco0L7TEHSwkjn4YLU/SHA8/A4OCibCqdJ k2YrckOKCwhI/JxrJzqdqk12gGRBuUIC8hI0UGF8+3SZeOZFiE51OWVHIzD08OPMjRuw K2dQ== X-Gm-Message-State: AOAM533JHL1Q9AsIgy13oyzEHd3xQWAJRHnTD2Xwj7DLXxf8jeBNcJm3 iZPo0HSC33mcENtjNYFenBUZ2uPR7cmkAQB6zF5C6e8ARsG+KxxJTT7MdXNBDtaBgidxs4GWb8S v2rfUj61Z1bCmeanUaEuwpA== X-Received: by 2002:a1c:7407:: with SMTP id p7mr11664711wmc.114.1589455551354; Thu, 14 May 2020 04:25:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPX+ANrwvhKZ2+hiYT2yVLD5UAnhZPnz0IXEjhhh3oEFJr75Z1hiswXJUHPUdYMy+ibWWXCA== X-Received: by 2002:a1c:7407:: with SMTP id p7mr11664703wmc.114.1589455551202; Thu, 14 May 2020 04:25:51 -0700 (PDT) Received: from ?IPv6:2001:8a0:f909:7b00:56ee:75ff:fe8d:232b? ([2001:8a0:f909:7b00:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id q144sm7589219wme.0.2020.05.14.04.25.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 04:25:50 -0700 (PDT) Subject: Re: [PATCH v7 5/5] gdb/infrun: handle already-exited threads when attempting to stop To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: From: Pedro Alves Message-ID: <4e9a3338-528e-2e3f-294b-561a8556acf7@redhat.com> Date: Thu, 14 May 2020 12:25:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , X-List-Received-Date: Thu, 14 May 2020 11:25:55 -0000 On 5/13/20 10:15 PM, Pedro Alves via Gdb-patches wrote: > After giving it some thought and experimentation, I think we should > go back to your idea of not deleting the last thread of the process. There's one point that I forgot to mention about the benefit of this approach, which I should mention for the archives. The current use case we're handling deals with the update_thread_list call from within stop_all_threads. However, update_thread_list calls can happen at any point while the inferior is running. Say, in non-stop mode or async background mode, and the user types "info threads". At that point, an inferior may have exited, and GDB finds no threads for the process, before the inferior exit event is seen. If that happens, then the user is not able to switch to that inferior any longer in order to collect the process exit. The solution in v8 handles this scenario too, while the "don't delete if pending event" solution only handled the stop_all_threads scenario. Thanks, Pedro Alves