Recent

Author Topic: Can't get the Debugger to work  (Read 1428 times)

garymq

  • Newbie
  • Posts: 5
Can't get the Debugger to work
« on: September 02, 2025, 03:57:15 pm »
Hello
I have just started using Lazarus. I'm coming from Xojo.

I've written a few small applications to start. Lazarus seems quite good so far.

But one thing - I can't get the Debugger to work.
Here's what I do:
I write a simple program, highlight a variable, click CNTRL+F5, and the variable appears correctly in the Watch window.
Enable the Debugger.
Run the program - but no matter what I do, the Value of the variable in the watch window ALWAYS remains "<invalid>"

I have tried this with many variables, Integers, strings, floats, etc. Global and Local variables. The value always stays "<invalid>".

What am I doing wrong?

Thanks
Gary

af0815

  • Hero Member
  • *****
  • Posts: 1409
Re: Can't get the Debugger to work
« Reply #1 on: September 02, 2025, 04:05:45 pm »
Use a breakpoint, after the program stops, you can see the value in watch window. It is not possible as the program ist running.
regards
Andreas

garymq

  • Newbie
  • Posts: 5
Re: Can't get the Debugger to work
« Reply #2 on: September 03, 2025, 12:29:02 am »
OK!
Simple really, now that I understand.
I had assumed a dynamic debugger, like some others.

Thanks very much Andreas!
Regards, Gary


Jeff_t

  • New Member
  • *
  • Posts: 17
Re: Can't get the Debugger to work
« Reply #3 on: September 23, 2025, 10:39:28 am »
Hi Gary. Also starting with Lazarus from Xojo.
It's promising, but its slow progress so far.
I'm finding that the debugger watch window isnt great for objects.. expanding the contents often just shows pointers to stuff, rather than 'the properties'
How are you getting on generally?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12288
  • Debugger - SynEdit - and more
    • wiki
Re: Can't get the Debugger to work
« Reply #4 on: September 24, 2025, 07:47:18 pm »
Hi Gary. Also starting with Lazarus from Xojo.
It's promising, but its slow progress so far.
I'm finding that the debugger watch window isnt great for objects.. expanding the contents often just shows pointers to stuff, rather than 'the properties'
How are you getting on generally?

What OS/CPU are you using?

If supported, check that you are using FpDebug https://wiki.freepascal.org/Debugger_Setup

Also "objects" for you refers too which one?
Code: Pascal  [Select][+][-]
  1. type
  2.   TFoo = object ... end;
  3.   TFoo = class ... end;
  4.   TFoo = record ... end;

And then also use DWARF-3


And the properties for which you see pointers are declared how?

Also in which units are those declared?

Problem with answering your issue is, to figure out what may cause it... It could be the compiler not adding the info. Or the debugger, but that depends which one you use.

 

TinyPortal © 2005-2018