From be18550b024fae728ce73c8d2e15fc4a717c2cb2 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Wed, 22 Aug 2012 17:32:57 +0200 Subject: [PATCH] Nicer -trace output in qcvm/exec --- exec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index fdff787..ea226c9 100644 --- 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],