From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id D630B388B009 for ; Mon, 4 May 2020 14:43:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D630B388B009 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-4i8BySaDOAaPfoXEnBybiA-1; Mon, 04 May 2020 10:43:24 -0400 X-MC-Unique: 4i8BySaDOAaPfoXEnBybiA-1 Received: by mail-wm1-f70.google.com with SMTP id f17so3607289wmm.5 for ; Mon, 04 May 2020 07:43:24 -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=Euvag3K+g+lkeRNkv7fccjzQKfMX1t9xV40eP7C8kwg=; b=Os92tfAX8KPCK3cczo20nH0Tvg6WCaR1AfXkLmveMCDa27ph4TN34bKh7+zdOyPGuR 9G7blmWAyBJRqQeeLmoHECSaGosygSp3+PXlQsSwWr2nA0pMKJJ2xbgMaKKVm+9ECtpj Dr2hU0VX+LvahOqYozcYnyPpYz5P6rqjtDXlAvrBXI7sA0XTi6QENf2ogZ8a14YiwxXW 6OLGSKb4+ON7ddREJ0SCYx1ko7oGljhxnOCHzM0TE4YhmSrUXjrvunyC1WBLQ8vrljaX THl7TCmjd3RwUbROm7rr8lWtzJ2ssU3KGlsZFJL0pmh4Q1ErIjJeTCK9ndcH+L2kX2n7 0Rfw== X-Gm-Message-State: AGi0PuYwUQz8wV8TzRXQjOVWRFLDg8/jATmOPXg/4ZYfaHWRUeTq0y1H 5VFkDQmYniIrw8mIyWJ6HbpX7dnR8gAZwpyqp7hxpMKI6amdieLV7nmPcQfbMDAdJor+hQzQ22Q 3Xx4M60IGO2voYFFEJUXwVw== X-Received: by 2002:a7b:c08b:: with SMTP id r11mr5302241wmh.45.1588603403212; Mon, 04 May 2020 07:43:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJ98lcjiwjPvI8oudBaP1Ib4T4q3yrl1h2PKF7i3CI2AVU62hCiMVhS5dIwznN5htABu38Xnw== X-Received: by 2002:a7b:c08b:: with SMTP id r11mr5302226wmh.45.1588603403005; Mon, 04 May 2020 07:43:23 -0700 (PDT) Received: from ?IPv6:2001:8a0:f909:7b00:2327:23ca:3e56:ef5f? ([2001:8a0:f909:7b00:2327:23ca:3e56:ef5f]) by smtp.gmail.com with ESMTPSA id f63sm13593393wma.47.2020.05.04.07.43.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2020 07:43:22 -0700 (PDT) Subject: Re: [PATCH v7 3/5] gdb/remote: do not delete a thread if it has a pending exit event To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: From: Pedro Alves Message-ID: Date: Mon, 4 May 2020 15:43:20 +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=-21.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, 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: Mon, 04 May 2020 14:43:32 -0000 Tankut, I'm trying to get back to this, and I would like to apply the whole series locally, but I'm afraid that I'm having trouble piecing the series together. Do you have a public branch where you have all the patches in the series applied? You could push it under users/ on sourceware.org for example. Thanks, Pedro Alves On 4/22/20 4:00 PM, Tankut Baris Aktemur via Gdb-patches wrote: > gdb/ChangeLog: > 2020-04-06 Tankut Baris Aktemur > > * remote.c (remote_target::update_thread_list): Do not delete > a thread if it has a pending exit event. > --- > gdb/remote.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/gdb/remote.c b/gdb/remote.c > index 5db406e045c..a1fbaa02fb1 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -3822,6 +3822,14 @@ remote_target::update_thread_list () > if (tp->inf->process_target () != this) > continue; > > + /* Do not remove the thread if it has a pending exit event. > + Otherwise we may end up with a seemingly live inferior > + (i.e. pid != 0) that has no threads. */ > + if (tp->suspend.waitstatus_pending_p > + && (tp->suspend.waitstatus.kind == TARGET_WAITKIND_SIGNALLED > + || tp->suspend.waitstatus.kind == TARGET_WAITKIND_EXITED)) > + continue; > + > if (!context.contains_thread (tp->ptid)) > { > /* Not found. */ >