Skip to content

MSEide doesn't recognise local variable#148

Description

@graemeg

So here is an interesting one.

Call-stack is:
main -> foo() -> bar()

If you set a breakpoint at (1) in the code, SeenByBar is in scope of Bar(). Yes MSEide doesn't believe it is. 馃 And yet the line right before it, we assigned a value to SeenBaBar, so we know it is in scope.

I'm using Fred's GBD 16 binary. I compiled this program with FPC 3.2.2 under 64-bit Linux using compiler options:
-Mobjfpc -Sh -gl -O- -gw3 -gh -view

I also tried with -gw2, and it made no difference.

Any thoughts?

program testscope;
{$mode objfpc}{$H+}

procedure foo;
var
  SeenByBar: integer;

  procedure Bar;
  begin
    SeenByBar := 1;
    writeln('inside bar 1');     // breakpoint here  (1)
    //NotSeenByBar := 2;
    writeln('inside bar 2');

  end;
var
  NotSeenByBar: integer;

begin
  SeenByBar := 99;
  NotSeenByBar := 99;
  Bar();
end;

var
  sentinal: integer;
begin
  writeln('running testscope');
  Foo();
  sentinal := 1; // breakpoint here
end.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions