Fix disabling of model code when simulator does not support modeling.
authorAndrew Cagney <cagney@redhat.com>
Mon, 22 Sep 1997 09:16:14 +0000 (09:16 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 22 Sep 1997 09:16:14 +0000 (09:16 +0000)
Stops `-p' crashing simulators.

sim/common/ChangeLog
sim/common/sim-base.h

index b0e3a2edb61a3c14abf795967f6385ab52b4c9a3..a2eb578160e1cdd5358bed749f56da19d0f1abc9 100644 (file)
@@ -1,3 +1,21 @@
+Mon Sep 22 11:46:20 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * sim-base.h (STATE_MODEL): Make conditional on SIM_HAVE_MODEL.
+
+       * sim-profile.c (profile_print_insn): Check 0 .. MAX_INSN for any
+       insn count.  Make count conditional on there being a valid
+       INSN_NAME.
+       (profile_pc_init): Make default PC profile frequency an arbitrary
+       256.
+
+       * sim-base.h: Ditto.
+
+       * sim-profile.h (WITH_PROFILE_MODEL_P): Only enable modeling when
+       SIM_HAVE_MODEL.
+
+       * sim-model.h (struct MACH): Depreciate, to be replaced by bfd
+       archure struct.
+
 Mon Sep 22 11:46:20 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index f2b13d6262d552a1f8e8acb52508e76e4cbe1e54..21be8057b73adf86b8a00aeaa0e13d2c57fdf6c9 100644 (file)
@@ -70,10 +70,12 @@ typedef struct _sim_cpu sim_cpu;
 #include "sim-module.h"
 
 #include "sim-trace.h"
-#include "sim-profile.h"
-#include "sim-model.h"
 #include "sim-core.h"
 #include "sim-events.h"
+#include "sim-profile.h"
+#ifdef SIM_HAVE_MODEL
+#include "sim-model.h"
+#endif
 #include "sim-io.h"
 #include "sim-engine.h"
 #include "sim-watch.h"
@@ -136,10 +138,12 @@ typedef struct {
   MODULE_SUSPEND_LIST *suspend_list;
 #define STATE_SUSPEND_LIST(sd) ((sd)->base.suspend_list)
 
+#ifdef SIM_HAVE_MODEL
   /* ??? This might be more appropriate in sim_cpu.  */
   /* Machine tables for this cpu.  See sim-model.h.  */
   const MODEL *model;
 #define STATE_MODEL(sd) ((sd)->base.model)
+#endif
 
   /* Supported options.  */
   struct option_list *options;