[Lazarus] write watch breakpoint to field inside object
lazarus at mfriebe.de
Wed Nov 13 16:47:23 CET 2013
On 13/11/2013 14:54, Felipe Monteiro de Carvalho wrote:
> I managed to add a write watch to my variable VarA which is an
> instance of a class and it works fine following instructions here:
> But actually I would like to watch when a field inside the class is
> modified. Any way to do that? I tried setting the variable to watch as
> VarA.MyField but it doesn't work =/
> Is it possible somehow? I wonder how this works, will it stops at all
> variables which are valled VarA? There is not enough information to
> establish a particular one, I guess...
> I am searching for a memory corruption, so I would like to breakpoint
> when a code writes into a variable ...
What type is the field?
It works here.
Couple of points:
- You must use "global" for scope. Unless your object var "VarA" is a
Otherwise "varA" will go out of scope, and gdb has no idea there are
other refs to the object.
- You must delete, and create again, after every run. In order to work
around gdb scope of VarA the IDE translates the expression to a pointer.
That may not be valid on the next re-run
- You can only set the watch, if all vars involved are in scope: e.g the
ide can show the value in watches window
Otherwise: logfile please
More information about the Lazarus