This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add proper handling for non-local references in nested functions


On Wed, 22 Jul 2015 07:26:02 -0700
Doug Evans <xdje42@gmail.com> wrote:

> One thought that comes to mind when reading the patch is that
> you introduce the term "static link", and it doesn't mean what
> the casual reader will think it means.
> 
> E.g.,
> 
> +     This method is designed to work with static links (nested
> functions
> +     handling).  Static links are function properties whose
> evaluation return
> +     the frame base address for the enclosing frame.
> 
> I think we need something less ambiguous / more clear.

Perhaps the term "static chain" is better?

That term, "static chain", has been around for a long while to
describe a technique for implementing lexically scoped functions. 
E.g, I've found it in one of my (very old) textbooks where it is used
in a discussion of the implementation of lexically scoped subprograms
in the ALGOL language.

On the other hand, DWARF has the DW_AT_static_link attribute.  Its
value is a "location description that computes the frame base of the
relevant instance of the subroutine that immediately encloses the
subroutine or entry point."

AFAICT, the terms "static link" and "static chain" mean the same thing
in the context of lexically scoped functions.  I think we should use
one of these phrases unless someone knows of yet another term which is
commonly used in this context.

Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]