[svn:parrot] r38253 - in branches/headercleanup: . config/auto include/parrot src src/runcore

chromatic at svn.parrot.org chromatic at svn.parrot.org
Tue Apr 21 21:10:15 UTC 2009


Author: chromatic
Date: Tue Apr 21 21:10:14 2009
New Revision: 38253
URL: https://trac.parrot.org/parrot/changeset/38253

Log:
[runcore] Moved src/trace.c to src/runcore/trace.c and its header to
include/parrot/runcore_trace.h.  These files exist only to support the tracing
runcore, so they're there now.

Added:
   branches/headercleanup/include/parrot/runcore_trace.h   (contents, props changed)
      - copied, changed from r38251, branches/headercleanup/src/trace.h
   branches/headercleanup/src/runcore/trace.c   (contents, props changed)
      - copied, changed from r38251, branches/headercleanup/src/trace.c
Deleted:
   branches/headercleanup/src/trace.c
   branches/headercleanup/src/trace.h
Modified:
   branches/headercleanup/MANIFEST
   branches/headercleanup/config/auto/cgoto.pm
   branches/headercleanup/src/debug.c
   branches/headercleanup/src/runcore/cores.c

Modified: branches/headercleanup/MANIFEST
==============================================================================
--- branches/headercleanup/MANIFEST	Tue Apr 21 21:09:19 2009	(r38252)
+++ branches/headercleanup/MANIFEST	Tue Apr 21 21:10:14 2009	(r38253)
@@ -981,6 +981,7 @@
 include/parrot/register.h                                   [main]include
 include/parrot/resources.h                                  [main]include
 include/parrot/runcore_api.h                                [main]include
+include/parrot/runcore_trace.h                              [main]include
 include/parrot/scheduler.h                                  [main]include
 include/parrot/scheduler_private.h                          [main]include
 include/parrot/settings.h                                   [main]include
@@ -1453,6 +1454,7 @@
 src/pmc_freeze.c                                            []
 src/runcore/main.c                                          []
 src/runcore/cores.c                                         []
+src/runcore/trace.c                                         []
 src/scheduler.c                                             []
 src/spf_render.c                                            []
 src/spf_vtable.c                                            []
@@ -1482,8 +1484,6 @@
 src/string/unicode.h                                        []
 src/sub.c                                                   []
 src/thread.c                                                []
-src/trace.c                                                 []
-src/trace.h                                                 []
 src/tsq.c                                                   []
 src/utils.c                                                 []
 src/vtable.tbl                                              [devel]src

Modified: branches/headercleanup/config/auto/cgoto.pm
==============================================================================
--- branches/headercleanup/config/auto/cgoto.pm	Tue Apr 21 21:09:19 2009	(r38252)
+++ branches/headercleanup/config/auto/cgoto.pm	Tue Apr 21 21:10:14 2009	(r38253)
@@ -64,7 +64,7 @@
 
 $(OPS_DIR)/core_ops_cg$(O): $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_cg.c
 $(OPS_DIR)/core_ops_cgp$(O): $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_cgp.c
-$(SRC_DIR)/runcore/cores.c: $(INC_DIR)/oplib/core_ops_cgp.h $(SRC_DIR)/trace.h
+$(SRC_DIR)/runcore/cores.c: $(INC_DIR)/oplib/core_ops_cgp.h
 
 $(INC_DIR)/oplib/core_ops_cg.h: $(OPS_DIR)/core_ops_cg.c
 

Copied and modified: branches/headercleanup/include/parrot/runcore_trace.h (from r38251, branches/headercleanup/src/trace.h)
==============================================================================
--- branches/headercleanup/src/trace.h	Tue Apr 21 20:42:52 2009	(r38251, copy source)
+++ branches/headercleanup/include/parrot/runcore_trace.h	Tue Apr 21 21:10:14 2009	(r38253)
@@ -1,9 +1,9 @@
-/* trace.h
+/* runcore_trace.h
  *  Copyright (C) 2001-2009, Parrot Foundation.
  *  SVN Info
  *     $Id$
  *  Overview:
- *     Tracing support for src/runops/cores.c.
+ *     Tracing runcore.
  *  Data Structure and Algorithms:
  *  History:
  *  Notes:
@@ -15,7 +15,7 @@
 
 #include "parrot/parrot.h"
 
-/* HEADERIZER BEGIN: src/trace.c */
+/* HEADERIZER BEGIN: src/runcore/trace.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 int trace_key_dump(PARROT_INTERP, ARGIN(PMC *key))
@@ -54,7 +54,7 @@
 #define ASSERT_ARGS_trace_pmc_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/trace.c */
