Author: leo
Date: Thu Feb 23 08:49:23 2006
New Revision: 11709

Modified:
   trunk/src/objects.c
   trunk/src/pmc/coroutine.pmc
   trunk/src/pmc/retcontinuation.pmc
   trunk/src/pmc/sub.pmc
   trunk/src/warnings.c
Log:
trace - bring sub/return trace msg in sync with opcodes

Modified: trunk/src/objects.c
==============================================================================
--- trunk/src/objects.c (original)
+++ trunk/src/objects.c Thu Feb 23 08:49:23 2006
@@ -1092,6 +1092,8 @@ debug_trace_find_meth(Interp* interprete
 {
     STRING *class_name;
     const char *result;
+    Interp *tracer;
+
     if (!Interp_trace_TEST(interpreter, PARROT_TRACE_FIND_METH_FLAG))
         return;
     if (PObj_is_class_TEST(class)) {
@@ -1109,7 +1111,9 @@ debug_trace_find_meth(Interp* interprete
     }
     else
         result = "no";
-    PIO_eprintf(interpreter,
+    tracer = interpreter->debugger ? 
+        interpreter->debugger : interpreter;
+    PIO_eprintf(tracer,
             "# find_method class '%Ss' method '%Ss': %s\n",
             class_name, name, result);
 }

Modified: trunk/src/pmc/coroutine.pmc
==============================================================================
--- trunk/src/pmc/coroutine.pmc (original)
+++ trunk/src/pmc/coroutine.pmc Thu Feb 23 08:49:23 2006
@@ -66,18 +66,21 @@ static void
 print_sub_name(Interp* interpreter, PMC* sub)
 {
     struct Parrot_coro * co = PMC_coro(sub);
+    Interp *tracer;
 
-    PIO_eprintf(interpreter, "# %s coro '%Ss'",
+    tracer = interpreter->debugger ? 
+        interpreter->debugger : interpreter;
+    PIO_eprintf(tracer, "# %s coro '%Ss'",
         !(PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF) ? 
         "Calling" : "yielding from",
         Parrot_full_sub_name(interpreter, sub));
     if (co->ctx &&
         (PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF)) {
-        PIO_eprintf(interpreter, " to '%Ss'",
+        PIO_eprintf(tracer, " to '%Ss'",
                 Parrot_full_sub_name(interpreter, 
                     co->ctx->caller_ctx->current_sub));
     }
-    PIO_eprintf(interpreter, "\n# ");
+    PIO_eprintf(tracer, "\n# ");
     print_pbc_location(interpreter);
 }
 

Modified: trunk/src/pmc/retcontinuation.pmc
==============================================================================
--- trunk/src/pmc/retcontinuation.pmc   (original)
+++ trunk/src/pmc/retcontinuation.pmc   Thu Feb 23 08:49:23 2006
@@ -108,10 +108,14 @@ the frame pointer in the stack frame cac
 
         /* debug print before context is switched */
         if (Interp_trace_TEST(INTERP, PARROT_TRACE_SUB_CALL_FLAG)) {
+            Interp *tracer;
+
             PMC *to_sub = caller_ctx->current_sub;
             PMC *from_sub = cc->from_ctx->current_sub;
 
-            PIO_eprintf(INTERP, "# Back in sub '%Ss' from '%Ss'\n",
+            tracer = interpreter->debugger ? 
+                interpreter->debugger : interpreter;
+            PIO_eprintf(tracer, "# Back in sub '%Ss' from '%Ss'\n",
                     Parrot_full_sub_name(INTERP, to_sub),
                     Parrot_full_sub_name(INTERP, from_sub));
         }

Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc       (original)
+++ trunk/src/pmc/sub.pmc       Thu Feb 23 08:49:23 2006
@@ -57,9 +57,13 @@ clear_fixup(Interp* interpreter, PMC* se
 static void
 print_sub_name(Interp* interpreter, PMC* sub)
 {
+    Interp *tracer;
+
+    tracer = interpreter->debugger ? 
+        interpreter->debugger : interpreter;
 
         /* sub was located via globals */
-    PIO_eprintf(interpreter, "# Calling sub '%Ss'\n# ",
+    PIO_eprintf(tracer, "# Calling sub '%Ss'\n# ",
         Parrot_full_sub_name(interpreter, sub));
     print_pbc_location(interpreter);
 }

Modified: trunk/src/warnings.c
==============================================================================
--- trunk/src/warnings.c        (original)
+++ trunk/src/warnings.c        Thu Feb 23 08:49:23 2006
@@ -34,10 +34,15 @@ Prints the bytecode location of the warn
 */
 
 void
-print_pbc_location(Parrot_Interp inter)
+print_pbc_location(Parrot_Interp interpreter)
 {
-    PIO_eprintf(inter, "%Ss\n",
-            Parrot_Context_infostr(inter, CONTEXT(inter->ctx)));
+    Interp *tracer;
+
+    tracer = interpreter->debugger ? 
+        interpreter->debugger : interpreter;
+    PIO_eprintf(tracer, "%Ss\n",
+            Parrot_Context_infostr(interpreter, 
+                CONTEXT(interpreter->ctx)));
 }
 
 /*

Reply via email to