This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch, moxie] fix SIM_DESC object initialization for the moxie sim.
- From: Anthony Green <green at moxielogic dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 13 Jan 2010 03:30:36 -0500
- Subject: [patch, moxie] fix SIM_DESC object initialization for the moxie sim.
I've checked in this patch to fix SIM_DESC object initialization in the
moxie sim.
AG
2010-01-13 Anthony Green <green@moxielogic.com>
* interp.c (sim_open): Initialize the SIM_DESC object properly
with sim_config() and sim_post_argv_init().
Index: sim/moxie/interp.c
===================================================================
RCS file: /cvs/src/src/sim/moxie/interp.c,v
retrieving revision 1.6
diff -u -r1.6 interp.c
--- sim/moxie/interp.c 1 Jan 2010 10:03:33 -0000 1.6
+++ sim/moxie/interp.c 13 Jan 2010 08:14:11 -0000
@@ -1176,6 +1176,22 @@
set_initial_gprs (); /* Reset the GPR registers. */
+ /* Configure/verify the target byte order and other runtime
+ configuration options */
+ if (sim_config (sd) != SIM_RC_OK)
+ {
+ sim_module_uninstall (sd);
+ return 0;
+ }
+
+ if (sim_post_argv_init (sd) != SIM_RC_OK)
+ {
+ /* Uninstall the modules to avoid memory leaks,
+ file descriptor leaks, etc. */
+ sim_module_uninstall (sd);
+ return 0;
+ }
+
return sd;
}