[CMD] Support dynamic trace (#7093)

Based on Hans Harder's patch.
Realize tracing cmd on console
output.
JIRA issue: CORE-6669
- Add FEATURE_DYNAMIC_TRACE
  feature.
- Add CmdTrace function.
- Re-define FIXME, ERR, WARN,
  and TRACE macros.
- Check CMDTRACE environment
  variable. If it was "ON", then enable
  dynamic trace.
This commit is contained in:
Katayama Hirofumi MZ
2024-07-09 04:25:30 +09:00
committed by GitHub
parent 6c74e69d12
commit 3dcae2ce0c
5 changed files with 106 additions and 4 deletions

View File

@@ -37,10 +37,34 @@
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
#ifdef UNICODE
#define debugstr_aw debugstr_w
#else
#define debugstr_aw debugstr_a
#endif
#ifdef FEATURE_DYNAMIC_TRACE
extern BOOL g_bDynamicTrace;
void CmdTrace(INT type, LPCSTR file, INT line, LPCSTR func, LPCSTR fmt, ...);
#undef FIXME
#define FIXME(fmt, ...) \
CmdTrace(__WINE_DBCL_FIXME, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#undef ERR
#define ERR(fmt, ...) \
CmdTrace(__WINE_DBCL_ERR, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#undef WARN
#define WARN(fmt, ...) \
CmdTrace(__WINE_DBCL_WARN, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#undef TRACE
#define TRACE(fmt, ...) \
CmdTrace(__WINE_DBCL_TRACE, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#endif /* def FEATURE_DYNAMIC_TRACE */
#endif /* __CMD_PRECOMP_H */