aboutsummaryrefslogtreecommitdiff
path: root/sim/frv
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-03-22 23:10:09 -0400
committerMike Frysinger <vapier@gentoo.org>2015-11-15 02:30:19 -0500
commit6e4f085c7f459e0777a71bcb61ed3aa8257fa386 (patch)
treee2d1bc33b00d55f6765b8cc8cebb41b4cda7cb81 /sim/frv
parent1bd1b714219e1c8324cc2fb5feb4496e80b6adfd (diff)
downloadgdb-6e4f085c7f459e0777a71bcb61ed3aa8257fa386.zip
gdb-6e4f085c7f459e0777a71bcb61ed3aa8257fa386.tar.gz
gdb-6e4f085c7f459e0777a71bcb61ed3aa8257fa386.tar.bz2
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.
Diffstat (limited to 'sim/frv')
-rw-r--r--sim/frv/ChangeLog8
-rw-r--r--sim/frv/sim-if.c5
-rw-r--r--sim/frv/sim-main.h3
3 files changed, 12 insertions, 4 deletions
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 44c920c..9ebf498 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,11 @@
+2015-11-14 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_close): Rename to ...
+ (frv_sim_close): ... this. Delete calls to frv_cgen_cpu_close and
+ sim_module_uninstall.
+ * sim-main.h (frv_sim_close): Declare.
+ (SIM_CLOSE_HOOK): Define.
+
2015-06-23 Mike Frysinger <vapier@gentoo.org>
* configure.ac (AC_ARG_ENABLE(sim-trapdump)): Call AS_HELP_STRING.
diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c
index 2668765..8c6ed6f 100644
--- a/sim/frv/sim-if.c
+++ b/sim/frv/sim-if.c
@@ -199,7 +199,7 @@ sim_open (kind, callback, abfd, argv)
}
void
-sim_close (sd, quitting)
+frv_sim_close (sd, quitting)
SIM_DESC sd;
int quitting;
{
@@ -211,9 +211,6 @@ sim_close (sd, quitting)
frv_cache_term (CPU_INSN_CACHE (cpu));
frv_cache_term (CPU_DATA_CACHE (cpu));
}
-
- frv_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
- sim_module_uninstall (sd);
}
SIM_RC
diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h
index d5a67cb..ef14d64 100644
--- a/sim/frv/sim-main.h
+++ b/sim/frv/sim-main.h
@@ -43,6 +43,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "profile.h"
void frv_sim_engine_halt_hook (SIM_DESC, SIM_CPU *, sim_cia);
+
+extern void frv_sim_close (SIM_DESC sd, int quitting);
+#define SIM_CLOSE_HOOK(...) frv_sim_close (__VA_ARGS__)
/* The _sim_cpu struct. */