Currently I am struggling with monitoring a record field change.
Say, we have a record defined as usual:
TMyRecord = record
Field1: Word;
Field2: Single;
Field3: Integer;
end;
I would like to monitor Field2 and display a dialog box as soon as this field changes from <> 0
to = 0
.
It would be better to have a native Delphi debugger way to break on this event, but data breakpoints are not possible here, because there are several arrays of this record, which are distributed over the entire program, and I need to monitor each of them (it means, I should know an address for every data breakpoint).
The next idea is to make a property complementing this field and monitor its setter. This is also not possible, because the record gets loaded from file as a whole (as a binary block) or modified by DLL calls as a whole. There are too many places in this, unknown to me program, that change these records.
My last idea was to put a timer into the record, but
- how to create the timer on record creation?
- how to solve max timers problem? There are several thousands of these records in the arrays.
I am stuck. Could you propose some other ideas, other than find all the read/write places for this record?