Why is the state of cache being changed by regcache_observer_notify_target() ?
I am changing a register like this :
$sp = (long long *)$pa
When value_assign() is called in valops.c, it goes to put_frame_register()
to set the modified
contents of register SP. While doing this, it sets the registers_valip_p to
register_raw_write() after copying over the modified values in the buffer to
But soon after in value_assign(), it calls for
observer_notify_target_changed() which in turn
calls regcache_observer_target_changed(). This calls for register_changed()
resets the value of register_valid_p to 0. And when register_valid_p is set
to 0, it indicates that
it is not cached but is fetchable and hence tries to fetch the target
registers again. Something
which I cannot understand gets messed up after that.
But if I comment out the call to observer_notify_target_changed() in
works fine and the value of $sp is changed as per what I want.
Why is the regcache_observer_target_changed() changing the values of
register_valid_p as soon as its set earlier ?