]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Nicer -trace output in qcvm/exec
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 22 Aug 2012 15:32:57 +0000 (17:32 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 22 Aug 2012 15:32:57 +0000 (17:32 +0200)
exec.c

diff --git a/exec.c b/exec.c
index fdff7870eec0d85824735f511001c21fa0a04e36..ea226c9bc59d1eb57c9568ef2310848bbb29e977 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -338,7 +338,11 @@ static void trace_print_global(qc_program *prog, unsigned int glob, int vtype)
     value = (qcany*)(&prog->globals[glob]);
 
     if (def) {
-        len = printf("[%s] ", prog_getstring(prog, def->name));
+        const char *name = prog_getstring(prog, def->name);
+        if (name[0] == '#')
+            len = printf("$");
+        else
+            len = printf("%s ", name);
         vtype = def->type;
     }
     else
@@ -350,7 +354,7 @@ static void trace_print_global(qc_program *prog, unsigned int glob, int vtype)
         case TYPE_FIELD:
         case TYPE_FUNCTION:
         case TYPE_POINTER:
-            len += printf("%i,", value->_int);
+            len += printf("(%i),", value->_int);
             break;
         case TYPE_VECTOR:
             len += printf("'%g %g %g',", value->vector[0],