i386: Also check R12-R15 registers when optimizing testq to testb
[deliverable/binutils-gdb.git] / gdb / exceptions.c
index c9a1fa7236ce85df3f5c633678fb93d2b21d49b7..1ab290c9903659e32c4affed192d797c554ea6e2 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Local non-gdb includes.  */
-#include "annotate.h"
-#include "breakpoint.h"
-#include "common/gdb_optional.h"
 #include "exceptions.h"
-#include "gdbthread.h"
+#include "breakpoint.h"
+#include "target.h"
 #include "inferior.h"
+#include "annotate.h"
+#include "ui-out.h"
 #include "serial.h"
-#include "target.h"
+#include "gdbthread.h"
 #include "top.h"
-#include "ui-out.h"
+#include "gdbsupport/gdb_optional.h"
 
 static void
 print_flush (void)
@@ -76,14 +74,14 @@ print_flush (void)
 }
 
 static void
-print_exception (struct ui_file *file, struct gdb_exception e)
+print_exception (struct ui_file *file, const struct gdb_exception &e)
 {
-  /* KLUGE: cagney/2005-01-13: Write the string out one line at a time
+  /* KLUDGE: cagney/2005-01-13: Write the string out one line at a time
      as that way the MI's behavior is preserved.  */
   const char *start;
   const char *end;
 
-  for (start = e.message; start != NULL; start = end)
+  for (start = e.what (); start != NULL; start = end)
     {
       end = strchr (start, '\n');
       if (end == NULL)
@@ -112,7 +110,7 @@ print_exception (struct ui_file *file, struct gdb_exception e)
 }
 
 void
-exception_print (struct ui_file *file, struct gdb_exception e)
+exception_print (struct ui_file *file, const struct gdb_exception &e)
 {
   if (e.reason < 0 && e.message != NULL)
     {
@@ -122,7 +120,7 @@ exception_print (struct ui_file *file, struct gdb_exception e)
 }
 
 void
-exception_fprintf (struct ui_file *file, struct gdb_exception e,
+exception_fprintf (struct ui_file *file, const struct gdb_exception &e,
                   const char *prefix, ...)
 {
   if (e.reason < 0 && e.message != NULL)
@@ -143,15 +141,11 @@ exception_fprintf (struct ui_file *file, struct gdb_exception e,
 /* See exceptions.h.  */
 
 int
-exception_print_same (struct gdb_exception e1, struct gdb_exception e2)
+exception_print_same (const struct gdb_exception &e1,
+                     const struct gdb_exception &e2)
 {
-  const char *msg1 = e1.message;
-  const char *msg2 = e2.message;
-
-  if (msg1 == NULL)
-    msg1 = "";
-  if (msg2 == NULL)
-    msg2 = "";
+  const char *msg1 = e1.message == nullptr ? "" : e1.what ();
+  const char *msg2 = e2.message == nullptr ? "" : e2.what ();
 
   return (e1.reason == e2.reason
          && e1.error == e2.error
This page took 0.075193 seconds and 4 git commands to generate.