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....
https://sourceware.org/gdb/onlinedocs/gdb/Convenience-Funs.html

Or use FpDebug. FpDebug can compare strings.
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to