Forum > Debugger

Can i See the Property Value when hovering over it ?

(1/1)

Weitentaaal:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---   SomClass= class   private      fSomInt: Integer;   public      property SomInt: Integer read fSomInt write fSomInt;   end;  

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

Martin_fr:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---read fSomIntThat should work (unless you use gdb and stabs).


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---read GetSomIntthat 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:
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)?

Martin_fr:

--- Quote from: Weitentaaal 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)?

--- End quote ---

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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---property Data: TFooType read FDataFieldFPC 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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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:
Thank You ! :) :) :)

Navigation

[0] Message Index

Go to full version