Print thread ids in traces with only 4 digits now that they are small

integers.
This commit is contained in:
Alexandre Julliard 2003-02-18 23:29:47 +00:00
parent 8bc93e2d6f
commit ac13d2f47e
11 changed files with 27 additions and 27 deletions

View File

@ -43,9 +43,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
MSVCRT_thread_data *tls;
TRACE("(%p, %s, %p) pid(%ld), tid(%ld), tls(%ld)\n",
TRACE("(%p, %s, %p) pid(%lx), tid(%lx), tls(%ld)\n",
hinstDLL, msvcrt_get_reason(fdwReason), lpvReserved,
(long)GetCurrentProcessId(), (long)GetCurrentThreadId(),
GetCurrentProcessId(), GetCurrentThreadId(),
(long)MSVCRT_tls_index);
switch (fdwReason)

View File

@ -117,12 +117,12 @@ NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit )
{
const char *name = (char *)crit->DebugInfo;
if (!name) name = "?";
ERR( "section %p %s wait timed out, retrying (60 sec) tid=%08lx\n",
ERR( "section %p %s wait timed out, retrying (60 sec) tid=%04lx\n",
crit, debugstr_a(name), GetCurrentThreadId() );
res = WaitForSingleObject( sem, 60000L );
if ( res == WAIT_TIMEOUT && TRACE_ON(relay) )
{
ERR( "section %p %s wait timed out, retrying (5 min) tid=%08lx\n",
ERR( "section %p %s wait timed out, retrying (5 min) tid=%04lx\n",
crit, debugstr_a(name), GetCurrentThreadId() );
res = WaitForSingleObject( sem, 300000L );
}

View File

@ -307,7 +307,7 @@ static int NTDLL_dbg_vlog( unsigned int cls, const char *channel,
int ret = 0;
if (TRACE_ON(tid))
ret = wine_dbg_printf( "%08lx:", NtCurrentTeb()->tid );
ret = wine_dbg_printf( "%04lx:", NtCurrentTeb()->tid );
if (cls < sizeof(classes)/sizeof(classes[0]))
ret += wine_dbg_printf( "%s:%s:%s ", classes[cls], channel + 1, function );
if (format)

View File

@ -228,7 +228,7 @@ static LRESULT call_hook( HOOKPROC proc, INT id, INT code, WPARAM wparam, LPARAM
LRESULT ret;
if (TRACE_ON(relay))
DPRINTF( "%08lx:Call hook proc %p (id=%s,code=%x,wp=%08x,lp=%08lx)\n",
DPRINTF( "%04lx:Call hook proc %p (id=%s,code=%x,wp=%08x,lp=%08lx)\n",
GetCurrentThreadId(), proc, hook_names[id-WH_MINHOOK], code, wparam, lparam );
if (!prev_unicode == !next_unicode) ret = proc( code, wparam, lparam );
@ -236,7 +236,7 @@ static LRESULT call_hook( HOOKPROC proc, INT id, INT code, WPARAM wparam, LPARAM
else ret = call_hook_AtoW( proc, id, code, wparam, lparam );
if (TRACE_ON(relay))
DPRINTF( "%08lx:Ret hook proc %p (id=%s,code=%x,wp=%08x,lp=%08lx) retval=%08lx\n",
DPRINTF( "%04lx:Ret hook proc %p (id=%s,code=%x,wp=%08x,lp=%08lx) retval=%08lx\n",
GetCurrentThreadId(), proc, hook_names[id-WH_MINHOOK], code, wparam, lparam, ret );
return ret;

View File

@ -5464,7 +5464,7 @@ INT X11DRV_DIB_Lock(BITMAPOBJ *bmp, INT req, BOOL lossy)
INT ret = DIB_Status_None;
if (dib) {
TRACE("Locking %p from thread %08lx\n", bmp, GetCurrentThreadId());
TRACE("Locking %p from thread %04lx\n", bmp, GetCurrentThreadId());
EnterCriticalSection(&(dib->lock));
ret = dib->status;
if (req != DIB_Status_None)

View File

@ -254,7 +254,7 @@ void RELAY_DebugCallFrom16( CONTEXT86 *context )
call = get_entry_point( frame, funstr, &ordinal );
if (!call) return; /* happens for the two snoop register relays */
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "%08lx:Call %s(",GetCurrentThreadId(),funstr);
DPRINTF( "%04lx:Call %s(",GetCurrentThreadId(),funstr);
VA_START16( args16 );
if (call->lret == 0xcb66) /* cdecl */
@ -364,7 +364,7 @@ void RELAY_DebugCallFrom16Ret( CONTEXT86 *context, int ret_val )
call = get_entry_point( frame, funstr, &ordinal );
if (!call) return;
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "%08lx:Ret %s() ",GetCurrentThreadId(),funstr);
DPRINTF( "%04lx:Ret %s() ",GetCurrentThreadId(),funstr);
if (call->arg_types[0] & ARG_REGISTER)
{
@ -412,7 +412,7 @@ void RELAY_DebugCallTo16( LPVOID target, int nb_args, BOOL reg_func )
{
CONTEXT86 *context = (CONTEXT86 *)target;
DPRINTF("%08lx:CallTo16(func=%04lx:%04x,ds=%04lx",
DPRINTF("%04lx:CallTo16(func=%04lx:%04x,ds=%04lx",
GetCurrentThreadId(),
context->SegCs, LOWORD(context->Eip), context->SegDs );
while (nb_args--) DPRINTF( ",%04x", *--stack16 );
@ -425,7 +425,7 @@ void RELAY_DebugCallTo16( LPVOID target, int nb_args, BOOL reg_func )
}
else
{
DPRINTF("%08lx:CallTo16(func=%04x:%04x,ds=%04x",
DPRINTF("%04lx:CallTo16(func=%04x:%04x,ds=%04x",
GetCurrentThreadId(),
HIWORD(target), LOWORD(target), SELECTOROF(teb->cur_stack) );
while (nb_args--) DPRINTF( ",%04x", *--stack16 );
@ -446,7 +446,7 @@ void RELAY_DebugCallTo16Ret( BOOL reg_func, int ret_val )
if (!reg_func)
{
DPRINTF("%08lx:RetFrom16() ss:sp=%04x:%04x retval=%08x\n",
DPRINTF("%04lx:RetFrom16() ss:sp=%04x:%04x retval=%08x\n",
GetCurrentThreadId(),
SELECTOROF(NtCurrentTeb()->cur_stack),
OFFSETOF(NtCurrentTeb()->cur_stack), ret_val);
@ -455,7 +455,7 @@ void RELAY_DebugCallTo16Ret( BOOL reg_func, int ret_val )
{
CONTEXT86 *context = (CONTEXT86 *)ret_val;
DPRINTF("%08lx:RetFrom16() ss:sp=%04x:%04x ",
DPRINTF("%04lx:RetFrom16() ss:sp=%04x:%04x ",
GetCurrentThreadId(),
SELECTOROF(NtCurrentTeb()->cur_stack),
OFFSETOF(NtCurrentTeb()->cur_stack));

View File

@ -624,11 +624,11 @@ BOOL PE_InitDLL( HMODULE module, DWORD type, LPVOID lpReserved )
{
DLLENTRYPROC entry = (void*)((char*)module + nt->OptionalHeader.AddressOfEntryPoint);
if (TRACE_ON(relay))
DPRINTF("%08lx:Call PE DLL (proc=%p,module=%p,type=%ld,res=%p)\n",
DPRINTF("%04lx:Call PE DLL (proc=%p,module=%p,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=%p,type=%ld,res=%p) retval=%x\n",
DPRINTF("%04lx:Ret PE DLL (proc=%p,module=%p,type=%ld,res=%p) retval=%x\n",
GetCurrentThreadId(), entry, module, type, lpReserved, retv );
}

View File

@ -412,7 +412,7 @@ static LONGLONG RELAY_CallFrom32( int ret_addr, ... )
{
get_entry_point( buffer, relay );
DPRINTF( "%08lx:Call %s(", GetCurrentThreadId(), buffer );
DPRINTF( "%04lx:Call %s(", GetCurrentThreadId(), buffer );
RELAY_PrintArgs( args, nb_args, relay->argtypes );
DPRINTF( ") ret=%08x\n", ret_addr );
}
@ -430,11 +430,11 @@ static LONGLONG RELAY_CallFrom32( int ret_addr, ... )
{
BOOL ret64 = (relay->argtypes & 0x80000000) && (nb_args < 16);
if (ret64)
DPRINTF( "%08lx:Ret %s() retval=%08x%08x ret=%08x\n",
DPRINTF( "%04lx:Ret %s() retval=%08x%08x ret=%08x\n",
GetCurrentThreadId(),
buffer, (UINT)(ret >> 32), (UINT)ret, ret_addr );
else
DPRINTF( "%08lx:Ret %s() retval=%08x ret=%08x\n",
DPRINTF( "%04lx:Ret %s() retval=%08x ret=%08x\n",
GetCurrentThreadId(),
buffer, (UINT)ret, ret_addr );
}
@ -478,7 +478,7 @@ void WINAPI RELAY_DoCallFrom32Regs( CONTEXT86 *context )
{
get_entry_point( buffer, relay );
DPRINTF( "%08lx:Call %s(", GetCurrentThreadId(), buffer );
DPRINTF( "%04lx:Call %s(", GetCurrentThreadId(), buffer );
RELAY_PrintArgs( args, nb_args, relay->argtypes );
DPRINTF( ") ret=%08lx fs=%04lx\n", context->Eip, context->SegFs );
@ -505,7 +505,7 @@ void WINAPI RELAY_DoCallFrom32Regs( CONTEXT86 *context )
if (TRACE_ON(relay))
{
DPRINTF( "%08lx:Ret %s() retval=%08lx ret=%08lx fs=%04lx\n",
DPRINTF( "%04lx:Ret %s() retval=%08lx ret=%08lx fs=%04lx\n",
GetCurrentThreadId(),
buffer, context->Eax, context->Eip, context->SegFs );

View File

@ -315,7 +315,7 @@ void WINAPI SNOOP_DoEntry( CONTEXT86 *context )
context->Eip = (DWORD)fun->origfun;
DPRINTF("%08lx:CALL %s.%ld: %s(",GetCurrentThreadId(),dll->name,dll->ordbase+ordinal,fun->name);
DPRINTF("%04lx:CALL %s.%ld: %s(",GetCurrentThreadId(),dll->name,dll->ordbase+ordinal,fun->name);
if (fun->nrofargs>0) {
max = fun->nrofargs; if (max>16) max=16;
for (i=0;i<max;i++)
@ -349,7 +349,7 @@ void WINAPI SNOOP_DoReturn( CONTEXT86 *context )
if (ret->args) {
int i,max;
DPRINTF("%08lx:RET %s.%ld: %s(",
DPRINTF("%04lx:RET %s.%ld: %s(",
GetCurrentThreadId(),
ret->dll->name,ret->dll->ordbase+ret->ordinal,ret->dll->funs[ret->ordinal].name);
max = ret->dll->funs[ret->ordinal].nrofargs;
@ -365,7 +365,7 @@ void WINAPI SNOOP_DoReturn( CONTEXT86 *context )
HeapFree(GetProcessHeap(),0,ret->args);
ret->args = NULL;
} else
DPRINTF("%08lx:RET %s.%ld: %s() retval = %08lx ret=%08lx\n",
DPRINTF("%04lx:RET %s.%ld: %s() retval = %08lx ret=%08lx\n",
GetCurrentThreadId(),
ret->dll->name,ret->dll->ordbase+ret->ordinal,ret->dll->funs[ret->ordinal].name,
context->Eax, (DWORD)ret->origreturn);

View File

@ -263,7 +263,7 @@ static void THREAD_Start(void)
LPTHREAD_START_ROUTINE func = (LPTHREAD_START_ROUTINE)NtCurrentTeb()->entry_point;
if (TRACE_ON(relay))
DPRINTF("%08lx:Starting thread (entryproc=%p)\n", GetCurrentThreadId(), func );
DPRINTF("%04lx:Starting thread (entryproc=%p)\n", GetCurrentThreadId(), func );
PROCESS_CallUserSignalProc( USIG_THREAD_INIT, 0 );
MODULE_DllThreadAttach( NULL );
@ -886,7 +886,7 @@ DWORD WINAPI GetCurrentProcessId(void)
*/
DWORD WINAPI GetCurrentThreadId(void)
{
return (DWORD)NtCurrentTeb()->tid;
return NtCurrentTeb()->tid;
}
#endif /* __i386__ */

View File

@ -2284,7 +2284,7 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg,
DWORD tid = GetWindowThreadProcessId( hWnd, NULL );
if (tid == GetCurrentThreadId()) strcpy( taskName, "self" );
else sprintf( taskName, "tid %08lx", GetCurrentThreadId() );
else sprintf( taskName, "tid %04lx", GetCurrentThreadId() );
if (iFlag == SPY_SENDMESSAGE16)
TRACE("%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n",