]> git.siccegge.de Git - frida/frida.git/blobdiff - src/core/Exception.hxx
Properly fail if no appropriate Disassembler can be constructed
[frida/frida.git] / src / core / Exception.hxx
diff --git a/src/core/Exception.hxx b/src/core/Exception.hxx
new file mode 100644 (file)
index 0000000..d1b0e67
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef INCLUDE__Exception_hxx_
+#define INCLUDE__Exception_hxx_
+
+#include <string>
+
+class Exception {
+public:
+       Exception () {}
+       // Exception (const Exception&) noexcept;
+       // exception& operator= (const exception&) noexcept;
+       virtual ~Exception() {}
+       virtual const char* what() const noexcept = 0;
+};
+
+class BinaryNotSupported {
+public:
+       BinaryNotSupported()
+               : message("This binary is not supported by this Disassembler") {}
+       BinaryNotSupported(const std::string& message)
+               : message("This binary is not supported by this Disassembler (" + message + ")") {}
+       const char* what() const {return message.c_str();}
+
+private:
+       std::string message;
+};             
+       
+#endif /* INCLUDE__Exception_hxx_ */