Recent

Author Topic: Can i See the Property Value when hovering over it ?  (Read 376 times)

Weitentaaal

  • Sr. Member
  • ****
  • Posts: 392
  • Weitental is a very beautiful garbage depot.
Can i See the Property Value when hovering over it ?
« on: June 27, 2022, 02:55:33 pm »
Hello,

i wanted to ask if i can Check a Property Value when hovering over it. It works with Strings, Integer, Double etc.

Example:
Code: Pascal  [Select][+][-]
  1.    SomClass= class
  2.    private
  3.       fSomInt: Integer;
  4.    public
  5.       property SomInt: Integer read fSomInt write fSomInt;
  6.    end;
  7.  
  8.  


When i try to debug and want to check the Property it said "no information for SomInt" or something like that, and then i have to check the Variable. is there a way to check the Value without typing it everytime in the List of observed Expressions ?

Thanks
Lazarus: 2.0.12 x86_64-win64-win32/win64
Compiler Version: 3.2.0

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8099
  • Debugger - SynEdit - and more
    • wiki
Re: Can i See the Property Value when hovering over it ?
« Reply #1 on: June 27, 2022, 03:59:36 pm »
Code: Pascal  [Select][+][-]
  1. read fSomInt
That should work (unless you use gdb and stabs).

Code: Pascal  [Select][+][-]
  1. read GetSomInt
that does not work, yet.

Joost is currently implementing this. But it will at the earliest be available with FPC 3.4 (that is 3.4 - not 3.2.4 => next in line is likely 3.2.4 - at least it was iirc said to be due earlier this year)

Weitentaaal

  • Sr. Member
  • ****
  • Posts: 392
  • Weitental is a very beautiful garbage depot.
Re: Can i See the Property Value when hovering over it ?
« Reply #2 on: June 28, 2022, 09:35:19 am »
Thanks !  :)

i did use read fSomInt, but with the Standard Lazarus Debugger (not sure which one it is :-[). So switching debugger should allow me to view the content, and if I'm not completely wrong Lazarus already has several debuggers in the installation directory (lazarus\components\lazdebuggers)?
Lazarus: 2.0.12 x86_64-win64-win32/win64
Compiler Version: 3.2.0

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8099
  • Debugger - SynEdit - and more
    • wiki
Re: Can i See the Property Value when hovering over it ?
« Reply #3 on: June 28, 2022, 01:18:11 pm »
Thanks !  :)

i did use read fSomInt, but with the Standard Lazarus Debugger (not sure which one it is :-[). So switching debugger should allow me to view the content, and if I'm not completely wrong Lazarus already has several debuggers in the installation directory (lazarus\components\lazdebuggers)?

The default debugger is now  FpDebug. But if you upgraded, it might have kept your old config with gdb.

In anyway, both debuggers can do Dwarf. "Project Options" > "Debugging"

"DWARF" and "STABS" are format-specs (like doc, pdf, rtf...). They specify how the compiler stores info for the debugger. And they of course also affect what can be stored. Additionally the compiler may only have implementation for a subset of each of them. And so may the debugger. (e.g. FpDebug only supports DWARF). "DWARF" is the recommended of the 2 formats.

The option "-gh" or "default" for the debug-info-format, is decided by FPC. In many cases it is DWARF, but in some it may still be stabs.

Neither format supports properties at all. But (when using DWARF) for
Code: Pascal  [Select][+][-]
  1. property Data: TFooType read FDataField
FPC will encode "Data" as if it was a field (a variable on the object). Therefore the debugger (any debugger) will be able to display it.

As a consequence
Code: Pascal  [Select][+][-]
  1. property Data read FDataField write SetData;
The debugger only sees FDataField. If you modify the value of "Data" (modify dialog), then it will directly set FdataField. It will not call "SetData"



Weitentaaal

  • Sr. Member
  • ****
  • Posts: 392
  • Weitental is a very beautiful garbage depot.
Re: Can i See the Property Value when hovering over it ?
« Reply #4 on: June 28, 2022, 02:51:07 pm »
Thank You ! :) :) :)
Lazarus: 2.0.12 x86_64-win64-win32/win64
Compiler Version: 3.2.0

 

TinyPortal © 2005-2018