From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26901 invoked by alias); 7 Jun 2017 22:08:55 -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 26879 invoked by uid 89); 7 Jun 2017 22:08:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 07 Jun 2017 22:08:53 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 740AD3D974 for ; Wed, 7 Jun 2017 22:08:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 740AD3D974 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sergiodj@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 740AD3D974 Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B3E67D967; Wed, 7 Jun 2017 22:08:56 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches Subject: Re: [PATCH v7 3/4] Share fork_inferior et al with gdbserver References: <1482464361-4068-1-git-send-email-sergiodj@redhat.com> <20170604221803.17649-1-sergiodj@redhat.com> <20170604221803.17649-4-sergiodj@redhat.com> <2e012ef6-587b-5883-0626-9f6dbb33d60f@redhat.com> <87o9tzo6cr.fsf@redhat.com> <87o9tzmq6o.fsf@redhat.com> Date: Wed, 07 Jun 2017 22:08:00 -0000 In-Reply-To: (Pedro Alves's message of "Wed, 7 Jun 2017 23:05:23 +0100") Message-ID: <87k24nmow8.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00183.txt.bz2 On Wednesday, June 07 2017, Pedro Alves wrote: > On 06/07/2017 10:41 PM, Sergio Durigan Junior wrote: >> On Wednesday, June 07 2017, I wrote: >> >>> On Wednesday, June 07 2017, Pedro Alves wrote: >>>> I think we could get rid of the new common-inferior.h >>>> header too, but I'll leave that as is, for now at least. >>> >>> And move get_exec_{wrapper,file} to fork-inferior.h and fork-child.c, >>> you mean? >> >> Probably not, because get_exec_file is used by Windows targets as well. >> I'll wait for your reply before submitting the next patch. >> > > Considering exec_file for instance: fork_inferior calls > get_exec_file if exec_file is NULL. But, we could just > pass down the right exec_file to fork_inferior in the first > place. We could do that by e.g., adding fork_child > wrapper functions to both gdb and gdbserver's fork-child.c that > would call the shared fork_inferior function, and then adjust > targets to call that instead. For the exec wrapper, we could > add a new "const char *exec_wrapper" parameter to fork_inferior. > > Since it's arguable which approach is better in this case, > I'm totally fine with leaving things as is. > > I notice now that get_exec_file is still declared > in gdbcore.h, however. OK, I'll leave things as is then, and will tackle this problem at a later date. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/