This is the mail archive of the gdb-patches@sources.redhat.com 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]: Fix HC11/HC12 simulator creation pb


Hi!

I've committed this fix from Marko (to avoid a crash when simulator fails
to initialize).

	Stephane

2002-08-13  Marko Kohtala  <marko.kohtala@luukku.com>

	* interp.c (sim_hw_configure): Return 1 for success.
	(sim_prepare_for_program): Use the sim_hw_configure exit code to
	return SIM_RC_FAIL.

Index: interp.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/interp.c,v
retrieving revision 1.11
diff -u -p -r1.11 interp.c
--- interp.c	13 Aug 2002 08:38:09 -0000	1.11
+++ interp.c	13 Aug 2002 08:45:52 -0000
@@ -166,7 +166,7 @@ sim_board_reset (SIM_DESC sd)
   cpu_restart (cpu);
 }
 
-int
+static int
 sim_hw_configure (SIM_DESC sd)
 {
   const struct bfd_arch_info *arch;
@@ -291,7 +291,7 @@ sim_hw_configure (SIM_DESC sd)
       sim_hw_parse (sd, "/m68hc12 > port-d cpu-write-port /m68hc12");
       cpu->hw_cpu = sim_hw_parse (sd, "/m68hc12");
     }
-  return 0;
+  return 1;
 }
 
 static int
@@ -301,7 +301,9 @@ sim_prepare_for_program (SIM_DESC sd, st
 
   cpu = STATE_CPU (sd, 0);
 
-  sim_hw_configure (sd);
+  if (!sim_hw_configure (sd))
+    return SIM_RC_FAIL;
+
   if (abfd != NULL)
     {
       cpu->cpu_elf_start = bfd_get_start_address (abfd);

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