Updated Serbian and Russian translations for various sub-directories
[binutils-gdb.git] / gdbsupport / common-exceptions.h
index 92f43d267ada3b384b8fd9535392a04f223a283c..5933c7356fe66f0dde12f8b3facb7f3c1e783c2e 100644 (file)
@@ -165,6 +165,23 @@ struct gdb_exception
     return message->c_str ();
   }
 
+  /* Compare two exceptions.  */
+  bool operator== (const gdb_exception &other) const
+  {
+    const char *msg1 = message == nullptr ? "" : what ();
+    const char *msg2 = other.message == nullptr ? "" : other.what ();
+
+    return (reason == other.reason
+           && error == other.error
+           && strcmp (msg1, msg2) == 0);
+  }
+
+  /* Compare two exceptions.  */
+  bool operator!= (const gdb_exception &other) const
+  {
+    return !(*this == other);
+  }
+
   enum return_reason reason;
   enum errors error;
   std::shared_ptr<std::string> message;