What I'm really doing is trying to set a watchpoint on the setting or clearing of a single bit. I do that by setting a watchpoint on the word containing the bit, then making it conditional on *word & mask
(for setting, or (~*word) & mask
for clearing.)
The problem is that some other bit in the same word may be modified, and the condition may happen to already match. If I had the old and new values, I could set a condition of (($old ^ $new) & mask)
.
I looked at the python gdb.Breakpoint
class, but it doesn't seem to receive this information either.
I suppose I could go crazy and set a command list that records the current value whenever the value of *word
changes, and use that as $old
. But half the time I'm using this, I'm actually using it through rr, so I might be going backwards.