Forum > Debugger
Values of variables are not displayed
(1/1)
Flomo:
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:
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 [+][-]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";}};} ---var debugStr: string;...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.
Martin_fr:
--- Quote from: Flomo on August 24, 2023, 09:21:37 pm ---
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>
--- End quote ---
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:
Martin and Lulu,
thanks for this piece of information. Coming from Delphi, I thought Lazarus would behave similar.
Florian
Navigation
[0] Message Index