X-Git-Url: https://git.siccegge.de//index.cgi?a=blobdiff_plain;f=src%2Fbindings%2FGuile.cxx;h=12fd32f35befb6ec9885631e32ce9e6979de9fcb;hb=5d65588185f3d19fc6fa311f642cc5fd78966087;hp=fcc108349b55fa1afda71ad142f9e8bf15e79a72;hpb=adb0e762792c23674633b8513f4106b82aa38d15;p=frida%2Ffrida.git diff --git a/src/bindings/Guile.cxx b/src/bindings/Guile.cxx index fcc1083..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,18 +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_internal_catch(SCM_BOOL_T, - (SCM (*)(void *))scm_c_eval_string, - (void*)"(load-extension \"libfrida-guile\" \"scm_init_frida_module\")", - 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(); @@ -59,6 +52,5 @@ int GuileInterpreter::loadFile(const std::string& filename, std::ostream& stdout, std::ostream& stderr, std::string& result) { - return evaluate("(load \"" + filename + "\")", - stdout, stderr, result); + scm_c_primitive_load(filename.c_str()); }