X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fbindings%2FGuile.cxx;h=12fd32f35befb6ec9885631e32ce9e6979de9fcb;hp=2552e7d215ab8b97e85edfc77a372a7fe13f6e2e;hb=8f48ae542e0031cc5d7efc425d696be6c2005181;hpb=7cc1f7b923b7859a7469e6a651d4a87bc48c4772 diff --git a/src/bindings/Guile.cxx b/src/bindings/Guile.cxx index 2552e7d..12fd32f 100644 --- a/src/bindings/Guile.cxx +++ b/src/bindings/Guile.cxx @@ -1,4 +1,5 @@ #include "Guile.hxx" +#include "Config.hxx" namespace { SCM handler (void*, SCM tag, SCM throw_args) { @@ -10,14 +11,10 @@ namespace { GuileInterpreter::GuileInterpreter() { scm_init_guile(); - scm_internal_catch(SCM_BOOL_T, - (SCM (*)(void *))scm_c_eval_string, - (void*)"(use-modules (system repl server))", - handler, NULL); - scm_internal_catch(SCM_BOOL_T, - (SCM (*)(void *))scm_c_eval_string, - (void*)"(spawn-server)", - handler, NULL); + scm_c_use_module("system repl server"); + scm_call_0(scm_c_public_ref("system repl server", "spawn-server")); + scm_c_load_extension("libguile-frida-binding", + "scm_init_frida_module"); guile_output_port = scm_open_output_string(); guile_error_port = scm_open_output_string(); @@ -50,3 +47,10 @@ int GuileInterpreter::evaluate(const std::string& command, return 0; } + +int GuileInterpreter::loadFile(const std::string& filename, + std::ostream& stdout, + std::ostream& stderr, + std::string& result) { + scm_c_primitive_load(filename.c_str()); +}