Recent

Author Topic: watch clarification  (Read 983 times)

mm_coder

  • New Member
  • *
  • Posts: 41
watch clarification
« on: January 05, 2021, 02:31:45 am »
Lazarus 20 on Windies 10 64

While inspecting a button.caption value stepping through
code, floating the mouse over the the button.caption in my
code, the message indicates there is no component Caption.

And if I add button.caption to my watch list, the same error.
I have to change my watch to button.fcaption in order to
see the caption value.
Why is this the case?
Many thanks

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7312
  • Debugger - SynEdit - and more
    • wiki

mm_coder

  • New Member
  • *
  • Posts: 41
Re: watch clarification
« Reply #2 on: January 05, 2021, 04:35:38 am »
Didn't see an answer.

Anything specific I'm missing in the link?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7312
  • Debugger - SynEdit - and more
    • wiki
Re: watch clarification
« Reply #3 on: January 05, 2021, 04:48:03 am »
"button.caption" is a property.
It calls a getter (I think function GetText) to get the value.

However currently calling functions from the debugger is not possible. (There is work in progress to make it possible, but its still going to be a good while...)



As for the error "there is no member called...."
- It is not just that the debugger cannot call functions.
- It is also that the compiler can not tell the debugger that there is a property.
The debugger does not read the pascal code. It gets all the info it needs from the compiler (stored as something called "stabs" or "dwarf"). But this storage can not properly describe pascal "property" declarations. So the compiler can not describe it to the debugger, and the debugger does then not know it....

It's annoying, but there is no quick fix to it.

mm_coder

  • New Member
  • *
  • Posts: 41
Re: watch clarification
« Reply #4 on: January 05, 2021, 04:53:02 am »
Thanks for the info.
I use Codeblocks and Netbeans, but neither has
the kind of components in Laz..at least that I have found.

I love the environment, so I'll find another way to determine
my values.

 

TinyPortal © 2005-2018