aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-01-12 22:10:46 +0000
committerMike Frysinger <vapier@gentoo.org>2011-01-12 22:10:46 +0000
commit9bd90cce51141b7b30c14398e40ff66e4b7e81a4 (patch)
tree03849254fac22daca67cc7755b104d2c3356c4d0 /sim/common
parent39a3ae0a219ead81eeb3364aeafdd99a4cdefc6e (diff)
downloadgdb-9bd90cce51141b7b30c14398e40ff66e4b7e81a4.zip
gdb-9bd90cce51141b7b30c14398e40ff66e4b7e81a4.tar.gz
gdb-9bd90cce51141b7b30c14398e40ff66e4b7e81a4.tar.bz2
sim: enable hw_tree_delete in sim_hw_uninstall
I can't find any history for why the call to hw_tree_delete is commented out, and the VCS history shows that this goes back to the original import in 2009. I did find some vague reference to it from 2000 (pretty close to the original import of code), but no actual details. Without this call, every new instance of the sim results in all old previously allocated resources being leaked. With some devices, this isn't just memory, it's things like open file descriptors or mmaps. So if there are pending issues with this, I'd rather we get the sims sorted out rather than continuing to leak this stuff. Especially since the "let's wait for the sims to fix themselves" hasn't actually happened in the last 10+ years. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/sim-hw.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 65e7114..7add3c4 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,9 @@
2011-01-12 Mike Frysinger <vapier@gentoo.org>
+ * sim-hw.c (sim_hw_uninstall): Uncomment hw_tree_delete.
+
+2011-01-12 Mike Frysinger <vapier@gentoo.org>
+
* sim-module.c (sim_pre_argv_init): Return SIM_RC_FAIL when asprintf
fails.
* sim-options.c (sim_parse_args): Issue an error and return SIM_RC_FAIL
diff --git a/sim/common/sim-hw.c b/sim/common/sim-hw.c
index 69c2b17..6cb406f 100644
--- a/sim/common/sim-hw.c
+++ b/sim/common/sim-hw.c
@@ -319,7 +319,7 @@ sim_hw_init (struct sim_state *sd)
static void
sim_hw_uninstall (struct sim_state *sd)
{
- /* hw_tree_delete (STATE_HW (sd)->tree); */
+ hw_tree_delete (STATE_HW (sd)->tree);
zfree (STATE_HW (sd));
STATE_HW (sd) = NULL;
}