From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30465 invoked by alias); 12 Feb 2014 20:22:18 -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 30454 invoked by uid 89); 12 Feb 2014 20:22:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f182.google.com Received: from mail-ve0-f182.google.com (HELO mail-ve0-f182.google.com) (209.85.128.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 12 Feb 2014 20:22:16 +0000 Received: by mail-ve0-f182.google.com with SMTP id jy13so7693268veb.41 for ; Wed, 12 Feb 2014 12:22:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=azVf630v4HiTOqmqefPzmNvyS7d1bW2jeBMxYc09gb4=; b=FISoFlrbcKdPirJ6zc2YKjhwP31nUue7Wsv4fPsDkcrNPqBuqHEMcAh+p7HlQMCBGd ae6xI8Ty3ifzIMJ0bRtdt7eqa9gkOgbCkR3fRJbYaamr+VoN7/S/egK/zwsoYnauECy7 d5ZwDFhtnZ6navZjfEz+j0fu8w9M7mPbJh5DjCLDS02n21IcXbz9wpz4PYG+TnZt7Ner fX1rvr8S6YxIQMFAKrUPlFyBdRycPmKAGu1nTefGdsCnuknBp3LAgwSFa1oyHsZ0y724 LmFm5u/KQTfUiZFswKdu+7MRIp1cNFsBQL99rI5o2La5ad7vZxrroIs7yKF7x9yIkW8m yhRg== X-Gm-Message-State: ALoCoQmT9gEw2MIqHfDVyGz4NGcxyV1wQYzsGQptPKNcOdcHQyGT0HDc+YLeecMsUH8o0H0sc7fxHxArvf+mV4+HHXa/H3DacqdOU7dTSDXo9bJnfxiYvGbZ+RLzgg4WXKid0g5GRpiSI2ZtLt5ALQzvo6TwczPRuEw4apwJwYrZnMxPEmAmUIT1ZXMqzcjGBS4yJwv8U3SGAeAuNJiP9sgZTsXmww+Kwg== MIME-Version: 1.0 X-Received: by 10.52.230.105 with SMTP id sx9mr28999677vdc.10.1392236534729; Wed, 12 Feb 2014 12:22:14 -0800 (PST) Received: by 10.52.51.234 with HTTP; Wed, 12 Feb 2014 12:22:14 -0800 (PST) In-Reply-To: <87ha84t88v.fsf@fleche.redhat.com> References: <1391720136-2121-1-git-send-email-tromey@redhat.com> <1391720136-2121-2-git-send-email-tromey@redhat.com> <87ha84t88v.fsf@fleche.redhat.com> Date: Wed, 12 Feb 2014 20:22:00 -0000 Message-ID: Subject: Re: [RFC v2 01/38] add "this" pointers to more target APIs From: Doug Evans To: Tom Tromey Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00439.txt.bz2 On Wed, Feb 12, 2014 at 11:56 AM, Tom Tromey wrote: > Doug> As an example (just in case there's some confusion), > Doug> one thing I'm thinking about is global state used by targets. > Doug> If, for example, we support multiple remote connections then we're > Doug> going to have multiple open sockets/descriptors and IWBN if the > Doug> target_ops methods fetched such things from "self" instead of global > Doug> variables (*1). >[...] > My plan is outlined on the multi-target wiki page and on the patches on > the corresponding branch. The wiki page is here: > > https://sourceware.org/gdb/wiki/MultiTarget > > Basically the question is whether it is better to turn target_ops into a > real vtable and separate the vtable bits from the state bits. I think > this is undeniably cleaner. > > One concrete benefit of the cleanliness aspect is that it exposes the > API difficulties around to_open; namely that we need to properly > instantiate target objects in spots like find_default_run_target. This > is not properly handled on the branch. > > But, as I said, it is more typing to do this conversion, especially as > I'll now have to redo it, which is somewhat demotivating. Not to > mention that this would be another sub-series requiring unusual amounts > of testing, as it touches code everywhere. And, it isn't strictly > necessary, as to_data can be used. And, if I were to do it again, I'd > probably do it a bit differently. So I'm not sure. Ah, so this series is just an interim step, and a follow-up will replace "struct target_ops *self" with "struct foo *self" with foo containing "struct target_ops *". Thanks for the clarification.