Results 1 to 5 of 5

Thread: Viewing variables and properties while debugging

  1. #1

    Viewing variables and properties while debugging

    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?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    Re: Viewing variables and properties while debugging

    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.

    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  3. #3
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524

    Re: Viewing variables and properties while debugging

    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.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Re: Viewing variables and properties while debugging

    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.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5

    Re: Viewing variables and properties while debugging

    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.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •