forked from Imagelibrary/binutils-gdb
sim: sim-close: unify sim_close logic
Other than the nice advantage of all sims having to declare one fewer common function, this also fixes leakage in pretty much every sim. Many were not freeing any resources, and a few were inconsistent as to the ones they did. Now we have a single module that takes care of all the logic for us. Most of the non-cgen based ones could be deleted outright. The cgen ones required adding a callback to the arch-specific cleanup func. The few that still have close callbacks are to manage their internal state. We do not convert erc32, m32c, ppc, rl78, or rx as they do not use the common sim core.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2015-11-14 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* interp.c (sim_close): Rename to ...
|
||||
(msp430_sim_close): ... this. Delete call to sim_state_free.
|
||||
* sim-main.h (msp430_sim_close): Declare.
|
||||
(SIM_CLOSE_HOOK): Define.
|
||||
|
||||
2015-06-24 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* msp430-sim.c (trace_reg_put): Change TRACE_VPU to TRACE_REGISTER.
|
||||
|
||||
@@ -239,11 +239,9 @@ sim_open (SIM_OPEN_KIND kind,
|
||||
}
|
||||
|
||||
void
|
||||
sim_close (SIM_DESC sd,
|
||||
int quitting)
|
||||
msp430_sim_close (SIM_DESC sd, int quitting)
|
||||
{
|
||||
free (STATE_SYMBOL_TABLE (sd));
|
||||
sim_state_free (sd);
|
||||
}
|
||||
|
||||
SIM_RC
|
||||
|
||||
@@ -54,4 +54,7 @@ struct sim_state
|
||||
#include "sim-engine.h"
|
||||
#include "sim-options.h"
|
||||
|
||||
extern void msp430_sim_close (SIM_DESC sd, int quitting);
|
||||
#define SIM_CLOSE_HOOK(...) msp430_sim_close (__VA_ARGS__)
|
||||
|
||||
#endif /* _MSP430_MAIN_SIM_H_ */
|
||||
|
||||
Reference in New Issue
Block a user