Discussion:
[Lazarus] Wrong error message in "Liste der überwachten Ausdrücke"
Joe via Lazarus
2018-08-01 08:05:34 UTC
Permalink
"Liste der ÃŒberwachten AusdrÃŒcke" shows the wrong error message
"<Error: Type TSTRINGLIST has no component named COUNT.>"

OS: Win 10 (64), Lazarus 1.8.4, SVN Revision 57972.
Steps to reproduce:
Insert this in an unit and let your program call it.

procedure TForm1.TestProcedure;
var Liste: TStringList;
begin
  Liste:= TStringList.Create;
  Liste.Add('Eins');
  Liste.Free
end;

Set a breakpoint at "Liste.Add('Eins')" and insert "Liste.count" into
the "Liste der ÃŒberwachten AusdrÃŒcke" (Strg+Alt+W).
Run the program. It stops at the breakpoint and the Liste der
ÃŒberwachten AusdrÃŒcke shows this wrong error message.

Regards --  Joe
Martin Frb via Lazarus
2018-08-01 09:03:14 UTC
Permalink
This can currently not be fixed.
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Properties

Currently neither dwarf-2, nor stabs allow the compiler to tell the
debugger about properties.
So for the debugger properties do not exist, hence the error.

For the specific case, try (IIRC):
List.flist.fcount
Post by Joe via Lazarus
"Liste der ÃŒberwachten AusdrÃŒcke" shows the wrong error message
"<Error: Type TSTRINGLIST has no component named COUNT.>"
OS: Win 10 (64), Lazarus 1.8.4, SVN Revision 57972.
Insert this in an unit and let your program call it.
procedure TForm1.TestProcedure;
var Liste: TStringList;
begin
  Liste:= TStringList.Create;
  Liste.Add('Eins');
  Liste.Free
end;
Set a breakpoint at "Liste.Add('Eins')" and insert "Liste.count" into
the "Liste der ÃŒberwachten AusdrÃŒcke" (Strg+Alt+W).
Run the program. It stops at the breakpoint and the Liste der
ÃŒberwachten AusdrÃŒcke shows this wrong error message.
Regards --  Joe
Joe via Lazarus
2018-08-01 09:36:21 UTC
Permalink
Post by Martin Frb via Lazarus
This can currently not be fixed.
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Properties
Currently neither dwarf-2, nor stabs allow the compiler to tell the
debugger about properties.
So for the debugger properties do not exist, hence the error.
List.flist.fcount
Post by Joe via Lazarus
"Liste der ÃŒberwachten AusdrÃŒcke" shows the wrong error message
"<Error: Type TSTRINGLIST has no component named COUNT.>"
OS: Win 10 (64), Lazarus 1.8.4, SVN Revision 57972.
Insert this in an unit and let your program call it.
procedure TForm1.TestProcedure;
var Liste: TStringList;
begin
  Liste:= TStringList.Create;
  Liste.Add('Eins');
  Liste.Free
end;
Set a breakpoint at "Liste.Add('Eins')" and insert "Liste.count" into
the "Liste der ÃŒberwachten AusdrÃŒcke" (Strg+Alt+W).
Run the program. It stops at the breakpoint and the Liste der
ÃŒberwachten AusdrÃŒcke shows this wrong error message.
Regards --  Joe
Martin, thank you for this important info. For debugging purposes, we
are now going to load an intermediate variable with the result of
Liste.count.
Regards --  Joe

Loading...