]> git.siccegge.de Git - frida/frida.git/blobdiff - src/bindings/Guile.hxx
properly terminate guile thread
[frida/frida.git] / src / bindings / Guile.hxx
index 7c45a9549c56fa52b822db552223ba47a2e1d88d..63d5fcbafdad62bacbec6f8fbaa9c61fde1ba168 100644 (file)
@@ -2,12 +2,29 @@
 #define INCLUDE__Guile_hxx_
 
 #include <libguile.h>
+#include <log4cxx/logger.h>
 
+#include "qt.hxx"
 #include "Interpreter.hxx"
 
-class GuileInterpreter : public Interpreter {
+namespace guile {
+       class Geiser : public QThread {
+               Q_OBJECT
+       public:
+               Geiser(QObject* parent) : QThread(parent) {}
+               Geiser() {}
+       private:
+               void run() Q_DECL_OVERRIDE;
+       };
+}
+
+class GuileInterpreter : public QObject, public Interpreter {
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "xyz.frida.Interpreter")
+    Q_INTERFACES(Interpreter)
 public:
        GuileInterpreter();
+       virtual ~GuileInterpreter();
 
        int evaluate(const std::string& command,
                     std::ostream& stdout,
@@ -21,8 +38,16 @@ public:
 
        std::string fileExtension() const {return "scm";}
 private:
+       int evaluateWithErrorHandling(SCM (*fun)(void *),
+                                     void* data,
+                                     std::ostream& stdout,
+                                     std::ostream& stderr,
+                                     std::string& result);
+
        SCM guile_output_port;
        SCM guile_error_port;
+       log4cxx::LoggerPtr logger;
+       guile::Geiser* geiser;
 };
 
 #endif /* INCLUDE__Guile_hxx_ */