=================================================================== RCS file: /home/cvs/OpenXM/src/kxx/sm1stackmachine.c,v retrieving revision 1.5 retrieving revision 1.9 diff -u -p -r1.5 -r1.9 --- OpenXM/src/kxx/sm1stackmachine.c 2005/07/18 10:55:16 1.5 +++ OpenXM/src/kxx/sm1stackmachine.c 2020/10/07 07:47:23 1.9 @@ -1,11 +1,22 @@ #include #include +#include #include "ox_kan.h" #include "serversm.h" extern int OXprintMessage; extern char *MsgStackTrace; extern char *MsgSourceTrace; +extern struct object *MsgStackTraceInArrayp; +void KSstart(); // kan96xx/Kan/datatype.h +int KSexecuteString(char *s); // kan96xx/Kan/datatype.h +int Kan_pushCMOFromStream(FILE2 *fp); //kan96xx/Kan/plugin.h +int Kan_popCMOToStream(FILE2 *fp,int serial); // +int KgetCmoTagOfObject(struct object obj); // +int KSstackPointer(void); //kan96xx/Kan/extern.h +int Kan_setMathCapToStream(FILE2 *fp,struct object ob); // kan96xx/plugin/cmo.c + + /* server stack machine */ int Sm1_start(int argc, char *fnames[],char *myname) { @@ -140,7 +151,13 @@ int Sm1_popCMO(ox_stream fp,int serial) int Sm1_pushError2(int serial, int no, char *s) { struct object ob = OINIT; + struct object core = OINIT; + struct object core1 = OINIT; char *ss; + + ss = (char *)sGC_malloc(strlen(s)+1); + strcpy(ss,s); + /* char *error_message=""; char *message=""; char *stack_trace=""; @@ -171,7 +188,27 @@ int Sm1_pushError2(int serial, int no, char *s) strcat(ss,source_trace2); } strcat(ss,error_message2); - ob = KnewErrorPacket(serial,no,ss); + */ + + if (MsgStackTraceInArrayp != NULL) { + core = KSnewObjectArray(2); + core1 = KSnewObjectArray(2); + putoa(core1,0,KpoString("where")); /* keyword */ + putoa(core1,1,(*MsgStackTraceInArrayp)); + putoa(core,0,core1); + core1 = KSnewObjectArray(2); + putoa(core1,0,KpoString("reason_of_error")); /* keyword */ + putoa(core1,1,KpoString(s)); + putoa(core,1,core1); + }else{ + core = KSnewObjectArray(0); + } + ob = KSnewObjectArray(4); + putoa(ob,0,KpoInteger(serial)); putoa(ob,1,KpoInteger(no)); + putoa(ob,2,KpoString(ss)); + putoa(ob,3,core); + + ob = KnewErrorPacketObj(ob); KSpush(ob); }