diff --git a/controls/listbox.c b/controls/listbox.c index 2e0b51283c0..c08dd8ae973 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -636,15 +636,13 @@ static BOOL LISTBOX_SetTabStops( WND *wnd, LB_DESCR *descr, INT count, { INT i; LPINT16 p = (LPINT16)tabs; - dbg_decl_str(listbox, 256); + TRACE("[%04x]: settabstops ", wnd->hwndSelf ); for (i = 0; i < descr->nb_tabs; i++) { descr->tabs[i] = *p++<<1; /* FIXME */ - if(TRACE_ON(listbox)) - dsprintf(listbox, "%hd ", descr->tabs[i]); + if (TRACE_ON(listbox)) DPRINTF("%hd ", descr->tabs[i]); } - TRACE("[%04x]: settabstops %s\n", - wnd->hwndSelf, dbg_str(listbox)); + if (TRACE_ON(listbox)) DPRINTF("\n"); } else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT) ); /* FIXME: repaint the window? */ diff --git a/controls/menu.c b/controls/menu.c index 45d572db25b..9092a4f31a2 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -182,7 +182,7 @@ static BOOL fEndMenu = FALSE; if(!TRACE_ON(menu)) ; else do_debug_print_menuitem(pre, mp, post) #define MENUOUT(text) \ - dsprintf(menu, "%s%s", (count++ ? "," : ""), (text)) + DPRINTF("%s%s", (count++ ? "," : ""), (text)) #define MENUFLAG(bit,text) \ do { \ @@ -192,17 +192,16 @@ static BOOL fEndMenu = FALSE; static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, const char *postfix) { - dbg_decl_str(menu, 256); - + TRACE("%s ", prefix); if (mp) { UINT flags = mp->fType; int typ = MENU_ITEM_TYPE(flags); - dsprintf(menu, "{ ID=0x%x", mp->wID); + DPRINTF( "{ ID=0x%x", mp->wID); if (flags & MF_POPUP) - dsprintf(menu, ", Sub=0x%x", mp->hSubMenu); + DPRINTF( ", Sub=0x%x", mp->hSubMenu); if (flags) { int count = 0; - dsprintf(menu, ", Typ="); + DPRINTF( ", Typ="); if (typ == MFT_STRING) /* Nothing */ ; else if (typ == MFT_SEPARATOR) @@ -224,12 +223,12 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, MENUFLAG(MFT_RIGHTJUSTIFY, "right"); /* same as MF_HELP */ if (flags) - dsprintf(menu, "+0x%x", flags); + DPRINTF( "+0x%x", flags); } flags = mp->fState; if (flags) { int count = 0; - dsprintf(menu, ", State="); + DPRINTF( ", State="); MENUFLAG(MFS_GRAYED, "grey"); MENUFLAG(MFS_DEFAULT, "default"); MENUFLAG(MFS_DISABLED, "dis"); @@ -238,30 +237,30 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, MENUFLAG(MF_USECHECKBITMAPS, "usebit"); MENUFLAG(MF_MOUSESELECT, "mouse"); if (flags) - dsprintf(menu, "+0x%x", flags); + DPRINTF( "+0x%x", flags); } if (mp->hCheckBit) - dsprintf(menu, ", Chk=0x%x", mp->hCheckBit); + DPRINTF( ", Chk=0x%x", mp->hCheckBit); if (mp->hUnCheckBit) - dsprintf(menu, ", Unc=0x%x", mp->hUnCheckBit); + DPRINTF( ", Unc=0x%x", mp->hUnCheckBit); if (typ == MFT_STRING) { if (mp->text) - dsprintf(menu, ", Text=\"%s\"", mp->text); + DPRINTF( ", Text=\"%s\"", mp->text); else - dsprintf(menu, ", Text=Null"); + DPRINTF( ", Text=Null"); } else if (mp->text == NULL) /* Nothing */ ; else - dsprintf(menu, ", Text=%p", mp->text); + DPRINTF( ", Text=%p", mp->text); if (mp->dwItemData) - dsprintf(menu, ", ItemData=0x%08lx", mp->dwItemData); - dsprintf(menu, " }"); + DPRINTF( ", ItemData=0x%08lx", mp->dwItemData); + DPRINTF( " }"); } else { - dsprintf(menu, "NULL"); + DPRINTF( "NULL"); } - TRACE("%s %s %s\n", prefix, dbg_str(menu), postfix); + DPRINTF(" %s\n", postfix); } #undef MENUOUT diff --git a/controls/scroll.c b/controls/scroll.c index c162b68987b..f5ef07d61e8 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -1277,8 +1277,6 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, SCROLLBAR_INFO *infoPtr; UINT new_flags; - dbg_decl_str(scroll, 256); - *action = 0; if (!(infoPtr = SCROLL_GetScrollInfo(hwnd, nBar))) return 0; @@ -1286,11 +1284,19 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, if ((info->cbSize != sizeof(*info)) && (info->cbSize != sizeof(*info)-sizeof(info->nTrackPos))) return 0; + if (TRACE_ON(scroll)) + { + DPRINTF( "hwnd=%04x bar=%d", hwnd, nBar); + if (info->fMask & SIF_PAGE) DPRINTF( " page=%d", info->nPage ); + if (info->fMask & SIF_POS) DPRINTF( " pos=%d", info->nPos ); + if (info->fMask & SIF_RANGE) DPRINTF( " min=%d max=%d", info->nMin, info->nMax ); + DPRINTF("\n"); + } + /* Set the page size */ if (info->fMask & SIF_PAGE) { - dsprintf(scroll, " page=%d", info->nPage ); if( infoPtr->Page != info->nPage ) { infoPtr->Page = info->nPage; @@ -1302,7 +1308,6 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, if (info->fMask & SIF_POS) { - dsprintf(scroll, " pos=%d", info->nPos ); if( infoPtr->CurVal != info->nPos ) { infoPtr->CurVal = info->nPos; @@ -1314,8 +1319,6 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, if (info->fMask & SIF_RANGE) { - dsprintf(scroll, " min=%d max=%d", info->nMin, info->nMax ); - /* Invalid range -> range is set to (0,0) */ if ((info->nMin > info->nMax) || ((UINT)(info->nMax - info->nMin) >= 0x80000000)) @@ -1335,9 +1338,6 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, } } - TRACE("hwnd=%04x bar=%d %s\n", - hwnd, nBar, dbg_str(scroll)); - /* Make sure the page size is valid */ if (infoPtr->Page < 0) infoPtr->Page = 0; diff --git a/dlls/version/info.c b/dlls/version/info.c index 3654d7d5815..094f1a1e43b 100644 --- a/dlls/version/info.c +++ b/dlls/version/info.c @@ -29,8 +29,6 @@ DEFAULT_DEBUG_CHANNEL(ver) *****************************************************************************/ static void print_vffi_debug(VS_FIXEDFILEINFO *vffi) { - dbg_decl_str(ver, 1024); - TRACE(" structversion=%u.%u, fileversion=%u.%u.%u.%u, productversion=%u.%u.%u.%u, flagmask=0x%lx, flags=%s%s%s%s%s%s\n", HIWORD(vffi->dwStrucVersion),LOWORD(vffi->dwStrucVersion), HIWORD(vffi->dwFileVersionMS),LOWORD(vffi->dwFileVersionMS), @@ -46,95 +44,94 @@ static void print_vffi_debug(VS_FIXEDFILEINFO *vffi) (vffi->dwFileFlags & VS_FF_SPECIALBUILD) ? "SPECIALBUILD," : "" ); - dsprintf(ver," OS=0x%x.0x%x ", + TRACE("("); + DPRINTF(" OS=0x%x.0x%x ", HIWORD(vffi->dwFileOS), LOWORD(vffi->dwFileOS) ); switch (vffi->dwFileOS&0xFFFF0000) { - case VOS_DOS:dsprintf(ver,"DOS,");break; - case VOS_OS216:dsprintf(ver,"OS/2-16,");break; - case VOS_OS232:dsprintf(ver,"OS/2-32,");break; - case VOS_NT:dsprintf(ver,"NT,");break; + case VOS_DOS:DPRINTF("DOS,");break; + case VOS_OS216:DPRINTF("OS/2-16,");break; + case VOS_OS232:DPRINTF("OS/2-32,");break; + case VOS_NT:DPRINTF("NT,");break; case VOS_UNKNOWN: default: - dsprintf(ver,"UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break; + DPRINTF("UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break; } switch (LOWORD(vffi->dwFileOS)) { - case VOS__BASE:dsprintf(ver,"BASE");break; - case VOS__WINDOWS16:dsprintf(ver,"WIN16");break; - case VOS__WINDOWS32:dsprintf(ver,"WIN32");break; - case VOS__PM16:dsprintf(ver,"PM16");break; - case VOS__PM32:dsprintf(ver,"PM32");break; - default:dsprintf(ver,"UNKNOWN(0x%x)",LOWORD(vffi->dwFileOS));break; + case VOS__BASE:DPRINTF("BASE");break; + case VOS__WINDOWS16:DPRINTF("WIN16");break; + case VOS__WINDOWS32:DPRINTF("WIN32");break; + case VOS__PM16:DPRINTF("PM16");break; + case VOS__PM32:DPRINTF("PM32");break; + default:DPRINTF("UNKNOWN(0x%x)",LOWORD(vffi->dwFileOS));break; } - TRACE("(%s)\n", dbg_str(ver)); + DPRINTF(")\n"); - dbg_reset_str(ver); switch (vffi->dwFileType) { default: case VFT_UNKNOWN: - dsprintf(ver,"filetype=Unknown(0x%lx)",vffi->dwFileType); + TRACE("filetype=Unknown(0x%lx)",vffi->dwFileType); break; - case VFT_APP:dsprintf(ver,"filetype=APP,");break; - case VFT_DLL:dsprintf(ver,"filetype=DLL,");break; + case VFT_APP:TRACE("filetype=APP,");break; + case VFT_DLL:TRACE("filetype=DLL,");break; case VFT_DRV: - dsprintf(ver,"filetype=DRV,"); + TRACE("filetype=DRV,"); switch(vffi->dwFileSubtype) { default: case VFT2_UNKNOWN: - dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileSubtype); + DPRINTF("UNKNOWN(0x%lx)",vffi->dwFileSubtype); break; case VFT2_DRV_PRINTER: - dsprintf(ver,"PRINTER"); + DPRINTF("PRINTER"); break; case VFT2_DRV_KEYBOARD: - dsprintf(ver,"KEYBOARD"); + DPRINTF("KEYBOARD"); break; case VFT2_DRV_LANGUAGE: - dsprintf(ver,"LANGUAGE"); + DPRINTF("LANGUAGE"); break; case VFT2_DRV_DISPLAY: - dsprintf(ver,"DISPLAY"); + DPRINTF("DISPLAY"); break; case VFT2_DRV_MOUSE: - dsprintf(ver,"MOUSE"); + DPRINTF("MOUSE"); break; case VFT2_DRV_NETWORK: - dsprintf(ver,"NETWORK"); + DPRINTF("NETWORK"); break; case VFT2_DRV_SYSTEM: - dsprintf(ver,"SYSTEM"); + DPRINTF("SYSTEM"); break; case VFT2_DRV_INSTALLABLE: - dsprintf(ver,"INSTALLABLE"); + DPRINTF("INSTALLABLE"); break; case VFT2_DRV_SOUND: - dsprintf(ver,"SOUND"); + DPRINTF("SOUND"); break; case VFT2_DRV_COMM: - dsprintf(ver,"COMM"); + DPRINTF("COMM"); break; case VFT2_DRV_INPUTMETHOD: - dsprintf(ver,"INPUTMETHOD"); + DPRINTF("INPUTMETHOD"); break; } break; case VFT_FONT: - dsprintf(ver,"filetype=FONT."); + TRACE("filetype=FONT."); switch (vffi->dwFileSubtype) { default: - dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileSubtype); + DPRINTF("UNKNOWN(0x%lx)",vffi->dwFileSubtype); break; - case VFT2_FONT_RASTER:dsprintf(ver,"RASTER");break; - case VFT2_FONT_VECTOR:dsprintf(ver,"VECTOR");break; - case VFT2_FONT_TRUETYPE:dsprintf(ver,"TRUETYPE");break; + case VFT2_FONT_RASTER:DPRINTF("RASTER");break; + case VFT2_FONT_VECTOR:DPRINTF("VECTOR");break; + case VFT2_FONT_TRUETYPE:DPRINTF("TRUETYPE");break; } break; - case VFT_VXD:dsprintf(ver,"filetype=VXD");break; - case VFT_STATIC_LIB:dsprintf(ver,"filetype=STATIC_LIB");break; + case VFT_VXD:TRACE("filetype=VXD");break; + case VFT_STATIC_LIB:TRACE("filetype=STATIC_LIB");break; } - TRACE("%s\n", dbg_str(ver)); - + DPRINTF("\n"); TRACE(" filedata=0x%lx.0x%lx\n", vffi->dwFileDateMS,vffi->dwFileDateLS); } diff --git a/dlls/winaspi/winaspi16.c b/dlls/winaspi/winaspi16.c index 0984397b607..e98c4cdde31 100644 --- a/dlls/winaspi/winaspi16.c +++ b/dlls/winaspi/winaspi16.c @@ -97,7 +97,6 @@ ASPI_DebugPrintCmd(SRB_ExecSCSICmd16 *prb, UINT16 mode) int i; BYTE *cdb; BYTE *lpBuf = 0; - dbg_decl_str(aspi, 512); switch (mode) { @@ -154,11 +153,15 @@ ASPI_DebugPrintCmd(SRB_ExecSCSICmd16 *prb, UINT16 mode) TRACE("POST Proc: %lx\n", (DWORD) prb->SRB_PostProc); cdb = &prb->CDBByte[0]; cmd = prb->CDBByte[0]; - for (i = 0; i < prb->SRB_CDBLen; i++) { - if (i != 0) dsprintf(aspi, ","); - dsprintf(aspi, "%02x", *cdb++); + if (TRACE_ON(aspi)) + { + DPRINTF("CDB buffer["); + for (i = 0; i < prb->SRB_CDBLen; i++) { + if (i != 0) DPRINTF(","); + DPRINTF("%02x", *cdb++); + } + DPRINTF("]\n"); } - TRACE("CDB buffer[%s]\n", dbg_str(aspi)); } static void @@ -166,14 +169,17 @@ ASPI_PrintSenseArea16(SRB_ExecSCSICmd16 *prb) { int i; BYTE *cdb; - dbg_decl_str(aspi, 512); - cdb = &prb->CDBByte[0]; - for (i = 0; i < prb->SRB_SenseLen; i++) { - if (i) dsprintf(aspi, ","); - dsprintf(aspi, "%02x", *cdb++); + if (TRACE_ON(aspi)) + { + cdb = &prb->CDBByte[0]; + DPRINTF("SenseArea["); + for (i = 0; i < prb->SRB_SenseLen; i++) { + if (i) DPRINTF(","); + DPRINTF("%02x", *cdb++); + } + DPRINTF("]\n"); } - TRACE("SenseArea[%s]\n", dbg_str(aspi)); } static void diff --git a/dlls/wnaspi32/winaspi32.c b/dlls/wnaspi32/winaspi32.c index 9e3a5216bb4..350f556ec2c 100644 --- a/dlls/wnaspi32/winaspi32.c +++ b/dlls/wnaspi32/winaspi32.c @@ -90,7 +90,6 @@ ASPI_DebugPrintCmd(SRB_ExecSCSICmd *prb) BYTE cmd; int i; BYTE *cdb; - dbg_decl_str(aspi, 512); switch (prb->CDBByte[0]) { case CMD_INQUIRY: @@ -134,11 +133,15 @@ ASPI_DebugPrintCmd(SRB_ExecSCSICmd *prb) TRACE("POST Proc: %lx\n", (DWORD) prb->SRB_PostProc); cdb = &prb->CDBByte[0]; cmd = prb->CDBByte[0]; - for (i = 0; i < prb->SRB_CDBLen; i++) { - if (i != 0) dsprintf(aspi, ","); - dsprintf(aspi, "%02x", *cdb++); + if (TRACE_ON(aspi)) + { + DPRINTF("CDB buffer["); + for (i = 0; i < prb->SRB_CDBLen; i++) { + if (i != 0) DPRINTF(","); + DPRINTF("%02x", *cdb++); + } + DPRINTF("]\n"); } - TRACE("CDB buffer[%s]\n", dbg_str(aspi)); } static void @@ -146,14 +149,17 @@ ASPI_PrintSenseArea(SRB_ExecSCSICmd *prb) { int i; BYTE *cdb; - dbg_decl_str(aspi, 512); - cdb = &prb->CDBByte[0]; - for (i = 0; i < prb->SRB_SenseLen; i++) { - if (i) dsprintf(aspi, ","); - dsprintf(aspi, "%02x", *cdb++); + if (TRACE_ON(aspi)) + { + cdb = &prb->CDBByte[0]; + DPRINTF("SenseArea["); + for (i = 0; i < prb->SRB_SenseLen; i++) { + if (i) DPRINTF(","); + DPRINTF("%02x", *cdb++); + } + DPRINTF("]\n"); } - TRACE("SenseArea[%s]\n", dbg_str(aspi)); } static void diff --git a/if1632/relay.c b/if1632/relay.c index b82868b3b9e..f7bde624384 100644 --- a/if1632/relay.c +++ b/if1632/relay.c @@ -424,7 +424,6 @@ static DWORD RELAY_CallProc32W(int Ex) VA_LIST16 valist; int i; int aix; - dbg_decl_str(relay, 1024); SYSLEVEL_ReleaseWin16Lock(); @@ -432,7 +431,7 @@ static DWORD RELAY_CallProc32W(int Ex) nrofargs = VA_ARG16( valist, DWORD ); argconvmask = VA_ARG16( valist, DWORD ); proc32 = VA_ARG16( valist, FARPROC ); - dsprintf(relay, "CallProc32W(%ld,%ld,%p, Ex%d args[",nrofargs,argconvmask,proc32,Ex); + TRACE("CallProc32W(%ld,%ld,%p, Ex%d args[",nrofargs,argconvmask,proc32,Ex); args = (DWORD*)HEAP_xalloc( GetProcessHeap(), 0, sizeof(DWORD)*nrofargs ); /* CallProcEx doesn't need its args reversed */ @@ -446,15 +445,15 @@ static DWORD RELAY_CallProc32W(int Ex) { SEGPTR ptr = VA_ARG16( valist, SEGPTR ); args[aix] = (DWORD)PTR_SEG_TO_LIN(ptr); - dsprintf(relay,"%08lx(%p),",ptr,PTR_SEG_TO_LIN(ptr)); + if (TRACE_ON(relay)) DPRINTF("%08lx(%p),",ptr,PTR_SEG_TO_LIN(ptr)); } else { args[aix] = VA_ARG16( valist, DWORD ); - dsprintf(relay,"%ld,",args[aix]); + if (TRACE_ON(relay)) DPRINTF("%ld,",args[aix]); } } - dsprintf(relay,"])"); + if (TRACE_ON(relay)) DPRINTF("])\n"); VA_END16( valist ); if (!proc32) ret = 0; @@ -493,7 +492,7 @@ static DWORD RELAY_CallProc32W(int Ex) /* POP nrofargs DWORD arguments and 3 DWORD parameters */ if (!Ex) stack16_pop( (3 + nrofargs) * sizeof(DWORD) ); - TRACE("%s - returns %08lx\n",dbg_str(relay),ret); + TRACE("CallProc32W - returns %08lx\n",ret); HeapFree( GetProcessHeap(), 0, args ); SYSLEVEL_RestoreWin16Lock(); diff --git a/include/debugtools.h b/include/debugtools.h index bc0428b3a5d..2abc0f7865c 100644 --- a/include/debugtools.h +++ b/include/debugtools.h @@ -31,26 +31,12 @@ extern const char * const debug_ch_name[]; (dbg_printf("%s:%s:%s ", debug_cl_name[(dbcl)], debug_ch_name[(dbch)], __FUNCTION__),0)) \ ? 0 : dbg_printf -#define __DUMMY_DPRINTF 1 ? 0 : ((int (*)(char *, ...)) NULL) +#define __DUMMY_DPRINTF 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL) /* Exported definitions and macros */ - -#define dbg_str(name) debug_str_##name -#define dbg_buf(name) debug_buf_##name - -#define dbg_decl_str(name, size) \ - char dbg_str(name)[size], *dbg_buf(name)=dbg_str(name) - -#define dbg_reset_str(name) \ - dbg_buf(name)=dbg_str(name) - -#define dsprintf(name, format, args...) \ - dbg_buf(name)+=sprintf(dbg_buf(name), format, ## args) - /* use configure to allow user to compile out debugging messages */ - #ifndef NO_TRACE_MSGS #define TRACE __DPRINTF(__DBCL_TRACE,*DBCH_DEFAULT) #define TRACE_(ch) __DPRINTF(__DBCL_TRACE,dbch_##ch) @@ -92,20 +78,6 @@ extern const char * const debug_ch_name[]; #define DPRINTF dbg_printf #define MESSAGE dbg_printf -#ifdef OLD_DEBUG_MACROS -/* transition macros */ -#undef TRACE -#undef WARN -#undef FIXME -#undef ERR -#define TRACE(ch, fmt, args...) TRACE_(ch)(fmt, ## args) -#define WARN(ch, fmt, args...) WARN_(ch)(fmt, ## args) -#define FIXME(ch, fmt, args...) FIXME_(ch)(fmt, ## args) -#define ERR(ch, fmt, args...) ERR_(ch)(fmt, ## args) -#define MSG(format, args...) fprintf(stderr, format, ## args) -#define DUMP dbg_printf -#endif - #endif /* __WINE__ */ #endif /* __WINE_DEBUGTOOLS_H */ diff --git a/loader/pe_image.c b/loader/pe_image.c index 72aa4e0130e..f2cf4332a51 100644 --- a/loader/pe_image.c +++ b/loader/pe_image.c @@ -101,18 +101,19 @@ void dump_exports( HMODULE hModule ) for (i=0;iNumberOfFunctions;i++, function++) { if (!*function) continue; /* No such function */ - if (TRACE_ON(win32)){ - dbg_decl_str(win32, 1024); - - dsprintf(win32,"%4ld %08lx %08x", - i + pe_exports->Base, *function, RVA(*function) ); + if (TRACE_ON(win32)) + { + DPRINTF( "%4ld %08lx %08x", i + pe_exports->Base, *function, RVA(*function) ); /* Check if we have a name for it */ for (j = 0; j < pe_exports->NumberOfNames; j++) if (ordinal[j] == i) - dsprintf(win32, " %s", (char*)RVA(name[j]) ); + { + DPRINTF( " %s", (char*)RVA(name[j]) ); + break; + } if ((*function >= rva_start) && (*function <= rva_end)) - dsprintf(win32, " (forwarded -> %s)", (char *)RVA(*function)); - TRACE_(win32)("%s\n", dbg_str(win32)); + DPRINTF(" (forwarded -> %s)", (char *)RVA(*function)); + DPRINTF("\n"); } } } diff --git a/win32/kernel32.c b/win32/kernel32.c index d851729da5b..f20257fd74f 100644 --- a/win32/kernel32.c +++ b/win32/kernel32.c @@ -890,12 +890,12 @@ DWORD WINAPIV SSCall( DWORD i,ret; DWORD *args = ((DWORD *)&fun) + 1; - if(TRACE_ON(thunk)){ - dbg_decl_str(thunk, 256); + if(TRACE_ON(thunk)) + { + DPRINTF("(%ld,0x%08lx,%p,[",nr,flags,fun); for (i=0;i