+/* HEADERIZER END: src/runcore/trace.c */
 
 #endif /* PARROT_TRACE_H_GUARD */
 

Modified: branches/headercleanup/src/debug.c
==============================================================================
--- branches/headercleanup/src/debug.c	Tue Apr 21 21:09:19 2009	(r38252)
+++ branches/headercleanup/src/debug.c	Tue Apr 21 21:10:14 2009	(r38253)
@@ -29,7 +29,7 @@
 #include "parrot/oplib/ops.h"
 #include "pmc/pmc_key.h"
 #include "parrot/runcore_api.h"
-#include "trace.h"
+#include "parrot/runcore_trace.h"
 #include "debug.str"
 #include "pmc/pmc_continuation.h"
 

Modified: branches/headercleanup/src/runcore/cores.c
==============================================================================
--- branches/headercleanup/src/runcore/cores.c	Tue Apr 21 21:09:19 2009	(r38252)
+++ branches/headercleanup/src/runcore/cores.c	Tue Apr 21 21:10:14 2009	(r38253)
@@ -240,7 +240,7 @@
 
 #include "parrot/runcore_api.h"
 #include "parrot/embed.h"
-#include "../trace.h"
+#include "parrot/runcore_trace.h"
 
 #ifdef HAVE_COMPUTED_GOTO
 #  include "parrot/oplib/core_ops_cg.h"

Copied and modified: branches/headercleanup/src/runcore/trace.c (from r38251, branches/headercleanup/src/trace.c)
==============================================================================
--- branches/headercleanup/src/trace.c	Tue Apr 21 20:42:52 2009	(r38251, copy source)
+++ branches/headercleanup/src/runcore/trace.c	Tue Apr 21 21:10:14 2009	(r38253)
@@ -23,9 +23,9 @@
 
 */
 
-#include "trace.h"
+#include "parrot/runcore_trace.h"
 #include "parrot/oplib/ops.h"
-#include "pmc/pmc_sub.h"
+#include "../pmc/pmc_sub.h"
 
 /* HEADERIZER HFILE: src/trace.h */
 

