Move exception_none to common code, and use it
authorPedro Alves <palves@redhat.com>
Mon, 9 Feb 2015 14:59:12 +0000 (14:59 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 27 Feb 2015 17:43:10 +0000 (17:43 +0000)
gdb/ChangeLog:
2015-02-27  Pedro Alves  <palves@redhat.com>

* common/common-exceptions.h (exception_none): Declare.
* common/common-exceptions.c (exception_none): Moved from
exceptions.c.
(exceptions_state_mc_init): Use exception_none.
* exceptions.c (exception_none): Move to
common/common-exceptions.c.
* exceptions.h (exception_none): Move to
common/common-exceptions.h.

gdb/ChangeLog
gdb/common/common-exceptions.c
gdb/common/common-exceptions.h
gdb/exceptions.c
gdb/exceptions.h

index 39ae8a4b3fc3a3e8935a43f259cae2664572e7f1..81ee82cfce8756b947d04200f718afc33feb7eba 100644 (file)
@@ -1,3 +1,14 @@
+2015-02-27  Pedro Alves  <palves@redhat.com>
+
+       * common/common-exceptions.h (exception_none): Declare.
+       * common/common-exceptions.c (exception_none): Moved from
+       exceptions.c.
+       (exceptions_state_mc_init): Use exception_none.
+       * exceptions.c (exception_none): Move to
+       common/common-exceptions.c.
+       * exceptions.h (exception_none): Move to
+       common/common-exceptions.h.
+
 2015-02-27  Pedro Alves  <palves@redhat.com>
 
        * main.c (catch_command_errors, catch_command_errors_const):
index 4308b91184ce4145c9c1900ca911fd272c16a9d1..b65f259df0b213485ff6273485fb6e1efcca3edc 100644 (file)
@@ -20,6 +20,8 @@
 #include "common-defs.h"
 #include "common-exceptions.h"
 
+const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
+
 /* Possible catcher states.  */
 enum catcher_state {
   /* Initial state, a new catcher has just been created.  */
@@ -78,9 +80,7 @@ exceptions_state_mc_init (volatile struct gdb_exception *exception,
   struct catcher *new_catcher = XCNEW (struct catcher);
 
   /* Start with no exception, save it's address.  */
-  exception->reason = 0;
-  exception->error = GDB_NO_ERROR;
-  exception->message = NULL;
+  *exception = exception_none;
   new_catcher->exception = exception;
 
   new_catcher->mask = mask;
index e349ed087f5d7dd92282eefa6f8c86fe4ab35c51..a32e6f96a209a8351c2aa7c5aa64853f872c9856 100644 (file)
@@ -188,4 +188,7 @@ extern void throw_error (enum errors error, const char *fmt, ...)
 extern void throw_quit (const char *fmt, ...)
      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
 
+/* A pre-defined non-exception.  */
+extern const struct gdb_exception exception_none;
+
 #endif /* COMMON_EXCEPTIONS_H */
index 91ca7d5b2f6a0958886cdb874a806b0dfe1906de..0ca4c5653d8af7dfcdd048cdef5ae0bc7504a6d9 100644 (file)
@@ -27,8 +27,6 @@
 #include "serial.h"
 #include "gdbthread.h"
 
-const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
-
 void
 prepare_to_throw_exception (void)
 {
index 9718573127582659e67333d98ec3a62426abd3f5..3b0dbace7b77c2fed863319f6173cfe31c78736b 100644 (file)
@@ -22,9 +22,6 @@
 
 #include "ui-out.h"
 
-/* A pre-defined non-exception.  */
-extern const struct gdb_exception exception_none;
-
 /* If E is an exception, print it's error message on the specified
    stream.  For _fprintf, prefix the message with PREFIX...  */
 extern void exception_print (struct ui_file *file, struct gdb_exception e);
This page took 0.119865 seconds and 4 git commands to generate.