From patchwork Wed Jul 4 17:34:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 28238 Received: (qmail 25938 invoked by alias); 4 Jul 2018 17:34:38 -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 25927 invoked by uid 89); 4 Jul 2018 17:34:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.89) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jul 2018 17:34:35 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway21.websitewelcome.com (Postfix) with ESMTP id AD0E9400C862D for ; Wed, 4 Jul 2018 12:34:34 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id alfmfPy0DSjJAalfmfukBX; Wed, 04 Jul 2018 12:34:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LfzhpfW9e0G8zjEpPC57Jr9lRVZ/WqzZmvUWU/iYtHE=; b=W+8fG0drIsi1fmdHNTaT7l6XS5 P8lepElIXuBOQBDcnVsVFa5E+MS039GhQiltmW+hNzuc2F6cszqo/Vla+x2+zdr+jGNPmc0+Muw2h LPlkMJBS3Nh53V/d+XvebzRo+; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:53730 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1falfm-001Lgu-Dg; Wed, 04 Jul 2018 12:34:34 -0500 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA] Fix crash in "run" on macOS when gdb is not signed References: <20180628180257.29883-1-tom@tromey.com> <1d40e422-08f4-30c1-de10-bd63396acb0b@redhat.com> <87o9fpodos.fsf@tromey.com> <38028d2f-ba08-fd36-6d5f-6a47455e5ccf@redhat.com> <0f00199a-cb50-83e0-f0ed-6704fecd76b8@redhat.com> Date: Wed, 04 Jul 2018 11:34:33 -0600 In-Reply-To: <0f00199a-cb50-83e0-f0ed-6704fecd76b8@redhat.com> (Pedro Alves's message of "Wed, 4 Jul 2018 12:46:31 +0100") Message-ID: <871sciq506.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 >>>>> "Pedro" == Pedro Alves writes: Pedro> Hi Tom, I happened to notice that you pushed the wrong version of Pedro> the patch. Oops, sorry about that. I'm checking in the appended. Tom commit a7d0f0f000b39269c25509a22a12549c6ef26b1f Author: Tom Tromey Date: Wed Jul 4 11:32:50 2018 -0600 Use exit_inferior in darwin_attach_pid Commit a50c11c666 was intended to use exit_inferior in darwin_attach_pid, but I accidentally pushed the wrong version of the patch. This fixes the problem. gdb/ChangeLog 2018-07-04 Tom Tromey * darwin-nat.c (darwin_attach_pid): Use exit_inferior. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d2319c06d52..7bd0cc4f95e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-07-04 Tom Tromey + + * darwin-nat.c (darwin_attach_pid): Use exit_inferior. + 2018-07-04 Simon Marchi * common/common-defs.h (HAVE_USEFUL_SBRK): Define. diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 8104de53e7f..5aed285ad46 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1662,8 +1662,7 @@ darwin_attach_pid (struct inferior *inf) } CATCH (ex, RETURN_MASK_ALL) { - inf->pid = 0; - inf->priv.reset (); + exit_inferior (inf); inferior_ptid = null_ptid; throw_exception (ex);