diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-02 09:23:06 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-01-02 10:27:56 -0500 |
commit | d47f5b30d8481272e9480118bdcb283690070349 (patch) | |
tree | 589f77d62110d7456496fde754036fa24c89369d /sim/common | |
parent | 32273fe68f3d1288b2eef6b96beda3732d0ac25e (diff) | |
download | gdb-d47f5b30d8481272e9480118bdcb283690070349.zip gdb-d47f5b30d8481272e9480118bdcb283690070349.tar.gz gdb-d47f5b30d8481272e9480118bdcb283690070349.tar.bz2 |
sim: delete dead current_state globals
The global current_state handle to the current simulator state is a
design idea that was half implemented, but never really cleaned up.
The point was to have a global variable pointing to the state so that
funcs could more quickly & easily access the state anywhere. We've
instead moved in the direction of passing state around everywhere and
don't have any intention of moving back.
I also can't find any references to gdb using this variable, or to
cgen related "dump_regs" functions, both of which were used in the
comments related to this code.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 6 | ||||
-rw-r--r-- | sim/common/cgen-defs.h | 6 | ||||
-rw-r--r-- | sim/common/sim-base.h | 22 | ||||
-rw-r--r-- | sim/common/sim-utils.c | 4 |
4 files changed, 6 insertions, 32 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 58ffa6c..65a0abf 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,9 @@ +2016-01-02 Mike Frysinger <vapier@gentoo.org> + + * cgen-defs.h (current_state): Delete. + * sim-base.h (CURRENT_STATE_REG, CURRENT_STATE): Delete. + * sim-utils.c (current_state): Delete. + 2015-12-30 Mike Frysinger <vapier@gentoo.org> * sim-module.c (sim_pre_argv_init): Change STATE_MY_NAME assignment diff --git a/sim/common/cgen-defs.h b/sim/common/cgen-defs.h index be717f8..c42db9b 100644 --- a/sim/common/cgen-defs.h +++ b/sim/common/cgen-defs.h @@ -140,12 +140,6 @@ typedef enum { /* Simulator state. */ -/* Records simulator descriptor so utilities like @cpu@_dump_regs can be - called from gdb. */ -extern SIM_DESC current_state; - -/* Simulator state. */ - /* CGEN_STATE contains additional state information not present in sim_state_base. */ diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h index a0e7090..350b352 100644 --- a/sim/common/sim-base.h +++ b/sim/common/sim-base.h @@ -89,28 +89,6 @@ typedef struct _sim_cpu sim_cpu; #include "sim-memopt.h" #include "sim-cpu.h" -/* Global pointer to current state while sim_resume is running. - On a machine with lots of registers, it might be possible to reserve - one of them for current_state. However on a machine with few registers - current_state can't permanently live in one and indirecting through it - will be slower [in which case one can have sim_resume set globals from - current_state for faster access]. - If CURRENT_STATE_REG is defined, it means current_state is living in - a global register. */ - - -#ifdef CURRENT_STATE_REG -/* FIXME: wip */ -#else -extern struct sim_state *current_state; -#endif - - -/* The simulator may provide different (and faster) definition. */ -#ifndef CURRENT_STATE -#define CURRENT_STATE current_state -#endif - /* We require all sims to dynamically allocate cpus. See comment up top about struct sim_state. */ diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index 5439b8b..d2b5f7c 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -48,10 +48,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "bfd.h" #include "sim-utils.h" -/* Global pointer to all state data. - Set by sim_resume. */ -struct sim_state *current_state; - /* Allocate zero filled memory with xcalloc - xcalloc aborts if the allocation fails. */ |