This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]