From patchwork Thu Jan 23 20:59:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37520 Received: (qmail 78367 invoked by alias); 23 Jan 2020 20:59:14 -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 78359 invoked by uid 89); 23 Jan 2020 20:59:14 -0000 Authentication-Results: sourceware.org; auth=none 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, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jan 2020 20:59:13 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 88FC11166C8; Thu, 23 Jan 2020 15:59:11 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7aE5gPZP4iue; Thu, 23 Jan 2020 15:59:11 -0500 (EST) Received: from murgatroyd.us.adacore.com (unknown [IPv6:2620:20:4000:100::1003]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 2FBFF1163BD; Thu, 23 Jan 2020 15:59:11 -0500 (EST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix ravenscar-thread.c for multi-target Date: Thu, 23 Jan 2020 13:59:09 -0700 Message-Id: <20200123205909.30663-1-tromey@adacore.com> MIME-Version: 1.0 ravenscar-thread.c needed a change to adapt to multi-target: ravenscar_thread_target::mourn_inferior called the mourn_inferior method on the target beneat -- but when the target beneath was the remote target, this resulted in the ravenscar target being deleted. Switching the order of the calls to unpush_target and the beneath's mourn_inferior fixes this problem. gdb/ChangeLog 2020-01-23 Tom Tromey * ravenscar-thread.c (ravenscar_thread_target::mourn_inferior): Call beneath target's mourn_inferior after unpushing. Change-Id: Ia80380515c403adc40505a6b3420c9cb35754370 --- gdb/ChangeLog | 5 +++++ gdb/ravenscar-thread.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 5d24c59e996..fd3beb03ec3 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -515,8 +515,9 @@ void ravenscar_thread_target::mourn_inferior () { m_base_ptid = null_ptid; - beneath ()->mourn_inferior (); + target_ops *beneath = this->beneath (); unpush_target (this); + beneath->mourn_inferior (); } /* Implement the to_core_of_thread target_ops "method". */