From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by sourceware.org (Postfix) with ESMTPS id 7630B3858D37 for ; Tue, 30 Jun 2020 22:14:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7630B3858D37 Received: by mail-ed1-x542.google.com with SMTP id dm19so11480626edb.13 for ; Tue, 30 Jun 2020 15:14:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CKwzVGDNkUDLW4BQIb+2QfQmnkg1eYN9ky/yM1CLiKM=; b=aYUEnAJoUZdqLxHTVjDp237dxEtYP3dpj6JP7J+Gwap65YKF7v1rZGcQuMGWnyXIue Ir+48Dsfel4tTnwNnTFhVt7x95zEVjw+Q4YdbD3MhkNM6JNaW/TJU6+a6UC8qNyWmyoS o/mu+IglMCE8APCOj0NZFxOC/f+vLqKaqOdtlF6lb/xjUjCfDsXe+ISUwrrv14uxvlta 5tukVIbE5TSMRjXzEfra9MjG96km5T9qbtaE28gw8M9OT/Jj3bH1SnIRkZgfC5QMuy06 0AAipLN9REEznizeftmBxDxLfCii7o5yn/nLMWyfhw0H5HvfZIcIz39DrHm1jK2qQZac MxtA== X-Gm-Message-State: AOAM5308TzHv4TqGeST/M/fdOHfpbNWS89urIjBg+NLN915UtBBKc738 FOs9Htu5sHhh39fUpdDne5WChn1HqbUbDRqI2/RuVg== X-Google-Smtp-Source: ABdhPJyEag1+McvxAt19NNqtkXYCAKfsDdg+WUO2A89qasZdQl2gI+/3DZ2vjL6bX/VuS5BB8EUiSlF2ZMgiEkgqOmk= X-Received: by 2002:a50:e14e:: with SMTP id i14mr24382117edl.279.1593555259618; Tue, 30 Jun 2020 15:14:19 -0700 (PDT) MIME-Version: 1.0 References: <20200628165628.96730-1-simon.marchi@polymtl.ca> <20200628165628.96730-2-simon.marchi@polymtl.ca> <87zh8k8emo.fsf@tromey.com> In-Reply-To: <87zh8k8emo.fsf@tromey.com> From: Matt Rice Date: Tue, 30 Jun 2020 22:14:07 +0000 Message-ID: Subject: Re: [PATCH 1/3] gdb: remove callback in macro expand functions To: Tom Tromey Cc: Simon Marchi via Gdb-patches , Simon Marchi Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2020 22:14:21 -0000 On Tue, Jun 30, 2020 at 8:47 PM Tom Tromey wrote: > > >>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> From: Simon Marchi > Simon> I started to look into changing the callbacks in macroexp.h to use > Simon> gdb::function_view. However, I noticed that the passed lookup function > Simon> was always `standard_macro_lookup`, which looks up a macro in a > Simon> `macro_scope` object. Since that doesn't look like a very useful > Simon> abstraction, it would be simpler to just pass the scope around and have > Simon> the various functions call standard_macro_lookup themselves. This is > Simon> what this patch does. > > This seems fine to me. > > I don't remember, but maybe this lookup function used to vary at some > point in the past. That would explain the abstraction anyway. Or maybe > it was just planned somehow. It looks like it never varied, I think that perhaps varying it could have been in anticipation of the macro_expand_once, for storing partial expansion tables in the baton perhaps, it looks like all the other unimplemented commands at the time of initial commit have been implemented without it (though I didn't do an exhaustive look) anyhow that is just a guess *shrug*.