scm_init_guile();
scm_c_use_module("system repl server");
- guile::Geiser* geiser = new guile::Geiser(this);
+ geiser = new guile::Geiser(this);
geiser->start();
scm_c_load_extension("libguile-frida-binding",
LOG4CXX_INFO(logger, "Initializing GUILE finished");
}
+GuileInterpreter::~GuileInterpreter() {
+ geiser->terminate();
+ geiser->wait();
+}
+
int GuileInterpreter::evaluateWithErrorHandling(SCM (*fun)(void *),
void* data,
std::ostream& stdout,
#include "qt.hxx"
#include "Interpreter.hxx"
+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,
SCM guile_output_port;
SCM guile_error_port;
log4cxx::LoggerPtr logger;
+ guile::Geiser* geiser;
};
-namespace guile {
- class Geiser : public QThread {
- Q_OBJECT
- public:
- Geiser(QObject* parent) : QThread(parent) {}
- private:
- void run() Q_DECL_OVERRIDE;
- };
-}
-
-
#endif /* INCLUDE__Guile_hxx_ */