Recent

Author Topic: Error Debug mode  (Read 1651 times)

J-23

  • Full Member
  • ***
  • Posts: 108
Error Debug mode
« on: October 17, 2020, 11:57:04 pm »
Hello,
I have an application that works fine in Relase mode.

The problem occurs during Debugging:

I have code that looks like this:
Code: Pascal  [Select][+][-]
  1. procedure TBaseWizardConnection.RecomededHostActive(
  2.   ConnectionFrame: TConnFrame;
  3.   DatabaseConnectionVersionList: TDatabaseConnectionVersionList);
  4. var
  5.   Item: TDatabaseConnectionVersion;
  6.   i: Integer;
  7. begin
  8.   with ConnectionFrame do
  9.   begin
  10.     DatabaseConnectionVersionList.DatabaseDriver := ComboBoxDatabaseType.Items[ComboBoxDatabaseType.ItemIndex];
  11.     DatabaseConnectionVersionList.Execute;
  12.     for i := 0 to DatabaseConnectionVersionList.Count -1 do
  13.     begin
  14.       Item := DatabaseConnectionVersionList.Items[i];
  15.       if Item.Version = ComboBoxDatabaseTypeVersion.Items[ComboBoxDatabaseTypeVersion.ItemIndex] then
  16.       begin //this error
  17.         with ConnectionFrame.EditHost do
  18.         begin
  19.           if Item.RecomendedHost then
  20.           begin
  21.             ReadOnly := False;
  22.             Color := clDefault;
  23.           end
  24.           else
  25.           begin
  26.             Clear;
  27.             ReadOnly := True;
  28.             Color := clForm;
  29.           end;
  30.         end;
  31.         Break;
  32.       end;
  33.     end;
  34.   end;
  35. end;
  36.  

I don't know where to look for the cause of the problem.

The screen with the error and debugger options:
https://drive.google.com/file/d/1aMCwpNgkmr5BRzbU265YNoAUCjDD1FOt/view?usp=sharing
https://drive.google.com/file/d/1Z7JOELVzMLi1FaYdU6dSeVz6J27B_GM5/view?usp=sharing
« Last Edit: October 18, 2020, 01:25:07 am by J-23 »

J-23

  • Full Member
  • ***
  • Posts: 108
Re: Error Debug mode FPC 3.3.1
« Reply #1 on: October 18, 2020, 03:54:05 am »
Hello,
The problem is that the Debugger points to the wrong line, hence it points to the line from the begin

The problem, however, concerns this line:
Code: Pascal  [Select][+][-]
  1. with ConnectionFrame.EditHost do

When we hover the cursor over the ConnectionFrame we have the message "... not found" hence the errors I showed on the screenshots

This is an obvious bug in FPC 3.3.1 and we cannot debug it

Check if it is similar with you.

bytebites

  • Hero Member
  • *****
  • Posts: 633
Re: Error Debug mode
« Reply #2 on: October 18, 2020, 08:03:26 am »
I don't know how to debug pictures.  :(

J-23

  • Full Member
  • ***
  • Posts: 108
Re: Error Debug mode
« Reply #3 on: October 18, 2020, 03:52:53 pm »
I don't know how to debug pictures.  :(

Hello,
You mean I didn't give the full code?

Well, the full code is not needed because it is not a problem with the code but with the debugger

You have the images under the links. Check if your Lazarus is working properly in the given settings

bytebites

  • Hero Member
  • *****
  • Posts: 633
Re: Error Debug mode
« Reply #4 on: October 18, 2020, 07:50:58 pm »
Sometimes does not work.
Failing code example.
Code: Pascal  [Select][+][-]
  1. tmp.call(cl, value, ret);
Inspecting of variable "ret" causes crash.
Was this information useful? No.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Error Debug mode
« Reply #5 on: October 18, 2020, 09:25:12 pm »
GDB sometimes troubles extenal libs.  In tools>debugger is an opiton DisableLoadSymbolsForLibraries or similar.... maybe

 

TinyPortal © 2005-2018