X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fbindings%2FGuile.cxx;h=fcc108349b55fa1afda71ad142f9e8bf15e79a72;hp=2552e7d215ab8b97e85edfc77a372a7fe13f6e2e;hb=adb0e762792c23674633b8513f4106b82aa38d15;hpb=7cc1f7b923b7859a7469e6a651d4a87bc48c4772 diff --git a/src/bindings/Guile.cxx b/src/bindings/Guile.cxx index 2552e7d..fcc1083 100644 --- a/src/bindings/Guile.cxx +++ b/src/bindings/Guile.cxx @@ -18,6 +18,10 @@ GuileInterpreter::GuileInterpreter() { (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); guile_output_port = scm_open_output_string(); guile_error_port = scm_open_output_string(); @@ -50,3 +54,11 @@ 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) { + return evaluate("(load \"" + filename + "\")", + stdout, stderr, result); +}