[PATCH] kernel32: Add the ticks debug channel
Detlef Riekenberg
wine.dev at web.de
Sun Nov 11 13:24:11 CST 2007
---
dlls/kernel32/process.c | 5 +++++
dlls/kernel32/relay16.c | 3 +++
dlls/kernel32/wowthunk.c | 9 +++++++++
3 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index d770fd7..eee99ad 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -59,6 +59,7 @@ #endif
WINE_DEFAULT_DEBUG_CHANNEL(process);
WINE_DECLARE_DEBUG_CHANNEL(file);
WINE_DECLARE_DEBUG_CHANNEL(relay);
+WINE_DECLARE_DEBUG_CHANNEL(ticks);
typedef struct
{
@@ -831,8 +832,12 @@ static void start_process( void *arg )
nt->OptionalHeader.AddressOfEntryPoint);
if (TRACE_ON(relay))
+ {
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Starting process %s (entryproc=%p)\n", GetCurrentThreadId(),
debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), entry );
+ }
SetLastError( 0 ); /* clear error code */
if (peb->BeingDebugged) DbgBreakPoint();
diff --git a/dlls/kernel32/relay16.c b/dlls/kernel32/relay16.c
index 3712aec..18150d5 100644
--- a/dlls/kernel32/relay16.c
+++ b/dlls/kernel32/relay16.c
@@ -37,6 +37,7 @@ #include "wine/library.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(relay);
+WINE_DECLARE_DEBUG_CHANNEL(ticks);
#ifdef __i386__
@@ -418,6 +419,8 @@ int relay_call_from_16( void *entry_poin
if (!TRACE_ON(relay) || !RELAY_ShowDebugmsgRelay( module, ordinal, func ))
return relay_call_from_16_no_debug( entry_point, args16, context, call );
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF( "%04x:Call %s.%d: %s(",GetCurrentThreadId(), module, ordinal, func );
/* look for the ret instruction */
diff --git a/dlls/kernel32/wowthunk.c b/dlls/kernel32/wowthunk.c
index 2ccfddf..e35f75f 100644
--- a/dlls/kernel32/wowthunk.c
+++ b/dlls/kernel32/wowthunk.c
@@ -41,6 +41,7 @@ #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(thunk);
WINE_DECLARE_DEBUG_CHANNEL(relay);
WINE_DECLARE_DEBUG_CHANNEL(snoop);
+WINE_DECLARE_DEBUG_CHANNEL(ticks);
/*
* These are the 16-bit side WOW routines. They reside in wownt16.h
@@ -571,6 +572,8 @@ #ifdef __i386__
DWORD count = cbArgs / sizeof(WORD);
WORD * wstack = (WORD *)stack;
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF("%04x:CallTo16(func=%04x:%04x,ds=%04x",
GetCurrentThreadId(),
context->SegCs, LOWORD(context->Eip), context->SegDs );
@@ -640,6 +643,8 @@ #ifdef __i386__
if (TRACE_ON(relay))
{
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF("%04x:RetFrom16() ss:sp=%04x:%04x ",
GetCurrentThreadId(), SELECTOROF(NtCurrentTeb()->WOW32Reserved),
OFFSETOF(NtCurrentTeb()->WOW32Reserved));
@@ -658,6 +663,8 @@ #ifdef __i386__
DWORD count = cbArgs / sizeof(WORD);
WORD * wstack = (WORD *)stack;
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF("%04x:CallTo16(func=%04x:%04x,ds=%04x",
GetCurrentThreadId(), HIWORD(vpfn16), LOWORD(vpfn16),
SELECTOROF(NtCurrentTeb()->WOW32Reserved) );
@@ -685,6 +692,8 @@ #ifdef __i386__
if (TRACE_ON(relay))
{
+ if (TRACE_ON(ticks)) DPRINTF( "(%05u)", NtGetTickCount() );
+
DPRINTF("%04x:RetFrom16() ss:sp=%04x:%04x retval=%08x\n",
GetCurrentThreadId(), SELECTOROF(NtCurrentTeb()->WOW32Reserved),
OFFSETOF(NtCurrentTeb()->WOW32Reserved), ret);
--
1.4.1
--=-l0ltz04nBnv3onF6juQI--
More information about the wine-patches
mailing list