From: Anthony Green Date: Wed, 13 Jan 2010 08:28:26 +0000 (+0000) Subject: Initialize SIM_DESC properly. X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=b8dcd18250faa7438fc2c9051849f2ac03264ad9;p=deliverable%2Fbinutils-gdb.git Initialize SIM_DESC properly. --- diff --git a/sim/moxie/ChangeLog b/sim/moxie/ChangeLog index c553855239..7a3c0fa085 100644 --- a/sim/moxie/ChangeLog +++ b/sim/moxie/ChangeLog @@ -1,3 +1,8 @@ +2010-01-13 Anthony Green + + * interp.c (sim_open): Initialize the SIM_DESC object properly + with sim_config() and sim_post_argv_init(). + 2010-01-09 Ralf Wildenhues * configure: Regenerate. diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index 8b8879f13b..8d280f2cc4 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -1176,6 +1176,22 @@ sim_open (kind, cb, abfd, argv) 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; }