From patchwork Wed Apr 19 12:20:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 20092 Received: (qmail 120704 invoked by alias); 19 Apr 2017 12:20:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 120463 invoked by uid 89); 19 Apr 2017 12:20:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Apr 2017 12:20:33 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4937665D0D; Wed, 19 Apr 2017 12:20:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4937665D0D Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4937665D0D Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3A9280F7F; Wed, 19 Apr 2017 12:20:33 +0000 (UTC) Subject: Re: [PATCH 8/8] Fix removing inferiors from within "thread apply" commands To: Yao Qi References: <1491954673-29172-1-git-send-email-palves@redhat.com> <1491954673-29172-9-git-send-email-palves@redhat.com> <86o9w08ru5.fsf@gmail.com> <3e492ba6-f183-cc41-6b5c-cc23a6ed116a@redhat.com> <86o9vsajrj.fsf@gmail.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Wed, 19 Apr 2017 13:20:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: On 04/19/2017 01:15 PM, Pedro Alves wrote: >>> -struct thread_info >>> >> +/* Threads are intrusively refcounted objects. Being the >>> >> + user-selected thread is normally considered an implicit strong >>> >> + reference and is thus not accounted in the refcount, unlike >>> >> + inferior objects. This is necessary, because there's no "current >>> >> + thread" pointer. Instead the current thread is inferred from the >>> >> + inferior_ptid global. However, when GDB needs to remember the >>> >> + selected thread to later restore it, GDB bumps the thread object's >>> >> + refcount, to prevent something deleting the thread object before >>> >> + reverting back (e.g., due to a "kill" command. If the thread >> > >> > Missing ")"? > Yes, I'll add it. (bah, looks like I forgot to refresh the patch > before pushing. I'll really fix it in a follow up). Like so. Pushed. From a6c21d4a553de184562fd8409a5bcd3f2cc2561a Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 19 Apr 2017 13:16:05 +0100 Subject: [PATCH] gdbthread.h: Fix comment typo gdb/ChangeLog: 2017-04-19 Pedro Alves * gdbthread.h (thread): Add missing closing parenthesis in comment. --- gdb/ChangeLog | 5 +++++ gdb/gdbthread.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e260896..b30e63f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2017-04-19 Pedro Alves + * gdbthread.h (thread): Add missing closing parenthesis in + comment. + +2017-04-19 Pedro Alves + * common/refcounted-object.h: New file. * gdbthread.h: Include "common/refcounted-object.h". (thread_info): Inherit from refcounted_object and add comments. diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 33977ee..68427e9 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -186,7 +186,7 @@ typedef VEC (value_ptr) value_vec; inferior_ptid global. However, when GDB needs to remember the selected thread to later restore it, GDB bumps the thread object's refcount, to prevent something deleting the thread object before - reverting back (e.g., due to a "kill" command. If the thread + reverting back (e.g., due to a "kill" command). If the thread meanwhile exits before being re-selected, then the thread object is left listed in the thread list, but marked with state THREAD_EXITED. (See make_cleanup_restore_current_thread and