cvsuser 01/10/17 14:04:52
Modified: . interpreter.c
Log:
added more comprehensive trace output
Revision Changes Path
1.30 +65 -3 parrot/interpreter.c
Index: interpreter.c
===================================================================
RCS file: /home/perlcvs/parrot/interpreter.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- interpreter.c 2001/10/14 23:47:39 1.29
+++ interpreter.c 2001/10/17 21:04:52 1.30
@@ -1,7 +1,7 @@
/* interpreter.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: interpreter.c,v 1.29 2001/10/14 23:47:39 gregor Exp $
+ * $Id: interpreter.c,v 1.30 2001/10/17 21:04:52 bdwheele Exp $
* Overview:
* The interpreter api handles running the operations
* Data Structure and Algorithms:
@@ -81,7 +81,38 @@
fprintf(stderr, "; ARGS=(");
for(i = 1; i < interpreter->opcode_info[*pc].arg_count; i++) {
if (i > 1) { fprintf(stderr, ", "); }
+ switch(interpreter->opcode_info[*pc].types[i]) {
+ case PARROT_ARG_IC:
fprintf(stderr, "%ld", (long) *(pc + i));
+ break;
+ case PARROT_ARG_NC:
+ fprintf(stderr, "%f",
interpreter->code->const_table->constants[*(pc + i)]->number);
+ break;
+ case PARROT_ARG_PC:
+ /* what is a PMC constant look like? */
+ fprintf(stderr, "%ld", (long) *(pc + i));
+ break;
+ case PARROT_ARG_SC:
+ fprintf(stderr, "\"%s\"",
interpreter->code->const_table->constants[*(pc + i)]->string->bufstart);
+ break;
+ case PARROT_ARG_I:
+ fprintf(stderr, "I%ld=%ld", (long) *(pc + i), (long)
interpreter->int_reg->registers[*(pc + i)]);
+ break;
+ case PARROT_ARG_N:
+ fprintf(stderr, "N%ld=%f", (long) *(pc + i),
interpreter->num_reg->registers[*(pc + i)]);
+ break;
+ case PARROT_ARG_P:
+ /* what does a PMC constant look like? */
+ fprintf(stderr, "P%ld=???", (long) *(pc + i));
+ break;
+ case PARROT_ARG_S:
+ if(interpreter->string_reg->registers[*(pc + i)]) {
+ fprintf(stderr, "S%ld=\"%s\"", (long) *(pc + i),
interpreter->string_reg->registers[*(pc + i)]->bufstart);
+ } else {
+ fprintf(stderr, "S%ld=(null)", (long) *(pc + i));
+ }
+ break;
+ }
}
fprintf(stderr, ")");
}
@@ -115,7 +146,38 @@
fprintf(stderr, "; ARGS=(");
for(i = 1; i < interpreter->opcode_info[*pc].arg_count; i++) {
if (i > 1) { fprintf(stderr, ", "); }
+ switch(interpreter->opcode_info[*pc].types[i]) {
+ case PARROT_ARG_IC:
fprintf(stderr, "%ld", (long) *(pc + i));
+ break;
+ case PARROT_ARG_NC:
+ fprintf(stderr, "%f",
interpreter->code->const_table->constants[*(pc + i)]->number);
+ break;
+ case PARROT_ARG_PC:
+ /* what is a PMC constant look like? */
+ fprintf(stderr, "%ld", (long) *(pc + i));
+ break;
+ case PARROT_ARG_SC:
+ fprintf(stderr, "\"%s\"",
interpreter->code->const_table->constants[*(pc + i)]->string->bufstart);
+ break;
+ case PARROT_ARG_I:
+ fprintf(stderr, "I%ld=%ld", (long) *(pc + i), (long)
interpreter->int_reg->registers[*(pc + i)]);
+ break;
+ case PARROT_ARG_N:
+ fprintf(stderr, "N%ld=%f", (long) *(pc + i),
interpreter->num_reg->registers[*(pc + i)]);
+ break;
+ case PARROT_ARG_P:
+ /* what does a PMC constant look like? */
+ fprintf(stderr, "P%ld=???", (long) *(pc + i));
+ break;
+ case PARROT_ARG_S:
+ if(interpreter->string_reg->registers[*(pc + i)]) {
+ fprintf(stderr, "S%ld=\"%s\"", (long) *(pc + i),
interpreter->string_reg->registers[*(pc + i)]->bufstart);
+ } else {
+ fprintf(stderr, "S%ld=(null)", (long) *(pc + i));
+ }
+ break;
+ }
}
fprintf(stderr, ")");
}