Recent

Author Topic: variable value  (Read 4912 times)

heavy

  • New member
  • *
  • Posts: 7
variable value
« on: January 29, 2011, 07:02:13 pm »
How can I see what value does contain a variable during runing the program with f7/f8 (trace into/over)? In fpc there is a tab debug and watches.
I am sorry for my mistakes...
« Last Edit: January 29, 2011, 07:15:34 pm by heavy »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10997
  • Debugger - SynEdit - and more
    • wiki
Re: variable value
« Reply #1 on: January 29, 2011, 07:30:24 pm »
Well in Lazarus, you got many ways.

You can inspect by hovering with the mouse, getting the value as hint.
You can use the Watches window (or Locals)

But first of all:
- make sure you configured gdb as debugger, in Environment Options.
- make sure you compiled with debug info (best to compile with dwarf (-gw), in Project options, linking tab

Then go to the View menu, "debug windows" and select what you need.

The Faq also has a section on what works, and what works not in debugging. Most notable, properties. Since unfortunately, some properties can not be viewed.

heavy

  • New member
  • *
  • Posts: 7
Re: variable value
« Reply #2 on: January 29, 2011, 07:43:47 pm »
You can inspect by hovering with the mouse, getting the value as hint. This is working but it's a little annoying cause it takes a little to see the value.
I don't know how can I see the watches window. (I found it)
gdb.exe is set as debugger.
I can't find where I can do that (compile with dwarf).

Thanks!

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10997
  • Debugger - SynEdit - and more
    • wiki
Re: variable value
« Reply #3 on: January 29, 2011, 07:55:10 pm »
I don't know how can I see the watches window. (I found it)
You can not, or you just did? "View" Menu, almost at the bottom, Sub-menu "Debug Windows"

Quote
gdb.exe is set as debugger.
I can't find where I can do that (compile with dwarf).

Menu "Project" / "Project Options"  (maybe "Compiler Options" in older Lazarus). It's on the tab "Linking" => "generate dwarf debug info"

And on tab "other" in the big memo "custom options" you may want to put -godwarfsets

Also remember, that if you whish to debug stuff in other packages or LCL, you may have to recompile those with debug info too.

Also, I advice to use 0.9.29 fixes version of Lazarus. As it had a few improvements. Or go for 0.9.31



heavy

  • New member
  • *
  • Posts: 7
Re: variable value
« Reply #4 on: January 29, 2011, 08:53:06 pm »
"You can not, or you just did? "View" Menu, almost at the bottom, Sub-menu "Debug Windows"" - I just did.
Thanks!!

 

TinyPortal © 2005-2018