From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75881 invoked by alias); 15 Sep 2016 15:51:54 -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 75853 invoked by uid 89); 15 Sep 2016 15:51:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1663, Consolidate, mourned, our 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, 15 Sep 2016 15:51:52 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 96A517F77D for ; Thu, 15 Sep 2016 15:51:51 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8FFpoGS022085; Thu, 15 Sep 2016 11:51:50 -0400 Subject: Re: [PATCH] Consolidate target_mourn_inferior between GDB and gdbserver To: Sergio Durigan Junior , GDB Patches References: <1473655918-2101-1-git-send-email-sergiodj@redhat.com> From: Pedro Alves Message-ID: Date: Thu, 15 Sep 2016 15:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1473655918-2101-1-git-send-email-sergiodj@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-09/txt/msg00161.txt.bz2 On 09/12/2016 05:51 AM, Sergio Durigan Junior wrote: > This patch consolidates the API of target_mourn_inferior between GDB > and gdbserver, in my continuing efforts to make sharing the > fork_inferior function possible between both. > > GDB's version of the function did not care about the inferior's ptid > being mourned, but gdbserver's needed to know this information. Since > it actually makes sense to pass the ptid as an argument, instead of > depending on a global value directly (which GDB's version did), I > decided to make the generic API to accept it. I then went on and > extended all calls being made on GDB to include a ptid argument (which > ended up being inferior_ptid most of the times, anyway), and now we > have a more sane interface. > > On GDB's side, after talking to Pedro a bit about it, we decided that > just an assertion to make sure that the ptid being passed is equal to > inferior_ptid would be enough for now, on the GDB side. We can remove > the assertion and perform more operations later if we ever pass > anything different than inferior_ptid. > > Regression tested on our BuildBot, everything OK. > Thanks, patch is OK. > I'd appreciate a special look at gdb/windows-nat.c's modification > because I wasn't really sure what to do there. It seemed to me that > maybe I should build a ptid out of the process information there, but > then I am almost sure the assertion on GDB's side would trigger. Just leave it passing inferior_ptid like all other places, which is a no-op. We're certain the assertion does not fail this way. Thanks, Pedro Alves