Am Monday 20 July 2009 01:38:35 schrieb Matteo Bruni:
2009/7/19 Henri Verbeet <hverbeet(a)gmail.com>:
2009/7/19 Matteo Bruni <matteo.mystral(a)gmail.com>:
+const char *debug_src(struct shader_reg *reg, BOOL vs) { + static char buffer[128]; + + memset(buffer, 0, sizeof(buffer));
- "buffer" is static. Using wine_dbg_sprintf() would already be much better, but the entire "parsed_shader" setup looks flawed to me. It seems to me that you should handle that by having an appropriately filled struct asmparser_backend, and appending to a proper buffer.
Once debug_src uses wine_dbg_sprintf you can also change code like this:
+ TRACE_(parsed_shader)("add%s%s %s, %s, ", debug_dstmod(mod), + debug_shift(shift), debug_dst(dst, vs), + debug_src(src0, vs)); + TRACE_(parsed_shader)("%s\n", debug_src(src1, vs)); And write all srcs in one TRACE.