Recent

Author Topic: Values of variables are not displayed  (Read 940 times)

Flomo

  • New Member
  • *
  • Posts: 10
Values of variables are not displayed
« on: August 24, 2023, 09:21:37 pm »
Hi,

working with Lazarus IDE 2.2.4, developing for Windows.

When letting the program stop at a breakpoint, I can hover the mouse over a variable name or an object property like TEdit.Text.
My problem: Instead of the value, the tooltip only shows three question marks. When using the debugging window instead to display the value for TEdit.Text, it shows an error <Error: Member not found: Text>

I have searched various forums and wikis but can't find anthing helpful.

Any help is greatly appreciated.

Florian

Lulu

  • Full Member
  • ***
  • Posts: 225
Re: Values of variables are not displayed
« Reply #1 on: August 24, 2023, 09:41:00 pm »
Hi,
TEdit.Text is a property with getter/setter (a procedure and function to read and write the content), the debugger can't directly access its value.
You can use a workaround using an intermediary variable like this:
Code: Pascal  [Select][+][-]
  1. var debugStr: string;
  2. ...
  3. debugStr := Edit1.Text; // put a breakpoint here

When your program stops its execution, press F8 and move your mouse over debugStr, the IDE will show you its content.
wishing you a nice life

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9361
  • Debugger - SynEdit - and more
    • wiki
Re: Values of variables are not displayed
« Reply #2 on: August 25, 2023, 07:12:39 am »

When letting the program stop at a breakpoint, I can hover the mouse over a variable name or an object property like TEdit.Text.
My problem: Instead of the value, the tooltip only shows three question marks. When using the debugging window instead to display the value for TEdit.Text, it shows an error <Error: Member not found: Text>

Unfortunately an issue with the FPC compiler.

Equally, many methods will not work with the "function evaluation" feature of the debugger. The FPC team so far has not reacted to a proposal to resolve this https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/448
And this is a first required step to eventually (maybe) solve the property issue.

Flomo

  • New Member
  • *
  • Posts: 10
Re: Values of variables are not displayed
« Reply #3 on: August 25, 2023, 08:04:03 am »
Martin and Lulu,

thanks for this piece of information. Coming from Delphi, I thought Lazarus would behave similar.

Florian

 

TinyPortal © 2005-2018