X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fbindings%2FGuile.cxx;h=78ad3805044600813dfaa2a3974a7eb1e66a871c;hp=fcc108349b55fa1afda71ad142f9e8bf15e79a72;hb=c81c0d3dba088b302187d7862a62ca88d2306e24;hpb=adb0e762792c23674633b8513f4106b82aa38d15 diff --git a/src/bindings/Guile.cxx b/src/bindings/Guile.cxx index fcc1083..78ad380 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,6 @@ 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()); + return 0; }