PDA

View Full Version : Viewing variables and properties while debugging



chronozphere
08-01-2010, 01:20 PM
Hey guys

I would like to be able to view properties and variables during debugging in lazarus but I haven't succeeded yet. I've tried enabeling dwarf debug information (-gw) but after doing that, the debugger ignored my breakpoints (they turned green).

Can someone help me with this?

Andreaz
08-01-2010, 03:04 PM
Afaik propertys arent supported by gdb as they are pascal specific, thus you cant view them, neither can you check results from functions in the gdb.

phibermon
10-04-2010, 09:25 PM
any local variables can normally be hovered over in the code window to see it's value. Be sure that in your compiler settings you're not using an optimization level that is not debugger friendly.

WILL
10-04-2010, 09:35 PM
Wow I can't believe I haven't responded to this yet. Use Ctrl+F7 while you are stepping through your code.

You can also find this in the menu under 'Run' - > 'Evaluate/Modify...'

You can then use the window that pops up to 'evaluate' you code and it'll return values of your variables. This all depends on where you are in your code so you may have to pass values to parameters if you are finding that your bug appears inside of a function or procedure, but overall the process is the same.

You'll also find that just moving your mouse over the variable (as long as it's not a huge array or set) also is an easy way to 'peek' at whats inside. Laz has come a LONG way in debugging features it's getting at least almost to where Delphi 7 was.

chronozphere
10-04-2010, 10:14 PM
Thanks for bringing this thread back up. I'm gonna check this out soon. I'd like to get into lazarus more. Gives me a reason to boot linux and learn about cross-platform development. ;)