This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: New scope checking patch
- From: "Rob Quill" <rob dot quill at gmail dot com>
- To: tromey at redhat dot com
- Cc: "Eli Zaretskii" <eliz at gnu dot org>, "Jim Blandy" <jimb at red-bean dot com>, gdb-patches at sourceware dot org
- Date: Tue, 29 Jul 2008 22:04:18 +0100
- Subject: Re: New scope checking patch
- References: <baf6008d0711120829l3c0201aakf477dd4d6cfd440e@mail.gmail.com> <m3r6gf6kcz.fsf@codesourcery.com> <baf6008d0801181443s5321e5d5ud1c935aa8487a549@mail.gmail.com> <m34pda7ira.fsf@codesourcery.com> <baf6008d0801300405i47646b05pdb799d32ab71e005@mail.gmail.com> <u1w7zxjid.fsf@gnu.org> <8f2776cb0801301557t2e265b62u56d6df7cbcec1c84@mail.gmail.com> <utzkuws6q.fsf@gnu.org> <baf6008d0807271645o7d03dd94rd5b3f0d08302085a@mail.gmail.com> <m38wvk77qd.fsf@fleche.redhat.com>
2008/7/29 Tom Tromey <tromey@redhat.com>:
>>>>>> "Rob" == Rob Quill <rob.quill@gmail.com> writes:
>
> Rob> 2008-07-27 Rob Quill <rob.quill@gmail.com>
> Rob> Add $in_scope as a type of expression.
>
> This seems like a good candidate for an internal function. The syntax
> is nearly identical.
Hi Tom,
Are you saying that there is something that I need to do before this
can be committed? If so, could you explain a bit further? Where can I
find out about internal functions?
> The only difference is that, at the GCC Summit, we agreed that
> arguments to internal functions would be expressions. So, instead of
> $in_scope(x) you would have to write $in_scope("x").
With regards to expressions, the patch in it's current form can only
determine the scope of variables. I do have a very rough patch with
some fairly major caveats which can deal with expressions. If this
patch it implemented as an internal function, what is to stop someone
passing an expression to $in_scope(), in which case, does the patch
need to be able to determine if a whole expression is in scope?
Because I ran into some problems when doing that before. I believe
they may even be discussed earlier in this thread.
Rob
> Internal functions are only in the python repository right now. The
> patch consists of two parts: an internals-only part, and the part that
> exposes the functionality to the Python layer.
>
> I think we can submit the internals part as a separate patch. AFAIK
> the only reason we haven't is just that there's been no need for it
> outside the Python work.
>
> Tom
>