[Ecls-list] The dreaded embedded debugger

aaron at pageofswords.net aaron at pageofswords.net
Tue Feb 22 06:07:48 UTC 2011


Hi, I am having a lot of trouble figuring out how to prevent the debugger
becoming active in embedded mode.

I have tried:
+ Calling ecl_disable_interrupts(); before cl_eval()
+ Executing the following in ecl: (setf *debugger-hook* #'debug-ignore)
+ And also this: (setf si::*interrupt-enable* nil)

Mmm... I want to evaluate something like
si_safe_eval(3,c_string_to_object("(vvvvformat t \"Hello\")"), Cnil,
OBJNULL);

and not have my program stop. Logging something would be fine.

When I execute the following code,


#define READCL(expr) (c_string_to_object(# expr))

int main(int argv, char* argv[]) {
char* exec_name = (char*) get_exec_name();
	cl_boot(1, &argv[0]);

	ecl_disable_interrupts();

	// Initialise the whispy-one lisp environment
	cl_eval(READCL((setf *debugger-hook* #'debug-ignore)));
	cl_eval(READCL((setf si::*interrupt-enable* nil)));

	// All good
	cl_eval(READCL((format t "Hello~%")));

	// Forces program to halt, reading from stdin
	cl_eval(READCL((vvvvformat t "Hello~%")));

	cl_shutdown();
}



I get this:
Hello

VVVVFORMAT
#<a UNDEFINED-FUNCTION>
Condition of type: SIMPLE-CONTROL-ERROR
Restart ABORT is not active.

No restarts available.

Top level in: #<process TOP-LEVEL>.
>

And my program is stuck. Logging something would be fine, but freezing the
program is no good.

Thanks in advance





More information about the ecl-devel mailing list