Debug: print interpreter address. Provide temporary dummy eval.

This commit is contained in:
Axel Naumann 2015-12-10 10:36:55 +01:00 committed by sftnight
parent d0cb5639ec
commit a76fe309dd

View File

@ -15,13 +15,19 @@ using TheInterpreter = void ;
/// Create an interpreter object.
TheInterpreter *cling_create(int argc, const char *argv[], const char* llvmdir) {
return new cling::Interpreter(argc, argv, llvmdir);
auto interp = new cling::Interpreter(argc, argv, llvmdir);
printf("Interpreter @%p\n", interp);
return interp;
}
/// Evaluate a string of code. Returns 0 on success.
int cling_eval_dummy(TheInterpreter *interpVP, const char *code) {
printf("Called cling_eval_dummy\n");
}
/// Evaluate a string of code. Returns 0 on success.
int cling_eval(TheInterpreter *interpVP, const char *code) {
cling::Interpreter *interp = (cling::Interpreter *) interpVP;
printf("Interpreter %s about to run \"%s\"\n", interp->getVersion(), code);
printf("Interpreter @%p about to run \"%s\"\n", interp, code);
cling::Value V;
cling::Interpreter::CompilationResult Res = interp->evaluate(code, V);
if (Res != cling::Interpreter::kSuccess)