Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-08

fpdebug: "List index out of bounds" errors

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

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

Reply by email

fred
to Graeme Geldenhuys

Hy,

i use this code :

...
var tab : TDbf;
  repertoire: string;
begin
        // ***** Creation de la table ****
        tab := TDbf.Create(self);
        // ***** paramètre de localisation ****

-> the compiler return this message :

------------------------------
identifier no found "self"
------------------------------

Who is the error.

Thanks

Reply by email

fred
to fred

uh, i forget the 'DataModule1' before the name of procedure who create table.

Sorry.
Thanks

fred wrote 28 lines
Hy, i use this code : ... var tab : TDbf; repertoire: string; begin // ***** Creation de la table **** tab := TDbf.Create(self); // ***** paramètre de localisation **** -> the compiler return this message : ------------------------------ identifier no found "self" ------------------------------ Who is the error. Thanks

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 7 lines
On 2016-08-26 13:55, Graeme Geldenhuys wrote: > 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? Is nobody using fpdebug? No confirmation if it is a bug or local issue... Oh well, I'll report it in Mantis either way.

I confirm the list index out of bounds.
It works when the callstack window is open, so probably some initialization is missing.

Mattias

Reply by email