Recent

Author Topic: Possible bug in FpDebug  (Read 602 times)

440bx

  • Hero Member
  • *****
  • Posts: 4748
Possible bug in FpDebug
« on: November 13, 2024, 08:27:51 am »
Hello,

Consider the following code:
Code: Pascal  [Select][+][-]
  1. {$APPTYPE CONSOLE}
  2.  
  3. program _absolute;
  4.  
  5. type
  6.   TTABLE   = record
  7.     count     : DWORD;
  8.     item      : array[0..9] of dword;
  9.   end;
  10.  
  11. type
  12.   TRECORD  = record
  13.     Field1     : TTABLE;
  14.     Field2     : TTABLE;
  15.   end;
  16.  
  17.  
  18. procedure TheProc(InoutParameter : TRECORD);
  19. var
  20.   count1    : DWORD absolute InoutParameter.field1.count;
  21.   count2    : DWORD absolute InoutParameter.field2.count;
  22.  
  23.   Parameter : TRECORD absolute InoutParameter;
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. var
  37.   OtherVar : DWORD;
  38.  
  39. begin
  40.   writeln('count1: ', count1);
  41.   writeln('count2: ', count2);
  42.  
  43.  
  44.   OtherVar := count1;
  45.  
  46.   count2   := count1 * 3;
  47. end;
  48.  
  49. var
  50.   TheVariable : TRECORD;
  51.  
  52. begin
  53.   TheVariable.Field1.count := 100;
  54.   TheVariable.Field2.count := 200;
  55.  
  56.   TheProc(TheVariable);
  57.  
  58.   readln;
  59. end.    

Set to watch the variables "count1", "count2" and "Parameter" in the procedure TheProc, FpDebug cannot display "count1" nor "count2" but displays 'Parameter". Please see attachment.

Either FPC is not emitting symbols for "count1" and  "count2" or FpDebug is not interpreting the symbols for those 2 variables correctly.

Comments welcome.

FPC v3.2.2 & Lazarus v3.99 (2024-10-23)

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

bytebites

  • Hero Member
  • *****
  • Posts: 685
Re: Possible bug in FpDebug
« Reply #1 on: November 13, 2024, 08:45:01 am »
FPC trunk compiled code shows count1 and count2 correctly.

440bx

  • Hero Member
  • *****
  • Posts: 4748
Re: Possible bug in FpDebug
« Reply #2 on: November 13, 2024, 09:03:39 am »
FPC trunk compiled code shows count1 and count2 correctly.
FPC v3.2.2 outputs the values of count1 and count2 correctly too.  It is FpDebug's watch window that does not show the values.   Did you mean to say that FpDebug shows the values if the code is compiled with FPC trunk ?
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

bytebites

  • Hero Member
  • *****
  • Posts: 685
Re: Possible bug in FpDebug
« Reply #3 on: November 13, 2024, 09:07:35 am »
Yes, in watches and local variables windows.

440bx

  • Hero Member
  • *****
  • Posts: 4748
Re: Possible bug in FpDebug
« Reply #4 on: November 13, 2024, 09:31:39 am »
Yes, in watches and local variables windows.
Then it sounds like it's a bug in the current version of FPC. 

Just curious, what version of Lazarus did you test with ?

Thanks
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

bytebites

  • Hero Member
  • *****
  • Posts: 685
Re: Possible bug in FpDebug
« Reply #5 on: November 13, 2024, 09:37:53 am »
Laz 3.99

440bx

  • Hero Member
  • *****
  • Posts: 4748
Re: Possible bug in FpDebug
« Reply #6 on: November 13, 2024, 09:43:29 am »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Possible bug in FpDebug
« Reply #7 on: November 13, 2024, 04:04:57 pm »
It's a problem in FPC. FPC does not add debug info for those.

 

TinyPortal © 2005-2018