[M3devel] dbxout_static_chain_decl?

Rodney M. Bates rodney_bates at lcwb.coop
Wed Aug 18 19:24:39 CEST 2010



hendrik at topoi.pooq.com wrote:
> On Fri, May 28, 2010 at 06:04:01PM -0400, hendrik at topoi.pooq.com wrote:
>> In Algol 68, when it's implemented using static links, the static chain 
>> doesn't thread *all* the chain of surrounding procedures -- it skips the 
>> ones that don't define any names used in the inner ones.
>>
>> This bit of denesting might improve efficiency even in Modula 3, since 
>> some static chains might end up being shorter.  Whether it's worth the 
>> effort is another question, of course.

Well, I'm going to keep beating this drum.  Except for highly optimized
compiles, I want the debugger to give a view that reflects what is declared.
Even when a nonlocal variable is not referred do by any nested procedure,
a debugger user (specifically, me) often wants to look at or even change such
variables, when stopped inside a nested procedure.  I do this a lot.

Yes, you can always go up the dynamic call chain with debugger commands to
get at them, but this sometimes costs a *lot* of extra time, especially
if the nested procedure has called itself recursively umpteen times.  Then
you have to get back to the frame you were in.  Then do it all again later.
It's also often quite tricky to get right.

All this diverts a lot of mental capacity from actually chasing the bug
to how to work the debugger, just for a simple variable access that, by
language rules, is visible from right were you are.

Of course, it you choose a medium or high level of optimization, then using
a debugger is already pretty much an exercise in futility anyway, for
various other reasons, so in that case, I wouldn't fight it.

> 
> I should perhaps have mentioned that this behaviour is *required* by the 
> Alcol 68 language definition.  Not required by Modula 3, where what you 
> can do with local procedures is more restricted.
> 
> -- hendrik
> 



More information about the M3devel mailing list