From: Peep P. <so...@us...> - 2004-03-28 18:11:18
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31977 Modified Files: debug.c debug.h Log Message: Small changes. Index: debug.h =================================================================== RCS file: /cvsroot/agd/server/src/debug.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- debug.h 1 Feb 2004 13:12:30 -0000 1.4 +++ debug.h 28 Mar 2004 17:59:59 -0000 1.5 @@ -6,6 +6,6 @@ void print_var_arr(array_t *a); void print_vm_token(array_t *a, int *i); void print_vm_tokens(array_t *a); -void print_code(object_t *ob); +void print_code(program_t *p); #endif Index: debug.c =================================================================== RCS file: /cvsroot/agd/server/src/debug.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- debug.c 18 Mar 2004 20:48:09 -0000 1.8 +++ debug.c 28 Mar 2004 17:59:59 -0000 1.9 @@ -3,13 +3,14 @@ #include "debug.h" #ifdef DEBUG -static int lval_lvl; #define NAME() if(v->name) printf("%s", v->name); void print_var(variable_t *v, int values) { char buf[MAX_STRING_LENGTH]; char *p, *bufptr; + + int lval_lvl; if(!v) { printf("<NULL>"); @@ -199,8 +200,14 @@ return "F_POSTDEC"; case F_PREDEC: return "F_PREDEC"; - case F_RANGE: - return "F_RANGE"; + case F_INDEX: + return "F_INDEX"; + case F_INDEX_LVALUE: + return "F_INDEX_LVALUE"; + case F_SLICE: + return "F_SLICE"; + case F_SLICE_LVALUE: + return "F_SLICE_LVALUE"; case F_RETURN: return "F_RETURN"; default: @@ -271,17 +278,11 @@ } } -void print_code(object_t *ob) +void print_code(program_t *p) { int i; function_t *f; - program_t *p = ob->prog; - printf("Printing code for \"%s\":\n", ob->name); - printf("Globals: \n"); - print_var_arr(&ob->variables); - printf("\n"); - printf("Functions: \n"); for(i = 0; i < p->functions.length; i++) { f = (function_t *) p->functions.data[i]; @@ -298,3 +299,4 @@ printf("({ })\n"); } #endif /* ifdef DEBUG */ + |