mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
2004-04-26 Orjan Friberg <orjanf@axis.com>
* frame.c: Include "observer.h". (frame_observer_target_changed): New function. (_initialize_frame): Attach target_changed observer. * regcache.c: Include "observer.h". (regcache_observer_target_changed): New function. (_initialize_regcache): Attach target_changed observer. * valops.c: Include "observer.h". (value_assign): Notify target_changed event when modifying register. * Makefile.in (frame.o, regcache.o, valops.o): Add $(observer_h).
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "gdb_assert.h"
|
||||
#include "gdb_string.h"
|
||||
#include "gdbcmd.h" /* For maintenanceprintlist. */
|
||||
#include "observer.h"
|
||||
|
||||
/*
|
||||
* DATA STRUCTURE
|
||||
@@ -566,6 +567,14 @@ real_register (int regnum)
|
||||
return regnum >= 0 && regnum < NUM_REGS;
|
||||
}
|
||||
|
||||
/* Observer for the target_changed event. */
|
||||
|
||||
void
|
||||
regcache_observer_target_changed (struct target_ops *target)
|
||||
{
|
||||
registers_changed ();
|
||||
}
|
||||
|
||||
/* Low level examining and depositing of registers.
|
||||
|
||||
The caller is responsible for making sure that the inferior is
|
||||
@@ -1697,6 +1706,8 @@ _initialize_regcache (void)
|
||||
DEPRECATED_REGISTER_GDBARCH_SWAP (deprecated_register_valid);
|
||||
deprecated_register_gdbarch_swap (NULL, 0, build_regcache);
|
||||
|
||||
observer_attach_target_changed (regcache_observer_target_changed);
|
||||
|
||||
add_com ("flushregs", class_maintenance, reg_flush_command,
|
||||
"Force gdb to flush its register cache (maintainer command)");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user