Deleted: branches/headercleanup/src/trace.c
==============================================================================
--- branches/headercleanup/src/trace.c	Tue Apr 21 21:10:14 2009	(r38252)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,528 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/trace.c - Tracing
-
-=head1 DESCRIPTION
-
-Tracing support for the C<runops_slow_core()> function in
-F<src/runcore/cores.c>.
-
-This is turned on with Parrot's C<-t> option.
-
-src/test_main.c
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "trace.h"
-#include "parrot/oplib/ops.h"
-#include "pmc/pmc_sub.h"
-
-/* HEADERIZER HFILE: src/trace.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static STRING* trace_class_name(PARROT_INTERP, ARGIN(const PMC* pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_trace_class_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-
-/*
-
-=item C<static STRING* trace_class_name(PARROT_INTERP, const PMC* pmc)>
-
-Obtains the class name of the PMC.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static STRING*
-trace_class_name(PARROT_INTERP, ARGIN(const PMC* pmc))
-{
-    ASSERT_ARGS(trace_class_name)
-    STRING *class_name;
-    if (PObj_is_class_TEST(pmc)) {
-        SLOTTYPE * const class_array = (SLOTTYPE *)PMC_data(pmc);
-        PMC * const class_name_pmc = get_attrib_num(class_array,
-                                                    PCD_CLASS_NAME);
-        class_name = VTABLE_get_string(interp, class_name_pmc);
-    }
-    else
-        class_name = pmc->vtable->whoami;
-    return class_name;
-}
-
-/*
-
-=item C<void trace_pmc_dump(PARROT_INTERP, PMC *pmc)>
-
-Prints a PMC to C<stderr>.
-
-=cut
-
-*/
-
-void
-trace_pmc_dump(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc))
-{
-    ASSERT_ARGS(trace_pmc_dump)
-    Interp * const debugger = interp->pdb->debugger;
-    Parrot_sub    *sub;
-
-    if (!pmc) {
-        Parrot_io_eprintf(debugger, "(null)");
-        return;
-    }
-    if (PMC_IS_NULL(pmc))  {
-        Parrot_io_eprintf(debugger, "PMCNULL");
-        return;
-    }
-    if (!pmc->vtable || (UINTVAL)pmc->vtable == 0xdeadbeef) {
-        Parrot_io_eprintf(debugger, "<!!no vtable!!>");
-        return;
-    }
-    if (PObj_on_free_list_TEST(pmc)) {
-        Parrot_io_eprintf(debugger, "**************** PMC is on free list *****\n");
-    }
-    if (pmc->vtable->pmc_class == pmc) {
-        STRING * const name = trace_class_name(interp, pmc);
-        Parrot_io_eprintf(debugger, "Class=%Ss:PMC(%#p)", name, pmc);
-    }
-    else if (pmc->vtable->base_type == enum_class_String) {
-        const STRING * const s = VTABLE_get_string(interp, pmc);
-        if (!s)
-            Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:(NULL))",
-                    VTABLE_name(interp, pmc), pmc);
-        else {
-            STRING* const escaped = Parrot_str_escape_truncate(
-                            interp, s, 20);
-            if (escaped)
-                Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:\"%Ss\")",
-                    VTABLE_name(interp, pmc), pmc,
-                    escaped);
-            else
-                Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:\"(null)\")",
-                    VTABLE_name(interp, pmc), pmc);
-        }
-    }
-    else if (pmc->vtable->base_type == enum_class_Boolean) {
-        Parrot_io_eprintf(debugger, "Boolean=PMC(%#p: %d)",
-                pmc, VTABLE_get_integer(interp, pmc));
-    }
-    else if (pmc->vtable->base_type == enum_class_Integer) {
-        Parrot_io_eprintf(debugger, "Integer=PMC(%#p: %d)",
-                pmc, VTABLE_get_integer(interp, pmc));
-    }
-    else if (pmc->vtable->base_type == enum_class_BigInt) {
-        STRING * const s = VTABLE_get_string(interp, pmc);
-        Parrot_io_eprintf(debugger, "BigInt=PMC(%#p: %Ss)",
-                pmc, s);
-    }
-    else if (pmc->vtable->base_type == enum_class_Complex) {
-        STRING * const s = VTABLE_get_string(interp, pmc);
-        Parrot_io_eprintf(debugger, "Complex=PMC(%#p: %Ss)",
-                pmc, s);
-    }
-    else if (pmc->vtable->base_type == enum_class_RetContinuation
-            ||  pmc->vtable->base_type == enum_class_Continuation
-            ||  pmc->vtable->base_type == enum_class_Sub) {
-        PMC_get_sub(interp, pmc, sub);
-        Parrot_io_eprintf(debugger, "%S=PMC(%#p pc:%d)",
-                VTABLE_name(interp, pmc), pmc, sub->start_offs);
-    }
-    else if (PObj_is_object_TEST(pmc)) {
-        Parrot_io_eprintf(debugger, "Object(%Ss)=PMC(%#p)",
-                VTABLE_get_string(interp, VTABLE_get_class(interp, pmc)), pmc);
-    }
-    else {
-        Parrot_io_eprintf(debugger, "%S=PMC(%#p)",
-                VTABLE_name(interp, pmc), pmc);
-    }
-}
-
-/*
-
-=item C<int trace_key_dump(PARROT_INTERP, PMC *key)>
-
-Prints a key to C<stderr>, returns the length of the output.
-
-=cut
-
-*/
-
-int
-trace_key_dump(PARROT_INTERP, ARGIN(PMC *key))
-{
-    ASSERT_ARGS(trace_key_dump)
-    Interp * const debugger = interp->pdb->debugger;
-
-    int len = Parrot_io_eprintf(debugger, "[");
-
-    while (key) {
-        switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
-        case KEY_integer_FLAG:
-            len += Parrot_io_eprintf(debugger, "%vi", VTABLE_get_integer(interp, key));
-            break;
-        case KEY_number_FLAG:
-            len += Parrot_io_eprintf(debugger, "%vg", VTABLE_get_number(interp, key));
-            break;
-        case KEY_string_FLAG:
-            {
-            const STRING * const s = key_string(interp, key);
-            STRING* const escaped = Parrot_str_escape_truncate(
-                            interp, s, 20);
-            if (escaped)
-                len += Parrot_io_eprintf(debugger, "\"%Ss\"", escaped);
-            else
-                len += Parrot_io_eprintf(debugger, "\"(null)\"");
-            }
-            break;
-        case KEY_integer_FLAG|KEY_register_FLAG:
-            len += Parrot_io_eprintf(debugger, "I%vd=%vd", VTABLE_get_integer(interp, key),
-                    REG_INT(interp, VTABLE_get_integer(interp, key)));
-            break;
-        case KEY_number_FLAG|KEY_register_FLAG:
-            len += Parrot_io_eprintf(debugger, "I%vd=%vd", VTABLE_get_integer(interp, key),
-                    REG_NUM(interp, VTABLE_get_integer(interp, key)));
-            break;
-        case KEY_string_FLAG|KEY_register_FLAG:
-            {
-            const STRING * const s = REG_STR(interp, VTABLE_get_integer(interp, key));
-            STRING* const escaped = Parrot_str_escape_truncate(
-                            interp, s, 20);
-            if (escaped)
-                len += Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", VTABLE_get_integer(interp, key),
-                        escaped);
-            else
-                len += Parrot_io_eprintf(debugger, "S%vd=\"(null)\"",
-                        VTABLE_get_integer(interp, key));
-            }
-            break;
-        case KEY_pmc_FLAG|KEY_register_FLAG:
-            len += Parrot_io_eprintf(debugger, "P%vd=", VTABLE_get_integer(interp, key));
-            trace_pmc_dump(debugger, REG_PMC(interp, VTABLE_get_integer(interp, key)));
-            break;
-        default:
-            len += Parrot_io_eprintf(debugger, "??");
-            key = NULL;
-            break;
-        }
-
-        if (key) {
-            key = (PMC *)PMC_data(key);
-            if (key)
-                len += Parrot_io_eprintf(debugger, ";");
-        }
-    } /* while */
-
-    len += Parrot_io_eprintf(debugger, "]");
-    return len;
-}
-
-/*
-
-=item C<void trace_op_dump(PARROT_INTERP, const opcode_t *code_start, const
-opcode_t *pc)>
-
-Prints the PC, OP and ARGS. Used by C<trace_op()>.
-
-I<Not really part of the API.>
-
-=cut
-
-*/
-
-void
-trace_op_dump(PARROT_INTERP,
-        ARGIN(const opcode_t *code_start),
-        ARGIN(const opcode_t *pc))
-{
-    ASSERT_ARGS(trace_op_dump)
-    INTVAL s, n;
-    int more = 0, var_args;
-    Interp * const debugger = interp->pdb->debugger;
-    op_info_t * const info = &interp->op_info_table[*pc];
-    PMC *sig;
-    int type;
-    int len;
-#define ARGS_COLUMN 40
-
-    PARROT_ASSERT(debugger);
-    sig = NULL; /* silence compiler uninit warning */
-
-    s = 1;
-    len = Parrot_io_eprintf(debugger, "%6vu ", (UINTVAL)(pc - code_start));
-    if (STREQ(info->name, "infix")) {
-        /* this should rather be MMD_opcode_name, which doesn't
-         * exit yet
-         */
-        len += Parrot_io_eprintf(debugger, "%s",
-                Parrot_MMD_method_name(interp, pc[1]) + 2);
-        s = 2;
-    }
-    else if (STREQ(info->name, "n_infix")) {
-        len += Parrot_io_eprintf(debugger, "n_%s",
-                Parrot_MMD_method_name(interp, pc[1]) + 2);
-        s = 2;
-    }
-    else
-        len += Parrot_io_eprintf(debugger, "%s", info->name);
-
-    n = info->op_count;
-    var_args = 0;
-
-    if (*pc == PARROT_OP_set_args_pc ||
-            *pc == PARROT_OP_get_results_pc ||
-            *pc == PARROT_OP_get_params_pc ||
-            *pc == PARROT_OP_set_returns_pc) {
-        sig = interp->code->const_table->constants[pc[1]]->u.key;
-
-        if (!sig)
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "NULL sig PMC detected in trace_op_dump");
-
-        var_args = VTABLE_elements(interp, sig);
-        n += var_args;
-    }
-
-    if (n > 1) {
-        INTVAL i;
-        len += Parrot_io_eprintf(debugger, " ");
-        /* pass 1 print arguments */
-        for (i = s; i < n; i++) {
-            const opcode_t o = pc[i];
-            if (i < info->op_count) {
-                type = info->types[i - 1];
-            }
-            else {
-                if (!sig)
-                    Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                        "NULL sig PMC detected in trace_op_dump");
-
-                type = VTABLE_get_integer_keyed_int(interp, sig, i - 2) &
-                    (PARROT_ARG_TYPE_MASK|PARROT_ARG_CONSTANT);
-            }
-            if (i > s &&
-                    type != PARROT_ARG_KC &&
-                    type != PARROT_ARG_KIC &&
-                    type != PARROT_ARG_KI &&
-                    type != PARROT_ARG_K) {
-                len += Parrot_io_eprintf(debugger, ", ");
-            }
-            switch (type) {
-                case PARROT_ARG_IC:
-                    len += Parrot_io_eprintf(debugger, "%vd", o);
-                    break;
-                case PARROT_ARG_NC:
-                    len += Parrot_io_eprintf(debugger, "%vg", PCONST(o)->u.number);
-                    break;
-                case PARROT_ARG_PC:
-                    if (var_args)
-                        len += Parrot_io_eprintf(debugger, "PC%d (%d)",
-                                (int)o, var_args);
-                    else
-                        len += Parrot_io_eprintf(debugger, "PC%d", (int)o);
-                    break;
-                case PARROT_ARG_SC:
-                    {
-                    STRING* const escaped = Parrot_str_escape_truncate(
-                            interp,
-                            PCONST(o)->u.string, 20);
-                    if (escaped)
-                        len += Parrot_io_eprintf(debugger, "\"%Ss\"", escaped);
-                    else
-                        len += Parrot_io_eprintf(debugger, "\"(null)\"");
-                    }
-                    break;
-                case PARROT_ARG_KC:
-                    len += trace_key_dump(interp, PCONST(o)->u.key);
-                    break;
-                case PARROT_ARG_KIC:
-                    len += Parrot_io_eprintf(debugger, "[%vd]", o);
-                    break;
-                case PARROT_ARG_KI:
-                    len += Parrot_io_eprintf(debugger, "[I%vd]", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_K:
-                    len += Parrot_io_eprintf(debugger, "[P%vd]", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_I:
-                    len += Parrot_io_eprintf(debugger, "I%vd", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_N:
-                    len += Parrot_io_eprintf(debugger, "N%vd", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_P:
-                    len += Parrot_io_eprintf(debugger, "P%vd", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_S:
-                    len += Parrot_io_eprintf(debugger, "S%vd", o);
-                    more = 1;
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                        "unhandled type in trace");
-                    break;
-            }
-        }
-        if (!more)
-            goto done;
-        if (len < ARGS_COLUMN)  {
-            STRING * const fill = Parrot_str_repeat(debugger,
-                    Parrot_str_new_constant(debugger, " "),
-                    ARGS_COLUMN);
-            Parrot_io_putps(debugger, Parrot_io_STDERR(debugger), fill);
-        }
-        else {
-            Parrot_io_eprintf(debugger, "\t");
-        }
-
-        /* pass 2 print argument details if needed */
-        for (i = 1; i < n; i++) {
-            const opcode_t o = pc[i];
-            if (i < info->op_count)
-                type = info->types[i - 1];
-            else
-                type = VTABLE_get_integer_keyed_int(interp, sig, i - 2) &
-                    (PARROT_ARG_TYPE_MASK|PARROT_ARG_CONSTANT);
-            if (i > s) {
-                Parrot_io_eprintf(debugger, " ");
-            }
-            switch (type) {
-                case PARROT_ARG_I:
-                    Parrot_io_eprintf(debugger, "I%vd=%vd", o, REG_INT(interp, o));
-                    break;
-                case PARROT_ARG_N:
-                    Parrot_io_eprintf(debugger, "N%vd=%vf", o, REG_NUM(interp, o));
-                    break;
-                case PARROT_ARG_PC:
-                    Parrot_io_eprintf(debugger, "PC%vd=", o);
-                    trace_pmc_dump(interp, PCONST(o)->u.key);
-                    break;
-                case PARROT_ARG_P:
-                    Parrot_io_eprintf(debugger, "P%vd=", o);
-                    trace_pmc_dump(interp, REG_PMC(interp, o));
-                    break;
-                case PARROT_ARG_S:
-                    if (REG_STR(interp, o)) {
-                        STRING* const escaped = Parrot_str_escape_truncate(
-                                interp, REG_STR(interp, o), 20);
-                        Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", o,
-                                escaped);
-                    }
-                    else
-                        Parrot_io_eprintf(debugger, "S%vd=\"(null)\"", o);
-                    break;
-                case PARROT_ARG_K:
-                    Parrot_io_eprintf(debugger, "P%vd=", o);
-                    trace_key_dump(interp, REG_PMC(interp, *(pc + i)));
-                    break;
-                case PARROT_ARG_KI:
-                    Parrot_io_eprintf(debugger, "I%vd=[%vd]", o, REG_INT(interp, o));
-                    break;
-                default:
-                    break;
-            }
-        }
-    }
-done:
-
-    if (interp->code->annotations) {
-        PMC *annot = PackFile_Annotations_lookup(interp, interp->code->annotations,
-                pc - code_start + 1, NULL);
-        if (!PMC_IS_NULL(annot)) {
-            PMC *pfile = VTABLE_get_pmc_keyed_str(interp, annot,
-                    Parrot_str_new_constant(interp, "file"));
-            PMC *pline = VTABLE_get_pmc_keyed_str(interp, annot,
-                    Parrot_str_new_constant(interp, "line"));
-            if ((!PMC_IS_NULL(pfile)) && (!PMC_IS_NULL(pline))) {
-                /* The debugger interpreter may not be the same as
-                 * the main interpreter, extract values from the
-                 * PMC instad of passing them directly
-                 */
-                STRING *file = VTABLE_get_string(interp, pfile);
-                INTVAL line = VTABLE_get_integer(interp, pline);
-                Parrot_io_eprintf(debugger, " (%Ss:%li)", file, (long)line);
-            }
-        }
-    }
-
-    Parrot_io_eprintf(debugger, "\n");
-}
-
-/*
-
-=item C<void trace_op(PARROT_INTERP, const opcode_t *code_start, const opcode_t
-*code_end, const opcode_t *pc)>
-
-Prints the PC, OP and ARGS. Used by C<runops_trace()>. With bounds
-checking.
-
-I<Not really part of the API.>
-
-=cut
-
-*/
-
-void
-trace_op(PARROT_INTERP,
-        ARGIN(const opcode_t *code_start),
-        ARGIN(const opcode_t *code_end),
-        ARGIN_NULLOK(const opcode_t *pc))
-{
-    ASSERT_ARGS(trace_op)
-    if (!pc) {
-        return;
-    }
-
-    if (pc >= code_start && pc < code_end)
-        trace_op_dump(interp, code_start, pc);
-    else
-        Parrot_io_eprintf(interp, "PC=%ld; OP=<err>\n", (long)(pc - code_start));
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/trace.h>
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/headercleanup/src/trace.h
==============================================================================
--- branches/headercleanup/src/trace.h	Tue Apr 21 21:10:14 2009	(r38252)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,67 +0,0 @@
-/* trace.h
- *  Copyright (C) 2001-2009, Parrot Foundation.
- *  SVN Info
- *     $Id$
- *  Overview:
- *     Tracing support for src/runops/cores.c.
- *  Data Structure and Algorithms:
- *  History:
- *  Notes:
- *  References:
- */
-
-#ifndef PARROT_TRACE_H_GUARD
-#define PARROT_TRACE_H_GUARD
-
-#include "parrot/parrot.h"
-
-/* HEADERIZER BEGIN: src/trace.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-int trace_key_dump(PARROT_INTERP, ARGIN(PMC *key))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-void trace_op(PARROT_INTERP,
-    ARGIN(const opcode_t *code_start),
-    ARGIN(const opcode_t *code_end),
-    ARGIN_NULLOK(const opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-void trace_op_dump(PARROT_INTERP,
-    ARGIN(const opcode_t *code_start),
-    ARGIN(const opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-void trace_pmc_dump(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc))
-        __attribute__nonnull__(1);
-
-#define ASSERT_ARGS_trace_key_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_trace_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(code_start) \
-    || PARROT_ASSERT_ARG(code_end)
-#define ASSERT_ARGS_trace_op_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(code_start) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_trace_pmc_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/trace.c */
-
-#endif /* PARROT_TRACE_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */


More information about the parrot-commits mailing list