Skip to content

Commit

Permalink
ntdll: Added new pid debug channel to append process id to debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjacek authored and julliard committed Aug 25, 2015
1 parent 4ca5a35 commit 719a7d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dlls/ntdll/debugtools.c
Expand Up @@ -39,6 +39,7 @@
#include "ntdll_misc.h"

WINE_DECLARE_DEBUG_CHANNEL(tid);
WINE_DECLARE_DEBUG_CHANNEL(pid);
WINE_DECLARE_DEBUG_CHANNEL(timestamp);

static struct __wine_debug_functions default_funcs;
Expand Down Expand Up @@ -170,6 +171,8 @@ static int NTDLL_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_chan
ULONG ticks = NtGetTickCount();
ret = wine_dbg_printf( "%3u.%03u:", ticks / 1000, ticks % 1000 );
}
if (TRACE_ON(pid))
ret += wine_dbg_printf( "%04x:", GetCurrentProcessId() );
if (TRACE_ON(tid))
ret += wine_dbg_printf( "%04x:", GetCurrentThreadId() );
if (cls < sizeof(classes)/sizeof(classes[0]))
Expand Down
3 changes: 3 additions & 0 deletions libs/wine/debug.c
Expand Up @@ -35,6 +35,7 @@

#if defined(__MINGW32__) || defined(_MSC_VER)
WINE_DECLARE_DEBUG_CHANNEL(tid);
WINE_DECLARE_DEBUG_CHANNEL(pid);
#endif

static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" };
Expand Down Expand Up @@ -407,6 +408,8 @@ static int default_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_ch
int ret = 0;

#if defined(__MINGW32__) || defined(_MSC_VER)
if (TRACE_ON(pid))
ret += wine_dbg_printf( "%04x:", GetCurrentProcessId() );
if (TRACE_ON(tid))
ret += wine_dbg_printf( "%04x:", GetCurrentThreadId() );
#endif
Expand Down

0 comments on commit 719a7d3

Please sign in to comment.