[Lazarus] Conditional Debugger breakpoints not working ?

Martin Frb lazarus at mfriebe.de
Mon Feb 20 12:39:48 CET 2023

On 20/02/2023 12:31, Michael Van Canneyt via lazarus wrote:
> I'm trying to set a condition on a breakpoint.
> I have a local variable aUnit, type string:
> var
>   aUnit : string;
> I wish the breakpoint is only triggered when aUnit equals 'termio'.
> So, in the breakpoint properties dialog, I enter the condition:
> aUnit='termio'
> It seems to have no effect whatsoever. The breakpoint is triggered 
> always at
> the first traversal of the line.
> I tried variations (uppercase, lowercase) , but to no avail.
> Looking at the debug internals window, I see that the expression is
> only (correctly) evaluated by gdb when I move the mouse over the 
> identifier
> in the sources:
> (gdb) <ptype AUNIT>

gdb doesn't know pascal strings, or how do an "=" operation on them.

You can try to get  $_streq(myvar, "hello") to work....

Or use FpDebug. FpDebug can compare strings.

More information about the lazarus mailing list