Commit e17d1a36 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Print the tid in the first column when +tid is specified.

parent f30b0351
......@@ -15,6 +15,8 @@
#include "winnt.h"
#include "wtypes.h"
DECLARE_DEBUG_CHANNEL(tid);
/* ---------------------------------------------------------------------- */
struct debug_info
......@@ -248,8 +250,10 @@ int wine_dbg_log(enum __DEBUG_CLASS cls, const char *channel,
int ret = 0;
va_start(valist, format);
if (TRACE_ON(tid))
ret = wine_dbg_printf( "%08lx:", (DWORD)NtCurrentTeb()->tid );
if (cls < __DBCL_COUNT)
ret = wine_dbg_printf( "%s:%s:%s ", classes[cls], channel + 1, function );
ret += wine_dbg_printf( "%s:%s:%s ", classes[cls], channel + 1, function );
if (format)
ret += wine_dbg_vprintf( format, valist );
va_end(valist);
......
......@@ -5,7 +5,7 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
file fixup global heap int int10 int16 int17 int19 int21 int31
io loaddll local module ntdll process profile reg relay resource
segment seh selector server snoop string system tape task thread
thunk timer toolhelp ver virtual vxd win32)
thunk tid timer toolhelp ver virtual vxd win32)
#note that the Zw... functions are alternate names for the
#Nt... functions. (see www.sysinternals.com for details)
......
......@@ -154,7 +154,7 @@ void RELAY_DebugCallFrom16( CONTEXT86 *context )
args = BUILTIN_GetEntryPoint16( frame, funstr, &ordinal );
if (!args) return; /* happens for the two snoop register relays */
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Call %s(",funstr);
DPRINTF( "%08lx:Call %s(",GetCurrentThreadId(),funstr);
VA_START16( args16 );
usecdecl = ( *args == 'c' );
......@@ -274,7 +274,7 @@ void RELAY_DebugCallFrom16Ret( CONTEXT86 *context, int ret_val )
args = BUILTIN_GetEntryPoint16( frame, funstr, &ordinal );
if (!args) return;
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Ret %s() ",funstr);
DPRINTF( "%08lx:Ret %s() ",GetCurrentThreadId(),funstr);
if ( memcmp( args+2, "long_", 5 ) == 0 )
{
......@@ -324,7 +324,8 @@ void RELAY_DebugCallTo16( LPVOID target, int nb_args, BOOL reg_func )
{
CONTEXT86 *context = (CONTEXT86 *)target;
DPRINTF("CallTo16(func=%04lx:%04x,ds=%04lx",
DPRINTF("%08lx:CallTo16(func=%04lx:%04x,ds=%04lx",
GetCurrentThreadId(),
context->SegCs, LOWORD(context->Eip), context->SegDs );
while (nb_args--) DPRINTF( ",0x%04x", *--stack16 );
DPRINTF(") ss:sp=%04x:%04x\n", SELECTOROF(teb->cur_stack),
......@@ -336,7 +337,8 @@ void RELAY_DebugCallTo16( LPVOID target, int nb_args, BOOL reg_func )
}
else
{
DPRINTF("CallTo16(func=%04x:%04x,ds=%04x",
DPRINTF("%08lx:CallTo16(func=%04x:%04x,ds=%04x",
GetCurrentThreadId(),
HIWORD(target), LOWORD(target), SELECTOROF(teb->cur_stack) );
while (nb_args--) DPRINTF( ",0x%04x", *--stack16 );
DPRINTF(") ss:sp=%04x:%04x\n", SELECTOROF(teb->cur_stack),
......@@ -356,7 +358,8 @@ void RELAY_DebugCallTo16Ret( BOOL reg_func, int ret_val )
if (!reg_func)
{
DPRINTF("CallTo16() ss:sp=%04x:%04x retval=0x%08x\n",
DPRINTF("%08lx:RetFrom16() ss:sp=%04x:%04x retval=0x%08x\n",
GetCurrentThreadId(),
SELECTOROF(NtCurrentTeb()->cur_stack),
OFFSETOF(NtCurrentTeb()->cur_stack), ret_val);
}
......@@ -364,7 +367,8 @@ void RELAY_DebugCallTo16Ret( BOOL reg_func, int ret_val )
{
CONTEXT86 *context = (CONTEXT86 *)ret_val;
DPRINTF("CallTo16() ss:sp=%04x:%04x\n",
DPRINTF("%08lx:RetFrom16() ss:sp=%04x:%04x\n",
GetCurrentThreadId(),
SELECTOROF(NtCurrentTeb()->cur_stack),
OFFSETOF(NtCurrentTeb()->cur_stack));
DPRINTF(" AX=%04x BX=%04x CX=%04x DX=%04x BP=%04x SP=%04x\n",
......
......@@ -731,10 +731,13 @@ BOOL PE_InitDLL( HMODULE module, DWORD type, LPVOID lpReserved )
(nt->OptionalHeader.AddressOfEntryPoint))
{
DLLENTRYPROC entry = (void*)((char*)module + nt->OptionalHeader.AddressOfEntryPoint);
TRACE_(relay)("CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
entry, module, type, lpReserved );
if (TRACE_ON(relay))
DPRINTF("%08lx:Call PE DLL (proc=%p,module=%08x,type=%ld,res=%p)\n",
GetCurrentThreadId(), entry, module, type, lpReserved );
retv = entry( module, type, lpReserved );
if (TRACE_ON(relay))
DPRINTF("%08lx:Ret PE DLL (proc=%p,module=%08x,type=%ld,res=%p) retval=%x\n",
GetCurrentThreadId(), entry, module, type, lpReserved, retv );
}
return retv;
......
......@@ -182,9 +182,9 @@ static LONGLONG RELAY_CallFrom32( int ret_addr, ... )
get_entry_point( buffer, relay );
DPRINTF( "Call %s(", buffer );
DPRINTF( "%08lx:Call %s(", GetCurrentThreadId(), buffer );
RELAY_PrintArgs( args, nb_args, relay->argtypes );
DPRINTF( ") ret=%08x tid=%08lx\n", ret_addr, GetCurrentThreadId() );
DPRINTF( ") ret=%08x\n", ret_addr );
ret64 = (relay->argtypes & 0x80000000) && (nb_args < 16);
if (relay->ret == 0xc3) /* cdecl */
......@@ -274,11 +274,13 @@ static LONGLONG RELAY_CallFrom32( int ret_addr, ... )
}
}
if (ret64)
DPRINTF( "Ret %s() retval=%08x%08x ret=%08x tid=%08lx\n",
buffer, (UINT)(ret >> 32), (UINT)ret, ret_addr, GetCurrentThreadId() );
DPRINTF( "%08lx:Ret %s() retval=%08x%08x ret=%08x\n",
GetCurrentThreadId(),
buffer, (UINT)(ret >> 32), (UINT)ret, ret_addr );
else
DPRINTF( "Ret %s() retval=%08x ret=%08x tid=%08lx\n",
buffer, (UINT)ret, ret_addr, GetCurrentThreadId() );
DPRINTF( "%08lx:Ret %s() retval=%08x ret=%08x\n",
GetCurrentThreadId(),
buffer, (UINT)ret, ret_addr );
return ret;
}
......@@ -320,7 +322,7 @@ void WINAPI RELAY_DoCallFrom32Regs( CONTEXT86 *context )
get_entry_point( buffer, relay );
DPRINTF( "Call %s(", buffer );
DPRINTF( "%08lx:Call %s(", GetCurrentThreadId(), buffer );
RELAY_PrintArgs( args, nb_args, relay->argtypes );
DPRINTF( ") ret=%08lx fs=%04lx\n", context->Eip, context->SegFs );
......@@ -364,7 +366,8 @@ void WINAPI RELAY_DoCallFrom32Regs( CONTEXT86 *context )
assert(FALSE);
}
DPRINTF( "Ret %s() retval=%08lx ret=%08lx fs=%04lx\n",
DPRINTF( "%08lx:Ret %s() retval=%08lx ret=%08lx fs=%04lx\n",
GetCurrentThreadId(),
buffer, context->Eax, context->Eip, context->SegFs );
DPRINTF(" eax=%08lx ebx=%08lx ecx=%08lx edx=%08lx esi=%08lx edi=%08lx\n",
......
......@@ -322,7 +322,7 @@ void WINAPI SNOOP_DoEntry( CONTEXT86 *context )
context->Eip = (DWORD)fun->origfun;
DPRINTF("CALL %s.%ld: %s(",dll->name,ordinal,fun->name);
DPRINTF("%08lx:CALL %s.%ld: %s(",GetCurrentThreadId(),dll->name,ordinal,fun->name);
if (fun->nrofargs>0) {
max = fun->nrofargs; if (max>16) max=16;
for (i=0;i<max;i++)
......@@ -334,7 +334,7 @@ void WINAPI SNOOP_DoEntry( CONTEXT86 *context )
ret->args = HeapAlloc(GetProcessHeap(),0,16*sizeof(DWORD));
memcpy(ret->args,(LPBYTE)(context->Esp + 4),sizeof(DWORD)*16);
}
DPRINTF(") ret=%08lx tid=%08lx\n", (DWORD)ret->origreturn, GetCurrentThreadId());
DPRINTF(") ret=%08lx\n",(DWORD)ret->origreturn);
}
......@@ -353,18 +353,21 @@ void WINAPI SNOOP_DoReturn( CONTEXT86 *context )
if (ret->args) {
int i,max;
DPRINTF("RET %s.%ld: %s(",ret->dll->name,ret->ordinal,ret->dll->funs[ret->ordinal].name);
DPRINTF("%08lx:RET %s.%ld: %s(",
GetCurrentThreadId(),
ret->dll->name,ret->ordinal,ret->dll->funs[ret->ordinal].name);
max = ret->dll->funs[ret->ordinal].nrofargs;
if (max>16) max=16;
for (i=0;i<max;i++)
DPRINTF("%s%s",SNOOP_PrintArg(ret->args[i]),(i<max-1)?",":"");
DPRINTF(") retval = %08lx ret=%08lx tid=%08lx\n",
context->Eax, (DWORD)ret->origreturn, GetCurrentThreadId());
DPRINTF(") retval = %08lx ret=%08lx\n",
context->Eax,(DWORD)ret->origreturn );
HeapFree(GetProcessHeap(),0,ret->args);
ret->args = NULL;
} else
DPRINTF("RET %s.%ld: %s() retval = %08lx ret=%08lx tid=%08lx\n",
DPRINTF("%08lx:RET %s.%ld: %s() retval = %08lx ret=%08lx tid=%08lx\n",
GetCurrentThreadId(),
ret->dll->name,ret->ordinal,ret->dll->funs[ret->ordinal].name,
context->Eax, (DWORD)ret->origreturn, GetCurrentThreadId());
ret->origreturn = NULL; /* mark as empty */
......
......@@ -393,8 +393,9 @@ static void start_process(void)
/* Call UserSignalProc ( USIG_PROCESS_RUNNING ... ) only for non-GUI win32 apps */
if (console_app) PROCESS_CallUserSignalProc( USIG_PROCESS_RUNNING, 0 );
TRACE_(relay)( "Starting Win32 process %s (entryproc=%p) tid=%08lx\n",
main_exe_name, entry, GetCurrentThreadId() );
if (TRACE_ON(relay))
DPRINTF( "%08lx:Starting process %s (entryproc=%p)\n",
GetCurrentThreadId(), main_exe_name, entry );
if (debugged) DbgBreakPoint();
/* FIXME: should use _PEB as parameter for NT 3.5 programs !
* Dunno about other OSs */
......
......@@ -272,7 +272,8 @@ static void THREAD_Start(void)
NtCurrentTeb()->cleanup = SERVICE_AddObject( cleanup_object, (PAPCFUNC)THREAD_FreeTEB,
(ULONG_PTR)NtCurrentTeb() );
TRACE_(relay)("Starting thread %08lx\n", GetCurrentThreadId());
if (TRACE_ON(relay))
DPRINTF("%08lx:Starting thread (entryproc=%p)\n", GetCurrentThreadId(), func );
PROCESS_CallUserSignalProc( USIG_THREAD_INIT, 0 );
PE_InitTls();
......
......@@ -161,16 +161,19 @@ static LRESULT WINPROC_CallWndProc( WNDPROC proc, HWND hwnd, UINT msg,
{
LRESULT retvalue;
int iWndsLocks;
TRACE_(relay)("(wndproc=%p,hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)\n",
proc, hwnd, SPY_GetMsgName(msg), wParam, lParam );
if (TRACE_ON(relay))
DPRINTF( "%08lx:Call window proc %p (hwnd=%08x,msg=%s,wp=%08x,lp=%08lx)\n",
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg), wParam, lParam );
/* To avoid any deadlocks, all the locks on the windows structures
must be suspended before the control is passed to the application */
iWndsLocks = WIN_SuspendWndsLock();
retvalue = WINPROC_wrapper( proc, hwnd, msg, wParam, lParam );
WIN_RestoreWndsLock(iWndsLocks);
TRACE_(relay)("(wndproc=%p,hwnd=%08x,msg=%s,wp=%08x,lp=%08lx) retval=%08lx\n",
proc, hwnd, SPY_GetMsgName(msg), wParam, lParam, retvalue );
if (TRACE_ON(relay))
DPRINTF( "%08lx:Ret window proc %p (hwnd=%08x,msg=%s,wp=%08x,lp=%08lx) retval=%08lx\n",
GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg), wParam, lParam, retvalue );
return retvalue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment