Go to the first, previous, next, last section, table of contents.


Getting Execution Traces

When all else fails, you may wish to generate a bytecode by bytecode log of every virtual instruction the Muq bytecode engine executes. (Save a forest: don't run the output to hard copy!)

To do this, look in `c/jobbuild.c' for

#if JOB_PASS_IN_PARAMETERS
    fputs("#define JOB_NEXT                             \\\n", fd );
    /* Uncomment next for a debug trace (see also job_run()): */
    /* fputs("job_Print1(stdout,jSpc,jSs);\\\n", fd );*/
    fputs("{++jSops;                                    \\\n", fd );
    fputs(" ((Job_Fast_Prim*)jStabl)[                   \\\n", fd );
    fputs("  *jSpc                          |           \\\n", fd );
    fputs("  (job_Type1[jSs[-1]&0xFF])      |           \\\n", fd );
    fputs("   job_Type0[jSs[ 0]&0xFF]       |           \\\n", fd );
    fputs("  (jSops & JOB_OPS_COUNT_MASK)               \\\n", fd );
    fputs(" ](JOB_PRIM_ARGS);}\n",                             fd );
#else
    fputs("#define JOB_NEXT                             \\\n", fd );
    /* Uncomment next for a debug trace (see also job_run()): */
    /* fputs("job_Print1(stdout,jSpc,jSs);\\\n", fd ); */
    fputs(" ((Job_Fast_Prim*)jStabl)[                   \\\n", fd );
    fputs("  *jSpc                          |           \\\n", fd );
    fputs("  (job_Type1[jSs[-1]&0xFF])      |           \\\n", fd );
    fputs("   job_Type0[jSs[ 0]&0xFF]       |           \\\n", fd );
    fputs("  (++jSops & JOB_OPS_COUNT_MASK)             \\\n", fd );
    fputs(" ](JOB_PRIM_ARGS)\n",                               fd );
#endif

and uncomment both of the indicated lines. Then go into `job.t' and find in function job_run() the section reading

        /* Uncomment next line for a handy trace when debugging: */
        /* job_Print1(stdout,jS.pc,jS.s); */
        /* See also JOB_NEXT in jobbuild.c */

and uncomment. Recompile ... and stand back.


Go to the first, previous, next, last section, table of contents.