From: Simon Marchi <simark@simark.ca>
To: Matt Rice <ratmice@gmail.com>, Tom Tromey <tom@tromey.com>
Cc: Simon Marchi <simon.marchi@efficios.com>,
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] gdb: remove callback in macro expand functions
Date: Tue, 30 Jun 2020 18:26:12 -0400 [thread overview]
Message-ID: <40adf4ea-fa92-9051-e1a7-626dd8496a03@simark.ca> (raw)
In-Reply-To: <CACTLOFppcfhuaxKRmoadfhowKjTuoubkV3YOZWM8cJ-0S28r7A@mail.gmail.com>
On 2020-06-30 6:14 p.m., Matt Rice via Gdb-patches wrote:
> On Tue, Jun 30, 2020 at 8:47 PM Tom Tromey <tom@tromey.com> wrote:
>>
>>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
>> Simon> From: Simon Marchi <simon.marchi@efficios.com>
>> 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*.
>
Ok, thanks for checking. In any case, if this abstraction is ever actually
needed, it won't be really hard to add it back. And if not, then we can just
enjoy the simpler code.
Simon
next prev parent reply other threads:[~2020-06-30 22:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-28 16:56 [PATCH 0/3] Small cleanups in macro code Simon Marchi
2020-06-28 16:56 ` [PATCH 1/3] gdb: remove callback in macro expand functions Simon Marchi
2020-06-30 20:47 ` Tom Tromey
2020-06-30 22:14 ` Matt Rice
2020-06-30 22:26 ` Simon Marchi [this message]
2020-06-28 16:56 ` [PATCH 2/3] gdb: make macro_expand_next return a gdb::unique_xmalloc_ptr<char> Simon Marchi
2020-06-30 20:53 ` Tom Tromey
2020-06-30 22:26 ` Simon Marchi
2020-06-28 16:56 ` [PATCH 3/3] gdb: make macro_stringify " Simon Marchi
2020-06-30 20:55 ` Tom Tromey
2020-07-01 0:26 ` Simon Marchi
2020-07-01 15:36 ` Tom Tromey
2020-07-04 2:28 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40adf4ea-fa92-9051-e1a7-626dd8496a03@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=ratmice@gmail.com \
--cc=simon.marchi@efficios.com \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox