From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96918 invoked by alias); 7 Jun 2017 22:05:26 -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 96048 invoked by uid 89); 7 Jun 2017 22:05:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy= X-HELO: mail-wm0-f47.google.com Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Jun 2017 22:05:24 +0000 Received: by mail-wm0-f47.google.com with SMTP id m7so35240132wmg.0 for ; Wed, 07 Jun 2017 15:05:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6IIqCxCdg7W1Zn25HyZwFf2ct+mJ7QmKFIkzVskQscg=; b=i/h+ivPhs0M7PcDAwPQj3w3gFcElVeeS8RiCCofC5dgfJ25+EzA2TncIKTsdsdugE4 mLbQMv0OFfOkvcfgTSnPp5YnIQryQqxA35tOco/ACfK2R2c6cR6fTfqbuLkNT4K6GFYF rXvjo0ggJRbdAa2Znh5+ovt6mFrnt/66AKR21dWNjRBaVYG8GcnSu4YUisywT+5idfw8 XVZC2vMqAeYGbwoUP+szJgv/fAEoysdngEtsEfCJoTMLgJeAzn/3OkTyNyGU5mVpJOFk JwLTPgnhv1+AEgnoJDJ23qwKg5f1YhJAN82/HHgYkbujq25xv9Tol43Ff2MDSB62wBgg 6qbg== X-Gm-Message-State: AKS2vOyAlRv8bhBpzjT8Myyr9y7jWLbX3CIwKr7KXwjblmmSwGBXs3Eg 1l3exRERdCmk+Qeig5wA3g== X-Received: by 10.28.93.10 with SMTP id r10mr1168748wmb.68.1496873126033; Wed, 07 Jun 2017 15:05:26 -0700 (PDT) Received: from [192.168.0.102] ([37.189.166.198]) by smtp.gmail.com with ESMTPSA id q77sm3461454wmd.31.2017.06.07.15.05.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2017 15:05:24 -0700 (PDT) Subject: Re: [PATCH v7 3/4] Share fork_inferior et al with gdbserver To: Sergio Durigan Junior 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> Cc: GDB Patches From: Pedro Alves Message-ID: Date: Wed, 07 Jun 2017 22:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87o9tzmq6o.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-06/txt/msg00182.txt.bz2 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. Thanks, Pedro Alves