summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@Minimulk.local>2008-08-24 18:54:47 +0200
committerMatthias Benkard <mulk@Minimulk.local>2008-08-24 18:54:47 +0200
commita34b771cd9cc823260407b2905312b3be05390db (patch)
tree735f7e0023c39dcaffa000b8a16a910ed9ec8716
parentf403bb6e9b0c64e2ce05eaf382c95884e753644e (diff)
Add a couple of debugging statements.
-rw-r--r--MLKInterpreter.m29
-rw-r--r--MLKReadEvalPrintLoop.m6
2 files changed, 24 insertions, 11 deletions
diff --git a/MLKInterpreter.m b/MLKInterpreter.m
index 9612ad4..f85bf21 100644
--- a/MLKInterpreter.m
+++ b/MLKInterpreter.m
@@ -173,24 +173,31 @@
{
NSArray *values;
-#define TRACE_EVAL 0
-#if TRACE_EVAL
+#if 0
BOOL trace = NO;
-
//if ([dynamicContext valueForSymbol:V_INITP])
// trace = YES;
//if (trace)
- NSLog (@"; EVAL: %@", MLKPrintToString(_form));
-#endif // TRACE_EVAL
-
+ NSLog (@"; EVAL END: %@", MLKPrintToString(_form));
values = [self reallyInterpretWithEnvironment:env];
-
-#if TRACE_EVAL
//if (trace)
- NSLog (@"; EVAL END: %@", MLKPrintToString(_form));
-#endif // TRACE_EVAL
-
+ NSLog (@"; EVAL: %@", MLKPrintToString(_form));
+#elif 1
+ NS_DURING
+ {
+ values = [self reallyInterpretWithEnvironment:env];
+ }
+ NS_HANDLER
+ {
+ NSLog (@"; BROKEN EVAL: %@", MLKPrintToString(_form));
+ [localException raise];
+ }
+ NS_ENDHANDLER;
+#else
+ values = [self reallyInterpretWithEnvironment:env];
+#endif
+
return values;
}
diff --git a/MLKReadEvalPrintLoop.m b/MLKReadEvalPrintLoop.m
index 53943bc..de2f4f1 100644
--- a/MLKReadEvalPrintLoop.m
+++ b/MLKReadEvalPrintLoop.m
@@ -98,8 +98,10 @@ static const char *prompt (EditLine *e) {
pool = [[NSAutoreleasePool alloc] init];
printf ("Loading init.lisp.\n");
+#if 1
NS_DURING
{
+#endif
input = [NSInputStream inputStreamWithFileAtPath:@"init.lisp"];
stream = LAUTORELEASE ([[MLKStream alloc] initWithInputStream:input]);
@@ -107,6 +109,7 @@ static const char *prompt (EditLine *e) {
[MLKInterpreter load:stream verbose:YES print:YES];
success = [MLKInterpreter load:stream verbose:YES print:YES];
[input close];
+#if 1
}
NS_HANDLER
{
@@ -115,6 +118,7 @@ static const char *prompt (EditLine *e) {
[[localException reason] UTF8String]);
}
NS_ENDHANDLER;
+#endif
printf ("Done.\n\n");
@@ -151,10 +155,12 @@ static const char *prompt (EditLine *e) {
#if 1
NS_DURING
#else
+#ifdef GNUSTEP
GSDebugAllocationActive (YES);
[NSObject enableDoubleReleaseCheck:YES];
NSZombieEnabled = YES;
#endif
+#endif
{
int i;