From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38024 invoked by alias); 18 Jan 2018 17:06:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 37995 invoked by uid 89); 18 Jan 2018 17:06:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=disappears, opportunity 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; Thu, 18 Jan 2018 17:06:47 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 293747853E; Thu, 18 Jan 2018 17:06:46 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88BD8413A; Thu, 18 Jan 2018 17:06:45 +0000 (UTC) Subject: Re: [PATCH 3/3] Make linux_nat_detach/thread_db_detach use the inferior parameter To: Simon Marchi , gdb-patches@sourceware.org References: <1514699454-18587-1-git-send-email-simon.marchi@ericsson.com> <1514699454-18587-3-git-send-email-simon.marchi@ericsson.com> From: Pedro Alves Message-ID: Date: Thu, 18 Jan 2018 17:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1514699454-18587-3-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-01/txt/msg00377.txt.bz2 On 12/31/2017 05:50 AM, Simon Marchi wrote: > This patch makes these two functions actually use the inferior parameter > added by the previous patch, instead of reading inferior_ptid. I chose > these two, because they are the one actually used when I detach on my > GNU/Linux system, so they were easy to test. > > I took the opportunity to pass the inferior being detached to > inf_ptrace_detach_success, so it could use it too. From there, it made > sense to add an overload of detach_inferior that takes the inferior > directly rather than the pid, to avoid having to pass inf->pid only for > the callee to look up the inferior structure by pid. Looks fine to me. (FWIW, the 'detach_inferior(int)' overload disappears in my multi-target branch). Thanks, Pedro Alves