Fix ARI warning
[deliverable/binutils-gdb.git] / gdb / exceptions.c
index 9a10f665286ae6a3d9b0f407b8b932386af639ef..b0f28d9a97d8559185bdb0fd2a28b1aa7f27e176 100644 (file)
@@ -1,6 +1,6 @@
 /* Exception (throw catch) mechanism, for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2016 Free Software Foundation, Inc.
+   Copyright (C) 1986-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -256,3 +256,21 @@ catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
     return 0;
   return val;
 }
+
+/* See exceptions.h.  */
+
+int
+exception_print_same (struct gdb_exception e1, struct gdb_exception e2)
+{
+  const char *msg1 = e1.message;
+  const char *msg2 = e2.message;
+
+  if (msg1 == NULL)
+    msg1 = "";
+  if (msg2 == NULL)
+    msg2 = "";
+
+  return (e1.reason == e2.reason
+         && e1.error == e2.error
+         && strcmp (msg1, msg2) == 0);
+}
This page took 0.02431 seconds and 4 git commands to generate.