[Commit] nickle ChangeLog, 1.71, 1.72 execute.c, 1.90, 1.91 func.c,
1.23, 1.24 sched.c, 1.55, 1.56
Keith Packard
commit at keithp.com
Sat Jun 19 12:56:56 PDT 2004
Committed by: keithp
Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv6217
Modified Files:
ChangeLog execute.c func.c sched.c
Log Message:
2004-06-19 Keith Packard <keithp at keithp.com>
* execute.c: (ThreadCall):
Tail call to lonjmp should not pop frame
* func.c: (FuncPrint):
Make 'g' format print only the declaration, leaving 'v' printing
the definition as well.
* sched.c: (do_Thread_list), (TraceFunction), (TraceFrame),
(TraceIndent), (ContinuationTrace), (RaiseException):
Clean up continuation debug code to include call trace
and adjust for changes since the last time it was used.
Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- ChangeLog 18 Jun 2004 00:30:32 -0000 1.71
+++ ChangeLog 19 Jun 2004 19:56:44 -0000 1.72
@@ -1,3 +1,17 @@
+2004-06-19 Keith Packard <keithp at keithp.com>
+
+ * execute.c: (ThreadCall):
+ Tail call to lonjmp should not pop frame
+
+ * func.c: (FuncPrint):
+ Make 'g' format print only the declaration, leaving 'v' printing
+ the definition as well.
+
+ * sched.c: (do_Thread_list), (TraceFunction), (TraceFrame),
+ (TraceIndent), (ContinuationTrace), (RaiseException):
+ Clean up continuation debug code to include call trace
+ and adjust for changes since the last time it was used.
+
2004-06-17 Keith Packard <keithp at keithp.com>
version 2.41
Index: execute.c
===================================================================
RCS file: /local/src/CVS/nickle/execute.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- execute.c 16 Apr 2004 21:41:52 -0000 1.90
+++ execute.c 19 Jun 2004 19:56:44 -0000 1.91
@@ -224,13 +224,16 @@
value = Void;
break;
}
- }
- if (tail && !aborting)
- {
- complete = True;
- thread->thread.continuation.obj = thread->thread.continuation.frame->saveObj;
- *next = thread->thread.continuation.frame->savePc;
- thread->thread.continuation.frame = thread->thread.continuation.frame->previous;
+ /*
+ * For a tail call, drop the topmost frame
+ */
+ if (tail && !aborting)
+ {
+ complete = True;
+ thread->thread.continuation.obj = thread->thread.continuation.frame->saveObj;
+ *next = thread->thread.continuation.frame->savePc;
+ thread->thread.continuation.frame = thread->thread.continuation.frame->previous;
+ }
}
}
else
Index: func.c
===================================================================
RCS file: /local/src/CVS/nickle/func.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- func.c 8 Jun 2004 09:30:54 -0000 1.23
+++ func.c 19 Jun 2004 19:56:45 -0000 1.24
@@ -115,7 +115,11 @@
static Bool
FuncPrint (Value f, Value av, char format, int base, int width, int prec, int fill)
{
- PrettyCode (f, av->func.code, 0, class_undef, publish_private, 0, True);
+ Bool nest = False;
+
+ if (format == 'v')
+ nest = True;
+ PrettyCode (f, av->func.code, 0, class_undef, publish_private, 0, nest);
return True;
}
Index: sched.c
===================================================================
RCS file: /local/src/CVS/nickle/sched.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- sched.c 16 Apr 2004 05:26:45 -0000 1.55
+++ sched.c 19 Jun 2004 19:56:45 -0000 1.56
@@ -218,7 +218,7 @@
FilePrintf (FileStdout, "\t%%%d", t->thread.id);
ThreadListState (t);
if (t->thread.sleep)
- FilePrintf (FileStdout, " %v", t->thread.sleep);
+ FilePrintf (FileStdout, " %g", t->thread.sleep);
FileOutput (FileStdout, '\n');
}
RETURN(Void);
@@ -362,7 +362,7 @@
{
if (fe)
FilePuts (file, ", ");
- FilePrintf (file, "%v", BoxValue (frame->frame, fe));
+ FilePrintf (file, "%g", BoxValue (frame->frame, fe));
}
FilePuts (file, ")\n");
}
@@ -381,7 +381,8 @@
int max;
CodePtr code;
- TraceStatement (file, ObjStatement (obj, pc));
+ if (obj && pc)
+ TraceStatement (file, ObjStatement (obj, pc));
for (max = depth; frame && max--; frame = frame->previous)
{
code = frame->function->func.code;
@@ -396,7 +397,7 @@
TraceIndent (int indent)
{
while (indent--)
- FilePuts (file, " ");
+ FilePuts (FileStdout, " ");
}
#endif
@@ -686,7 +687,7 @@
#ifdef DEBUG_JUMP
-void
+static void
ContinuationTrace (char *where, Continuation *continuation, int indent)
{
int s;
@@ -706,12 +707,16 @@
{
if (s)
FilePuts (FileStdout, ", ");
- FilePrintf (FileStdout, "%v", STACK_ELT(stack, s));
+ FilePrintf (FileStdout, "%g", STACK_ELT(stack, s));
}
FilePuts (FileStdout, "\n");
TraceIndent (indent);
+ FilePuts (FileStdout, "frame:\nCALLS\n");
+ TraceFrame (FileStdout, continuation->frame, obj, pc, 20);
+ FilePuts (FileStdout, "END CALLS\n");
+ TraceIndent (indent);
FilePuts (FileStdout, "catches: ");
- for (s = 0; catches; catches = catches->previous, s++)
+ for (s = 0; catches; catches = catches->continuation.catches, s++)
{
if (s)
FilePuts (FileStdout, ", ");
@@ -720,7 +725,10 @@
FilePuts (FileStdout, "\n");
TraceIndent (indent);
FilePuts (FileStdout, "statement: ");
- PrettyStat (FileStdout, ObjStatement (obj, pc), False);
+ if (obj && pc)
+ PrettyStat (FileStdout, ObjStatement (obj, pc), False);
+ else
+ FilePuts (FileStdout, "corrupted continuation!\n");
for (s = 0; twixts; twixts = twixts->continuation.twixts, s++)
{
ContinuationTrace ("twixt", &twixts->continuation, indent+1);
@@ -1072,7 +1080,7 @@
int dim = ArrayLimits(&args->array)[0];
for (i = 0; i < dim; i++)
{
- PrintError ("%v", ArrayValueGet (&args->array, i));
+ PrintError ("%g", ArrayValueGet (&args->array, i));
if (i < dim - 1)
PrintError (", ");
}
More information about the Commit
mailing list