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]

[commit sim/mn10300] Use sim_engine_abort() instead of abort()


Hello,

This patch changes an abort() call (in the mn10300 sim) to a sim_engine_abort() call, and then modifies the sim_engine_abort (et.al. declarations) so that they all have the noreturn attribute.

This gets rid of a mysterious code reaches end of non-void function warning I was seeing (but only on some systems).

committed,
Andrew
Index: common/ChangeLog
2003-02-26  Andrew Cagney  <cagney at redhat dot com>

	* sim-engine.h (sim_engine_abort): Add noreturn attribute.
	(sim_engine_vabort): Ditto.
	(sim_engine_halt, sim_engine_restart): Ditto.

Index: mn10300/ChangeLog
2003-02-26  Andrew Cagney  <cagney at redhat dot com>

	* am33.igen: Call sim_engine_abort instead of abort.

Index: common/sim-engine.h
===================================================================
RCS file: /cvs/src/src/sim/common/sim-engine.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sim-engine.h
--- common/sim-engine.h	16 Apr 1999 01:34:57 -0000	1.1.1.1
+++ common/sim-engine.h	26 Feb 2003 23:25:08 -0000
@@ -63,7 +63,7 @@
  sim_cpu *next_cpu, /* NULL -> succ (last_cpu) or event-mgr */
  sim_cia cia,
  enum sim_stop reason,
- int sigrc);
+ int sigrc) __attribute__ ((noreturn));
 
 /* Halt hook - allow target specific operation when halting a
    simulator */
@@ -116,14 +116,14 @@
  sim_cpu *cpu,
  sim_cia cia,
  const char *fmt,
- ...) __attribute__ ((format (printf, 4, 5)));
+ ...) __attribute__ ((format (printf, 4, 5))) __attribute__ ((noreturn));
 
 extern void sim_engine_vabort
 (SIM_DESC sd,
  sim_cpu *cpu,
  sim_cia cia,
  const char *fmt,
- va_list ap);
+ va_list ap) __attribute__ ((noreturn));
 
 /* No abort hook - when possible this function exits using the
    engine_halt function (and SIM_ENGINE_HALT_HOOK). */
Index: mn10300/am33.igen
===================================================================
RCS file: /cvs/src/src/sim/mn10300/am33.igen,v
retrieving revision 1.7
diff -u -r1.7 am33.igen
--- mn10300/am33.igen	9 Aug 2000 18:42:04 -0000	1.7
+++ mn10300/am33.igen	26 Feb 2003 23:25:08 -0000
@@ -34,7 +34,7 @@
     case 4:
       return REG_MCVF;
     default:
-      abort ();
+      sim_engine_abort (SD, CPU, cia, "%s:%d: bad switch\n", __FILE__, __LINE__);
     }
 }
 

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