[Lazarus] fpdebug: "List index out of bounds" errors

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri Aug 26 14:55:04 CEST 2016


Hi,

I am on the latest Lazarus Trunk revision. Does anybody else see loads
of "Index out of bounds" errors when using the native Free Pascal
debugger, fpdebug?

>From what I can see, if I use tooltip debugging over a variable that was
defined outside the scope of the current procedure but is still valid,
then the "Index out of bounds" error occurs.

Here is an example that reproduces the error:

Try and tooltip debug the i variable inside the NestedTwo() procedure.

===================================================
program debug_test;

{$mode objfpc}{$H+}

type
  TTestApp = class(TObject)
  public
    procedure One;
  end;

{ TTestApp }

procedure TTestApp.One;
var
  i: integer;

  procedure NestedTwo;
  var
    j: integer;
  begin
    j := 333;
    j := j + i; // tooltip debug i gives an error
    writeln(j);
  end;

begin
  i := 123;
  NestedTwo;
  writeln(i);
end;


var
  c: TTestApp;
begin
  c := TTestApp.Create;
  try
    c.One;
  finally
    c.Free;
  end;
end.

====================================================


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list