[Ecls-list] Overriding SI::SIGNAL-SIMPLE-ERROR (si_signal_simple_error) I cannot create handlers for FEprogram_error/FEcontrol_error/FEreader_error

Douglas R. Miles logicmoo at comcast.net
Mon Mar 13 10:23:01 UTC 2006


I am able to catch the many errors by fseting UNIVERSAL-ERROR-HANDLER with 

cl_def_c_function_va(ecl_find_symbol_nolock(
  make_constant_string("UNIVERSAL-ERROR-HANDLER "), 
  cl_core.system_package, &intern_flag), swi_prolog_error_handler);

I cannot seem to override SI::SIGNAL-SIMPLE-ERROR when triggered from
cl_eval(..)

The call trace is such


cl_eval->eval-with-env-> compile_form ->c_call-> asm_function
->FEprogram_error- si_signal_simple_error (conditions.d)



compile_form basically gets an error cannot be intercepted. an example of
such an eval might be "(1 2 3") will error during asm_function which it
cannot compile. But it isn't using UNIVERSAL-ERROR-HANDLER instead it is
using si_signal_simple_error


Which was emitted as such: conditions.c


/*	function definition for SIGNAL-SIMPLE-ERROR                   */
cl_object si_signal_simple_error(cl_narg narg, cl_object V1, cl_object V2,
cl_object V3, cl_object V4, ...)
{ VT40 VLEX40 CLSR40
	cl_object value0;
	if(narg<4) FEwrong_num_arguments_anonym();
	{
	cl_object V5;
	cl_va_list args; cl_va_start(args,V4,narg,4);
	V5=cl_grab_rest_args(args);
	{cl_object V6;                            /*  SIMPLE-ERROR-NAME
*/
	T0= cl_string(V1)                         /*  STRING
*/;
	T1= cl_concatenate(3,ECL_SYM("STRING",803),VV[49],T0) /*
CONCATENATE */;
	T2= cl_find_package(VV[50])               /*  FIND-PACKAGE
*/;
	V6= cl_intern(2,T1,T2)                    /*  INTERN
*/;
	if((cl_find_class(2,V6,Cnil)              /*  FIND-CLASS
*/)!=Cnil){
	goto L641;}
	T0= cl_list(2,ECL_SYM("SIMPLE-ERROR",768),V1) /*  LIST
*/;
	T1= cl_list(4,ECL_SYM("DEFCLASS",935),V6,T0,Cnil) /*  LIST
*/;
	(void)cl_eval(T1)                         /*  EVAL
*/;
L641:;
	if((V2)==Cnil){
	goto L647;}
	T0= (ECL_SYM("CERROR",200)->symbol.gfdef);
	
value0=cl_apply(8,T0,V2,V6,ECL_SYM("FORMAT-CONTROL",1236),V3,ECL_SYM("FORMAT
-ARGUMENTS",1235),V4,V5) /*  APPLY */;
	return value0;
L647:;
	T0= (ECL_SYM("ERROR",335)->symbol.gfdef);
	
value0=cl_apply(7,T0,V6,ECL_SYM("FORMAT-CONTROL",1236),V3,ECL_SYM("FORMAT-AR
GUMENTS",1235),V4,V5) /*  APPLY */;
	return value0;
	}
	}
}


One other issue is an access violation because that at VV == NULL at:
T1= cl_concatenate(3,ECL_SYM("STRING",803),VV[49],T0) /*  CONCATENATE  */

VV allocation never happened since I am guessing   init_ECL_CONDITIONS
(cl_object flag) never was called from cl_boot(.,.) so it might be how I am
linking.. 

How/when should I call init_ECL_CONDITIONS?

Thank you, Douglas







More information about the ecl-devel mailing list