[fpc-devel] parentfp question/idea

Martin fpc at mfriebe.de
Fri Dec 17 20:32:32 CET 2010


fpc stores parentfp in debug info, which allows an IDE to detect nested 
procs, and check for variables in the parent frame.

however while good, this solution is not 100% (ok nothing ever is)
haven't tested, but if memory serves....

procedure Outer;
var i: integer;
   procedure Middle;

     procedure Inner;
     begin
       writeln(i); // uses Outer
     end;

   var i: integer; // Middle, but not visible to Inner
   begin
   end;

begin
end;

This scoping isn't coverable by framefp?

The ide/question is (and yes, it is one of the ones: I am not the one to 
do it, so I can't expect anyone else....)

could  "i" not be somehow encoded as a local variable? like i = framefp.i?

Martin




More information about the fpc-devel mailing list