Converted to the new debug interface, using script written by Patrik
Stridvall.
diff --git a/loader/dos/module.c b/loader/dos/module.c
index fc54af1..4a34576 100644
--- a/loader/dos/module.c
+++ b/loader/dos/module.c
@@ -28,7 +28,7 @@
#include "ldt.h"
#include "process.h"
#include "miscemu.h"
-#include "debug.h"
+#include "debugtools.h"
#include "dosexe.h"
#include "dosmod.h"
#include "options.h"
@@ -194,7 +194,7 @@
tmpnam(lpDosTask->mm_name);
/* strcpy(lpDosTask->mm_name,"/tmp/mydosimage"); */
lpDosTask->mm_fd=open(lpDosTask->mm_name,O_RDWR|O_CREAT /* |O_TRUNC */,S_IRUSR|S_IWUSR);
- if (lpDosTask->mm_fd<0) ERR(module,"file %s could not be opened\n",lpDosTask->mm_name);
+ if (lpDosTask->mm_fd<0) ERR("file %s could not be opened\n",lpDosTask->mm_name);
/* expand file to 1MB+64K */
lseek(lpDosTask->mm_fd,0x110000-1,SEEK_SET);
x=0; write(lpDosTask->mm_fd,&x,1);
@@ -202,14 +202,14 @@
lpDosTask->img=mmap(NULL,0x110000-START_OFFSET,PROT_READ|PROT_WRITE,MAP_SHARED,lpDosTask->mm_fd,0);
#endif
if (lpDosTask->img==(LPVOID)-1) {
- ERR(module,"could not map shared memory, error=%s\n",strerror(errno));
+ ERR("could not map shared memory, error=%s\n",strerror(errno));
return FALSE;
}
- TRACE(module,"DOS VM86 image mapped at %08lx\n",(DWORD)lpDosTask->img);
+ TRACE("DOS VM86 image mapped at %08lx\n",(DWORD)lpDosTask->img);
pModule->dos_image=lpDosTask->img;
/* initialize the memory */
- TRACE(module,"Initializing DOS memory structures\n");
+ TRACE("Initializing DOS memory structures\n");
DOSMEM_Init(lpDosTask->hModule);
MZ_InitHandlers(lpDosTask);
MZ_InitXMS(lpDosTask);
@@ -253,17 +253,17 @@
env_seg=MZ_InitEnvironment(lpDosTask,env,ofs->szPathName);
/* allocate memory for the executable */
- TRACE(module,"Allocating DOS memory (min=%ld, max=%ld)\n",min_size,max_size);
+ TRACE("Allocating DOS memory (min=%ld, max=%ld)\n",min_size,max_size);
avail=DOSMEM_Available(lpDosTask->hModule);
if (avail<min_size) {
- ERR(module, "insufficient DOS memory\n");
+ ERR("insufficient DOS memory\n");
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
if (avail>max_size) avail=max_size;
psp_start=DOSMEM_GetBlock(lpDosTask->hModule,avail,&lpDosTask->psp_seg);
if (!psp_start) {
- ERR(module, "error allocating DOS memory\n");
+ ERR("error allocating DOS memory\n");
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
@@ -272,7 +272,7 @@
MZ_InitPSP(psp_start, cmdline, env_seg);
/* load executable image */
- TRACE(module,"loading DOS %s image, %08lx bytes\n",old_com?"COM":"EXE",image_size);
+ TRACE("loading DOS %s image, %08lx bytes\n",old_com?"COM":"EXE",image_size);
_llseek(hFile,image_start,FILE_BEGIN);
if ((_lread(hFile,load_start,image_size)) != image_size) {
SetLastError(ERROR_BAD_FORMAT);
@@ -281,7 +281,7 @@
if (mz_header.e_crlc) {
/* load relocation table */
- TRACE(module,"loading DOS EXE relocation table, %d entries\n",mz_header.e_crlc);
+ TRACE("loading DOS EXE relocation table, %d entries\n",mz_header.e_crlc);
/* FIXME: is this too slow without read buffering? */
_llseek(hFile,mz_header.e_lfarlc,FILE_BEGIN);
for (x=0; x<mz_header.e_crlc; x++) {
@@ -298,7 +298,7 @@
lpDosTask->init_ss=lpDosTask->load_seg+mz_header.e_ss;
lpDosTask->init_sp=mz_header.e_sp;
- TRACE(module,"entry point: %04x:%04x\n",lpDosTask->init_cs,lpDosTask->init_ip);
+ TRACE("entry point: %04x:%04x\n",lpDosTask->init_cs,lpDosTask->init_ip);
return TRUE;
}
@@ -364,9 +364,9 @@
CLIENT_SendRequest( REQ_GET_WRITE_FD, -1, 1, &w_req, sizeof(w_req) );
CLIENT_WaitReply( NULL, &x_fd, 0 );
- TRACE(module,"win32 pipe: read=%d, write=%d, unix pipe: read=%d, write=%d\n",
+ TRACE("win32 pipe: read=%d, write=%d, unix pipe: read=%d, write=%d\n",
lpDosTask->hReadPipe,lpDosTask->hXPipe,lpDosTask->read_pipe,x_fd);
- TRACE(module,"outbound unix pipe: read=%d, write=%d, pid=%d\n",write_fd[0],write_fd[1],getpid());
+ TRACE("outbound unix pipe: read=%d, write=%d, pid=%d\n",write_fd[0],write_fd[1],getpid());
lpDosTask->write_pipe=write_fd[1];
@@ -382,7 +382,7 @@
fname=fproc; farg=arg;
}
- TRACE(module,"Loading DOS VM support module (hmodule=%04x)\n",lpDosTask->hModule);
+ TRACE("Loading DOS VM support module (hmodule=%04x)\n",lpDosTask->hModule);
if ((child=fork())<0) {
close(write_fd[0]);
close(lpDosTask->read_pipe);
@@ -404,7 +404,7 @@
if (read(lpDosTask->read_pipe,&ret,sizeof(ret))==sizeof(ret)) break;
if ((errno==EINTR)||(errno==EAGAIN)) continue;
/* failure */
- ERR(module,"dosmod has failed to initialize\n");
+ ERR("dosmod has failed to initialize\n");
if (lpDosTask->mm_name[0]!=0) unlink(lpDosTask->mm_name);
return FALSE;
}
@@ -414,8 +414,8 @@
/* start simulated system timer */
MZ_InitTimer(lpDosTask,ret);
if (ret<2) {
- ERR(module,"dosmod version too old! Please install newer dosmod properly\n");
- ERR(module,"If you don't, the new dosmod event handling system will not work\n");
+ ERR("dosmod version too old! Please install newer dosmod properly\n");
+ ERR("If you don't, the new dosmod event handling system will not work\n");
}
/* all systems are now go */
} else {
@@ -444,7 +444,7 @@
/* and, just for completeness... */
execl("loader/dos/dosmod",fname,farg,NULL);
/* if failure, exit */
- ERR(module,"Failed to spawn dosmod, error=%s\n",strerror(errno));
+ ERR("Failed to spawn dosmod, error=%s\n",strerror(errno));
exit(1);
}
return TRUE;
@@ -512,7 +512,7 @@
DOSEVENT *event,*p_event;
DOSSYSTEM *sys,*p_sys;
- TRACE(module,"killing DOS task\n");
+ TRACE("killing DOS task\n");
if (lpDosTask->mm_name[0]!=0) {
munmap(lpDosTask->img,0x110000-START_OFFSET);
close(lpDosTask->mm_fd);
@@ -563,7 +563,7 @@
BOOL inherit, DWORD flags, LPSTARTUPINFOA startup,
LPPROCESS_INFORMATION info )
{
- WARN(module,"DOS executables not supported on this architecture\n");
+ WARN("DOS executables not supported on this architecture\n");
SetLastError(ERROR_BAD_FORMAT);
return FALSE;
}
diff --git a/loader/elf.c b/loader/elf.c
index 6342d40..d4ba4e9 100644
--- a/loader/elf.c
+++ b/loader/elf.c
@@ -23,7 +23,7 @@
#include "heap.h"
#include "module.h"
#include "pe_image.h"
-#include "debug.h"
+#include "debugtools.h"
#include "winerror.h"
#include "elfdll.h"
@@ -162,7 +162,7 @@
assert(wm->type == MODULE32_ELF);
if (!HIWORD(funcName)) {
- ERR(win32,"Can't import from UNIX dynamic libs by ordinal, sorry.\n");
+ ERR("Can't import from UNIX dynamic libs by ordinal, sorry.\n");
return (FARPROC)0;
}
fun = dlsym(wm->binfmt.elf.dlhandle,funcName);
@@ -204,7 +204,7 @@
stub++;
}
if (i==STUBSIZE/sizeof(ELF_STDCALL_STUB)) {
- ERR(win32,"please report, that there are not enough slots for stdcall stubs in the ELF loader.\n");
+ ERR("please report, that there are not enough slots for stdcall stubs in the ELF loader.\n");
assert(i<STUBSIZE/sizeof(ELF_STDCALL_STUB));
}
if (!stub->origfun)
@@ -247,7 +247,7 @@
fun=(FARPROC)stub;
}
if (!fun) {
- FIXME(win32,"function %s not found: %s\n",funcName,dlerror());
+ FIXME("function %s not found: %s\n",funcName,dlerror());
return fun;
}
fun = SNOOP_GetProcAddress(wm->module,funcName,stub-wm->binfmt.elf.stubs,fun);
diff --git a/loader/libres.c b/loader/libres.c
index 79b4cbb..a1727c4 100644
--- a/loader/libres.c
+++ b/loader/libres.c
@@ -8,7 +8,7 @@
#include "wine/winestring.h"
#include "libres.h"
#include "resource.h"
-#include "debug.h"
+#include "debugtools.h"
#include "heap.h"
#include "xmalloc.h"
@@ -67,7 +67,7 @@
}
else
{
- TRACE(resource, "(*,*,type=string): Returning 0\n");
+ TRACE("(*,*,type=string): Returning 0\n");
return 0;
}
}
diff --git a/loader/loadorder.c b/loader/loadorder.c
index d8a19a8..0784f68 100644
--- a/loader/loadorder.c
+++ b/loader/loadorder.c
@@ -16,7 +16,7 @@
#include "options.h"
#include "module.h"
#include "elfdll.h"
-#include "debug.h"
+#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(module)
@@ -130,7 +130,7 @@
if(n >= MODULE_LOADORDER_NTYPES)
{
- ERR(module, "More than existing %d module-types specified, rest ignored", MODULE_LOADORDER_NTYPES);
+ ERR("More than existing %d module-types specified, rest ignored", MODULE_LOADORDER_NTYPES);
break;
}
@@ -149,7 +149,7 @@
case 'b': type = MODULE_LOADORDER_BI; break;
default:
- ERR(module, "Invalid load order module-type '%s', ignored\n", cptr);
+ ERR("Invalid load order module-type '%s', ignored\n", cptr);
}
if(type != MODULE_LOADORDER_INVALID)
@@ -179,7 +179,7 @@
if(!cmp_sort_func(plo, &module_loadorder[i]))
{
if(!override)
- ERR(module, "Module '%s' is already in the list of overrides, using first definition\n", plo->modulename);
+ ERR("Module '%s' is already in the list of overrides, using first definition\n", plo->modulename);
else
memcpy(module_loadorder[i].loadorder, plo->loadorder, sizeof(plo->loadorder));
return TRUE;
@@ -196,7 +196,7 @@
nmodule_loadorder_alloc * sizeof(module_loadorder_t));
if(!module_loadorder)
{
- MSG("Virtual memory exhausted\n");
+ MESSAGE("Virtual memory exhausted\n");
exit(1);
}
}
@@ -230,7 +230,7 @@
if(ext)
{
if(strlen(ext) == 4 && (!strcasecmp(ext, ".dll") || !strcasecmp(ext, ".exe")))
- MSG("Warning: Loadorder override '%s' contains an extension and might not be found during lookup\n", cptr);
+ MESSAGE("Warning: Loadorder override '%s' contains an extension and might not be found during lookup\n", cptr);
}
ldo.modulename = cptr;
@@ -279,7 +279,7 @@
*value = '\0';
value++;
- TRACE(module, "Commandline override '%s' = '%s'\n", key, value);
+ TRACE("Commandline override '%s' = '%s'\n", key, value);
if(!AddLoadOrderSet(key, value, TRUE))
{
@@ -373,7 +373,7 @@
if(nbuffer)
{
extra_ld_library_path = HEAP_strdupA(SystemHeap, 0, buffer);
- TRACE(module, "Setting extra LD_LIBRARY_PATH=%s\n", buffer);
+ TRACE("Setting extra LD_LIBRARY_PATH=%s\n", buffer);
}
#endif
@@ -381,11 +381,11 @@
nbuffer = PROFILE_GetWineIniString("DllDefaults", "DefaultLoadOrder", "n,e,s,b", buffer, sizeof(buffer));
if(!nbuffer)
{
- MSG("MODULE_InitLoadOrder: misteriously read nothing from default loadorder\n");
+ MESSAGE("MODULE_InitLoadOrder: misteriously read nothing from default loadorder\n");
return FALSE;
}
- TRACE(module, "Setting default loadorder=%s\n", buffer);
+ TRACE("Setting default loadorder=%s\n", buffer);
if(!ParseLoadOrder(buffer, &default_loadorder))
return FALSE;
@@ -405,7 +405,7 @@
nbuffer = PROFILE_GetWineIniString("DllOverrides", NULL, "", buffer, sizeof(buffer));
if(nbuffer == BUFFERSIZE-2)
{
- ERR(module, "BUFFERSIZE %d is too small to read [DllOverrides]. Needs to grow in the source\n", BUFFERSIZE);
+ ERR("BUFFERSIZE %d is too small to read [DllOverrides]. Needs to grow in the source\n", BUFFERSIZE);
return FALSE;
}
if(nbuffer)
@@ -422,16 +422,16 @@
nbuffer = PROFILE_GetWineIniString("DllOverrides", key, "", value, sizeof(value));
if(!nbuffer)
{
- ERR(module, "Module(s) '%s' will always fail to load. Are you sure you want this?\n", key);
+ ERR("Module(s) '%s' will always fail to load. Are you sure you want this?\n", key);
value[0] = '\0'; /* Just in case */
}
if(nbuffer == BUFFERSIZE-2)
{
- ERR(module, "BUFFERSIZE %d is too small to read [DllOverrides] key '%s'. Needs to grow in the source\n", BUFFERSIZE, key);
+ ERR("BUFFERSIZE %d is too small to read [DllOverrides] key '%s'. Needs to grow in the source\n", BUFFERSIZE, key);
return FALSE;
}
- TRACE(module, "Key '%s' uses override '%s'\n", key, value);
+ TRACE("Key '%s' uses override '%s'\n", key, value);
if(!AddLoadOrderSet(key, value, TRUE))
return FALSE;
@@ -441,7 +441,7 @@
/* Add the commandline overrides to the pool */
if(!ParseCommandlineOverrides())
{
- MSG( "Syntax: -dll name[,name[,...]]={native|elfdll|so|builtin}[,{n|e|s|b}[,...]][:...]\n"
+ MESSAGE( "Syntax: -dll name[,name[,...]]={native|elfdll|so|builtin}[,{n|e|s|b}[,...]][:...]\n"
" - 'name' is the name of any dll without extension\n"
" - the order of loading (native, elfdll, so and builtin) can be abbreviated\n"
" with the first letter\n"
@@ -460,7 +460,7 @@
nbuffer = PROFILE_GetWineIniString("DllPairs", NULL, "", buffer, sizeof(buffer));
if(nbuffer == BUFFERSIZE-2)
{
- ERR(module, "BUFFERSIZE %d is too small to read [DllPairs]. Needs to grow in the source\n", BUFFERSIZE);
+ ERR("BUFFERSIZE %d is too small to read [DllPairs]. Needs to grow in the source\n", BUFFERSIZE);
return FALSE;
}
if(nbuffer)
@@ -479,12 +479,12 @@
nbuffer = PROFILE_GetWineIniString("DllPairs", key, "", value, sizeof(value));
if(!nbuffer)
{
- ERR(module, "Module pair '%s' is not associated with another module?\n", key);
+ ERR("Module pair '%s' is not associated with another module?\n", key);
continue;
}
if(nbuffer == BUFFERSIZE-2)
{
- ERR(module, "BUFFERSIZE %d is too small to read [DllPairs] key '%s'. Needs to grow in the source\n", BUFFERSIZE, key);
+ ERR("BUFFERSIZE %d is too small to read [DllPairs] key '%s'. Needs to grow in the source\n", BUFFERSIZE, key);
return FALSE;
}
@@ -493,7 +493,7 @@
assert(plo1 && plo2);
if(memcmp(plo1->loadorder, plo2->loadorder, sizeof(plo1->loadorder)))
- MSG("Warning: Modules '%s' and '%s' have different loadorder which may cause trouble\n", key, value);
+ MESSAGE("Warning: Modules '%s' and '%s' have different loadorder which may cause trouble\n", key, value);
}
}
@@ -551,7 +551,7 @@
len = strlen(name);
if(len >= sizeof(fname) || len <= 0)
{
- ERR(module, "Path '%s' -> '%s' reduces to zilch or just too large...\n", path, name);
+ ERR("Path '%s' -> '%s' reduces to zilch or just too large...\n", path, name);
return &default_loadorder;
}
@@ -562,7 +562,7 @@
lo.modulename = fname;
tmp = bsearch(&lo, module_loadorder, nmodule_loadorder, sizeof(module_loadorder[0]), cmp_sort_func);
- TRACE(module, "Looking for '%s' (%s), found '%s'\n", path, fname, tmp ? tmp->modulename : "<nothing>");
+ TRACE("Looking for '%s' (%s), found '%s'\n", path, fname, tmp ? tmp->modulename : "<nothing>");
if(!tmp)
return &default_loadorder;
diff --git a/loader/main.c b/loader/main.c
index a7b361b..b182db5 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -44,7 +44,7 @@
#include "winsock.h"
#include "thread.h"
#include "task.h"
-#include "debug.h"
+#include "debugtools.h"
#include "psdrv.h"
#include "server.h"
#include "cursoricon.h"
diff --git a/loader/ne/convert.c b/loader/ne/convert.c
index a97af8e..590e77a 100644
--- a/loader/ne/convert.c
+++ b/loader/ne/convert.c
@@ -7,7 +7,7 @@
#include <string.h>
#include "wine/winuser16.h"
#include "module.h"
-#include "debug.h"
+#include "debugtools.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(resource)
@@ -407,7 +407,7 @@
{
HGLOBAL16 handle;
- TRACE( resource, "module=%04x type=%04x\n", pModule->self, type );
+ TRACE("module=%04x type=%04x\n", pModule->self, type );
if (!pModule || !bits || !size) return 0;
handle = GlobalAlloc16( 0, size );
@@ -427,7 +427,7 @@
break;
case RT_STRING16:
- FIXME( resource, "not yet implemented!\n" );
+ FIXME("not yet implemented!\n" );
/* fall through */
default:
diff --git a/loader/ne/module.c b/loader/ne/module.c
index 677e19c..67d946a 100644
--- a/loader/ne/module.c
+++ b/loader/ne/module.c
@@ -26,7 +26,7 @@
#include "toolhelp.h"
#include "snoop.h"
#include "stackframe.h"
-#include "debug.h"
+#include "debugtools.h"
#include "file.h"
#include "loadorder.h"
#include "elfdll.h"
@@ -69,72 +69,72 @@
if (!(pModule = NE_GetPtr( hModule )))
{
- MSG( "**** %04x is not a module handle\n", hModule );
+ MESSAGE( "**** %04x is not a module handle\n", hModule );
return;
}
/* Dump the module info */
- DUMP( "---\n" );
- DUMP( "Module %04x:\n", hModule );
- DUMP( "count=%d flags=%04x heap=%d stack=%d\n",
+ DPRINTF( "---\n" );
+ DPRINTF( "Module %04x:\n", hModule );
+ DPRINTF( "count=%d flags=%04x heap=%d stack=%d\n",
pModule->count, pModule->flags,
pModule->heap_size, pModule->stack_size );
- DUMP( "cs:ip=%04x:%04x ss:sp=%04x:%04x ds=%04x nb seg=%d modrefs=%d\n",
+ DPRINTF( "cs:ip=%04x:%04x ss:sp=%04x:%04x ds=%04x nb seg=%d modrefs=%d\n",
pModule->cs, pModule->ip, pModule->ss, pModule->sp, pModule->dgroup,
pModule->seg_count, pModule->modref_count );
- DUMP( "os_flags=%d swap_area=%d version=%04x\n",
+ DPRINTF( "os_flags=%d swap_area=%d version=%04x\n",
pModule->os_flags, pModule->min_swap_area,
pModule->expected_version );
if (pModule->flags & NE_FFLAGS_WIN32)
- DUMP( "PE module=%08x\n", pModule->module32 );
+ DPRINTF( "PE module=%08x\n", pModule->module32 );
/* Dump the file info */
- DUMP( "---\n" );
- DUMP( "Filename: '%s'\n", NE_MODULE_NAME(pModule) );
+ DPRINTF( "---\n" );
+ DPRINTF( "Filename: '%s'\n", NE_MODULE_NAME(pModule) );
/* Dump the segment table */
- DUMP( "---\n" );
- DUMP( "Segment table:\n" );
+ DPRINTF( "---\n" );
+ DPRINTF( "Segment table:\n" );
pSeg = NE_SEG_TABLE( pModule );
for (i = 0; i < pModule->seg_count; i++, pSeg++)
- DUMP( "%02x: pos=%d size=%d flags=%04x minsize=%d hSeg=%04x\n",
+ DPRINTF( "%02x: pos=%d size=%d flags=%04x minsize=%d hSeg=%04x\n",
i + 1, pSeg->filepos, pSeg->size, pSeg->flags,
pSeg->minsize, pSeg->hSeg );
/* Dump the resource table */
- DUMP( "---\n" );
- DUMP( "Resource table:\n" );
+ DPRINTF( "---\n" );
+ DPRINTF( "Resource table:\n" );
if (pModule->res_table)
{
pword = (WORD *)((BYTE *)pModule + pModule->res_table);
- DUMP( "Alignment: %d\n", *pword++ );
+ DPRINTF( "Alignment: %d\n", *pword++ );
while (*pword)
{
struct resource_typeinfo_s *ptr = (struct resource_typeinfo_s *)pword;
struct resource_nameinfo_s *pname = (struct resource_nameinfo_s *)(ptr + 1);
- DUMP( "id=%04x count=%d\n", ptr->type_id, ptr->count );
+ DPRINTF( "id=%04x count=%d\n", ptr->type_id, ptr->count );
for (i = 0; i < ptr->count; i++, pname++)
- DUMP( "offset=%d len=%d id=%04x\n",
+ DPRINTF( "offset=%d len=%d id=%04x\n",
pname->offset, pname->length, pname->id );
pword = (WORD *)pname;
}
}
- else DUMP( "None\n" );
+ else DPRINTF( "None\n" );
/* Dump the resident name table */
- DUMP( "---\n" );
- DUMP( "Resident-name table:\n" );
+ DPRINTF( "---\n" );
+ DPRINTF( "Resident-name table:\n" );
pstr = (char *)pModule + pModule->name_table;
while (*pstr)
{
- DUMP( "%*.*s: %d\n", *pstr, *pstr, pstr + 1,
+ DPRINTF( "%*.*s: %d\n", *pstr, *pstr, pstr + 1,
*(WORD *)(pstr + *pstr + 1) );
pstr += *pstr + 1 + sizeof(WORD);
}
/* Dump the module reference table */
- DUMP( "---\n" );
- DUMP( "Module ref table:\n" );
+ DPRINTF( "---\n" );
+ DPRINTF( "Module ref table:\n" );
if (pModule->modref_table)
{
pword = (WORD *)((BYTE *)pModule + pModule->modref_table);
@@ -142,44 +142,44 @@
{
char name[10];
GetModuleName16( *pword, name, sizeof(name) );
- DUMP( "%d: %04x -> '%s'\n", i, *pword, name );
+ DPRINTF( "%d: %04x -> '%s'\n", i, *pword, name );
}
}
- else DUMP( "None\n" );
+ else DPRINTF( "None\n" );
/* Dump the entry table */
- DUMP( "---\n" );
- DUMP( "Entry table:\n" );
+ DPRINTF( "---\n" );
+ DPRINTF( "Entry table:\n" );
bundle = (ET_BUNDLE *)((BYTE *)pModule+pModule->entry_table);
do {
entry = (ET_ENTRY *)((BYTE *)bundle+6);
- DUMP( "Bundle %d-%d: %02x\n", bundle->first, bundle->last, entry->type);
+ DPRINTF( "Bundle %d-%d: %02x\n", bundle->first, bundle->last, entry->type);
ordinal = bundle->first;
while (ordinal < bundle->last)
{
if (entry->type == 0xff)
- DUMP("%d: %02x:%04x (moveable)\n", ordinal++, entry->segnum, entry->offs);
+ DPRINTF("%d: %02x:%04x (moveable)\n", ordinal++, entry->segnum, entry->offs);
else
- DUMP("%d: %02x:%04x (fixed)\n", ordinal++, entry->segnum, entry->offs);
+ DPRINTF("%d: %02x:%04x (fixed)\n", ordinal++, entry->segnum, entry->offs);
entry++;
}
} while ( (bundle->next)
&& (bundle = ((ET_BUNDLE *)((BYTE *)pModule + bundle->next))) );
/* Dump the non-resident names table */
- DUMP( "---\n" );
- DUMP( "Non-resident names table:\n" );
+ DPRINTF( "---\n" );
+ DPRINTF( "Non-resident names table:\n" );
if (pModule->nrname_handle)
{
pstr = (char *)GlobalLock16( pModule->nrname_handle );
while (*pstr)
{
- DUMP( "%*.*s: %d\n", *pstr, *pstr, pstr + 1,
+ DPRINTF( "%*.*s: %d\n", *pstr, *pstr, pstr + 1,
*(WORD *)(pstr + *pstr + 1) );
pstr += *pstr + 1 + sizeof(WORD);
}
}
- DUMP( "\n" );
+ DPRINTF( "\n" );
}
@@ -191,16 +191,16 @@
void NE_WalkModules(void)
{
HMODULE16 hModule = hFirstModule;
- MSG( "Module Flags Name\n" );
+ MESSAGE( "Module Flags Name\n" );
while (hModule)
{
NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule)
{
- MSG( "Bad module %04x in list\n", hModule );
+ MESSAGE( "Bad module %04x in list\n", hModule );
return;
}
- MSG( " %04x %04x %.*s\n", hModule, pModule->flags,
+ MESSAGE( " %04x %04x %.*s\n", hModule, pModule->flags,
*((char *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1 );
hModule = pModule->next;
@@ -232,7 +232,7 @@
if (!(pModule = NE_GetPtr( hModule ))) return 0;
assert( !(pModule->flags & NE_FFLAGS_WIN32) );
- TRACE( module, "(%04x,'%s')\n", hModule, name );
+ TRACE("(%04x,'%s')\n", hModule, name );
/* First handle names of the form '#xxxx' */
@@ -254,7 +254,7 @@
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
- TRACE(module, " Found: ordinal=%d\n",
+ TRACE(" Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
@@ -272,7 +272,7 @@
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
- TRACE(module, " Found: ordinal=%d\n",
+ TRACE(" Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
@@ -370,7 +370,7 @@
static HANDLE cachedfd = -1;
- TRACE( module, "(%p) cache: mod=%p fd=%d\n",
+ TRACE("(%p) cache: mod=%p fd=%d\n",
pModule, pCachedModule, cachedfd );
if (pCachedModule == pModule) return cachedfd;
CloseHandle( cachedfd );
@@ -378,11 +378,11 @@
name = NE_MODULE_NAME( pModule );
if ((cachedfd = CreateFileA( name, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, 0, -1 )) == -1)
- MSG( "Can't open file '%s' for module %04x\n", name, pModule->self );
+ MESSAGE( "Can't open file '%s' for module %04x\n", name, pModule->self );
else
/* FIXME: should not be necessary */
cachedfd = ConvertToGlobalHandle(cachedfd);
- TRACE(module, "opened '%s' -> %d\n",
+ TRACE("opened '%s' -> %d\n",
name, cachedfd );
return cachedfd;
}
@@ -425,7 +425,7 @@
if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return (HMODULE16)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_OS2_SIGNATURE_LX) {
- MSG("Sorry, this is an OS/2 linear executable (LX) file !\n");
+ MESSAGE("Sorry, this is an OS/2 linear executable (LX) file !\n");
return (HMODULE16)12;
}
@@ -475,7 +475,7 @@
{
fastload_offset=ne_header.fastload_offset<<ne_header.align_shift_count;
fastload_length=ne_header.fastload_length<<ne_header.align_shift_count;
- TRACE(module, "Using fast-load area offset=%x len=%d\n",
+ TRACE("Using fast-load area offset=%x len=%d\n",
fastload_offset, fastload_length );
if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
{
@@ -483,7 +483,7 @@
if (_hread16(hFile, fastload, fastload_length) != fastload_length)
{
HeapFree( SystemHeap, 0, fastload );
- WARN( module, "Error reading fast-load area!\n");
+ WARN("Error reading fast-load area!\n");
fastload = NULL;
}
}
@@ -590,7 +590,7 @@
{
BYTE nr_entries, type, *s;
- TRACE(module, "Converting entry table.\n");
+ TRACE("Converting entry table.\n");
pModule->entry_table = (int)pData - (int)pModule;
if (!READ( mz_header.e_lfanew + ne_header.entry_tab_offset,
ne_header.entry_tab_length, pTempEntryTable ))
@@ -603,10 +603,10 @@
}
s = pTempEntryTable;
- TRACE(module, "entry table: offs %04x, len %04x, entries %d\n", ne_header.entry_tab_offset, ne_header.entry_tab_length, *s);
+ TRACE("entry table: offs %04x, len %04x, entries %d\n", ne_header.entry_tab_offset, ne_header.entry_tab_length, *s);
bundle = (ET_BUNDLE *)pData;
- TRACE(module, "first bundle: %p\n", bundle);
+ TRACE("first bundle: %p\n", bundle);
memset(bundle, 0, sizeof(ET_BUNDLE)); /* in case no entry table exists */
entry = (ET_ENTRY *)((BYTE *)bundle+6);
@@ -649,7 +649,7 @@
oldbundle = bundle;
oldbundle->next = ((int)entry - (int)pModule);
bundle = (ET_BUNDLE *)entry;
- TRACE(module, "new bundle: %p\n", bundle);
+ TRACE("new bundle: %p\n", bundle);
bundle->first = bundle->last =
oldbundle->last + nr_entries;
bundle->next = 0;
@@ -671,7 +671,7 @@
2 * (ne_header.entry_tab_length - ne_header.n_mov_entry_points*6);
if ((DWORD)entry > (DWORD)pData)
- ERR(module, "converted entry table bigger than reserved space !!!\nentry: %p, pData: %p. Please report !\n", entry, pData);
+ ERR("converted entry table bigger than reserved space !!!\nentry: %p, pData: %p. Please report !\n", entry, pData);
/* Store the filename information */
@@ -751,7 +751,7 @@
memcpy( buffer, pstr + 1, *pstr );
*(buffer + *pstr) = 0; /* terminate it */
- TRACE(module, "Loading '%s'\n", buffer );
+ TRACE("Loading '%s'\n", buffer );
if (!(*pModRef = GetModuleHandle16( buffer )))
{
/* If the DLL is not loaded yet, load it and store */
@@ -762,7 +762,7 @@
{
/* FIXME: cleanup what was done */
- MSG( "Could not load '%s' required by '%.*s', error=%d\n",
+ MESSAGE( "Could not load '%s' required by '%.*s', error=%d\n",
buffer, *((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1, hDLL );
return FALSE;
@@ -887,22 +887,22 @@
switch(plo->loadorder[i])
{
case MODULE_LOADORDER_DLL:
- TRACE(module, "Trying native dll '%s'\n", libname);
+ TRACE("Trying native dll '%s'\n", libname);
hinst = NE_LoadModule(libname, implicit);
break;
case MODULE_LOADORDER_ELFDLL:
- TRACE(module, "Trying elfdll '%s'\n", libname);
+ TRACE("Trying elfdll '%s'\n", libname);
hinst = ELFDLL_LoadModule16(libname, implicit);
break;
case MODULE_LOADORDER_BI:
- TRACE(module, "Trying built-in '%s'\n", libname);
+ TRACE("Trying built-in '%s'\n", libname);
hinst = fnBUILTIN_LoadModule(libname, TRUE);
break;
default:
- ERR(module, "Got invalid loadorder type %d (%s index %d)\n", plo->loadorder[i], plo->modulename, i);
+ ERR("Got invalid loadorder type %d (%s index %d)\n", plo->loadorder[i], plo->modulename, i);
/* Fall through */
case MODULE_LOADORDER_SO: /* This is not supported for NE modules */
@@ -921,7 +921,7 @@
hModule = GetModuleHandle16(libname);
if(!hModule)
{
- ERR(module, "Serious trouble. Just loaded module '%s' (hinst=0x%04x), but can't get module handle\n",
+ ERR("Serious trouble. Just loaded module '%s' (hinst=0x%04x), but can't get module handle\n",
libname, hinst);
return 6; /* ERROR_INVALID_HANDLE seems most appropriate */
}
@@ -929,12 +929,12 @@
pModule = NE_GetPtr(hModule);
if(!pModule)
{
- ERR(module, "Serious trouble. Just loaded module '%s' (hinst=0x%04x), but can't get NE_MODULE pointer\n",
+ ERR("Serious trouble. Just loaded module '%s' (hinst=0x%04x), but can't get NE_MODULE pointer\n",
libname, hinst);
return 6; /* ERROR_INVALID_HANDLE seems most appropriate */
}
- TRACE(module, "Loaded module '%s' at 0x%04x, \n", libname, hinst);
+ TRACE("Loaded module '%s' at 0x%04x, \n", libname, hinst);
/*
* Call initialization routines for all loaded DLLs. Note that
@@ -1153,7 +1153,7 @@
if (dirsep1)
*dirsep1=0;
- TRACE( module, "looking for (%p) %s and %s \n",
+ TRACE("looking for (%p) %s and %s \n",
libname, libname,strippedname );
/* Load library module */
@@ -1178,7 +1178,7 @@
if (ordinal) WEP = NE_GetEntryPoint( hModule, ordinal );
if (!WEP)
{
- WARN(module, "module %04x doesn't have a WEP\n", hModule );
+ WARN("module %04x doesn't have a WEP\n", hModule );
return FALSE;
}
return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL );
@@ -1200,7 +1200,7 @@
if (!(pModule = NE_GetPtr( hModule ))) return FALSE;
hModule = pModule->self;
- TRACE( module, "%04x count %d\n", hModule, pModule->count );
+ TRACE("%04x count %d\n", hModule, pModule->count );
if (((INT16)(--pModule->count)) > 0 ) return TRUE;
else pModule->count = 0;
@@ -1274,7 +1274,7 @@
*/
void WINAPI FreeLibrary16( HINSTANCE16 handle )
{
- TRACE(module,"%04x\n", handle );
+ TRACE("%04x\n", handle );
FreeModule16( handle );
}
@@ -1330,7 +1330,7 @@
if (!hModule) hModule = GetCurrentTask();
if (!(pModule = NE_GetPtr( hModule ))) return 0;
lstrcpynA( lpFileName, NE_MODULE_NAME(pModule), nSize );
- TRACE(module, "%s\n", lpFileName );
+ TRACE("%s\n", lpFileName );
return strlen(lpFileName);
}
@@ -1367,7 +1367,7 @@
char tmpstr[128];
NE_MODULE *pModule;
- TRACE(module, "(%s)\n", name);
+ TRACE("(%s)\n", name);
if (!HIWORD(name))
return GetExePtr(LOWORD(name));
@@ -1462,7 +1462,7 @@
if (!strcmp(tmpstr,"TIMER"))
{
- FIXME(module, "Eh... Should return caller's code segment, expect crash\n");
+ FIXME("Eh... Should return caller's code segment, expect crash\n");
return 0;
}
diff --git a/loader/ne/resource.c b/loader/ne/resource.c
index 6bd6215..4c1fd44 100644
--- a/loader/ne/resource.c
+++ b/loader/ne/resource.c
@@ -21,7 +21,7 @@
#include "neexe.h"
#include "resource.h"
#include "callback.h"
-#include "debug.h"
+#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(resource)
@@ -53,13 +53,13 @@
pNameInfo = (NE_NAMEINFO *)(pTypeInfo + 1);
for (count = pTypeInfo->count; count > 0; count--, pNameInfo++)
{
- TRACE(resource, "NameTable entry: type=%04x id=%04x\n",
+ TRACE("NameTable entry: type=%04x id=%04x\n",
pTypeInfo->type_id, pNameInfo->id );
handle = LoadResource16( pModule->self,
(HRSRC16)((int)pNameInfo - (int)pModule) );
for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p))
{
- TRACE(resource," type=%04x '%s' id=%04x '%s'\n",
+ TRACE(" type=%04x '%s' id=%04x '%s'\n",
p[1], (char *)(p+3), p[2],
(char *)(p+3)+strlen((char *)(p+3))+1 );
/* Check for correct type */
@@ -87,7 +87,7 @@
/* If we get here, we've found the entry */
- TRACE(resource, " Found!\n" );
+ TRACE(" Found!\n" );
ret = MAKELONG( p[1], p[2] );
break;
}
@@ -119,11 +119,11 @@
BYTE *p = pResTab + pTypeInfo->type_id;
if ((*p == len) && !lstrncmpiA( p+1, str, len ))
{
- TRACE(resource, " Found type '%s'\n", str );
+ TRACE(" Found type '%s'\n", str );
return pTypeInfo;
}
}
- TRACE(resource, " Skipping type %04x\n", pTypeInfo->type_id );
+ TRACE(" Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
@@ -134,10 +134,10 @@
{
if (pTypeInfo->type_id == id)
{
- TRACE(resource, " Found type %04x\n", id );
+ TRACE(" Found type %04x\n", id );
return pTypeInfo;
}
- TRACE(resource, " Skipping type %04x\n", pTypeInfo->type_id );
+ TRACE(" Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
@@ -195,7 +195,7 @@
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
- TRACE(resource, "loading, pos=%d, len=%d\n",
+ TRACE("loading, pos=%d, len=%d\n",
(int)pNameInfo->offset << sizeShift,
(int)pNameInfo->length << sizeShift );
if( hMemObj )
@@ -236,7 +236,7 @@
DefResourceHandlerProc = NULL;
}
- TRACE(resource,"InitResourceHandler[%04x]\n", hModule );
+ TRACE("InitResourceHandler[%04x]\n", hModule );
while(pTypeInfo->type_id)
{
@@ -260,7 +260,7 @@
if (!pModule || !pModule->res_table) return NULL;
- TRACE( resource, "module=%04x type=%s\n",
+ TRACE("module=%04x type=%s\n",
hModule, debugres_a(PTR_SEG_TO_LIN(typeId)) );
for (;;)
@@ -286,7 +286,7 @@
if (!pModule || !pModule->res_table) return 0;
- TRACE( resource, "module=%04x name=%s type=%s\n",
+ TRACE("module=%04x name=%s type=%s\n",
pModule->self, debugres_a(PTR_SEG_TO_LIN(name)),
debugres_a(PTR_SEG_TO_LIN(type)) );
@@ -296,7 +296,7 @@
if (ptr[0] == '#')
if (!(name = (LPCSTR)atoi( ptr + 1 )))
{
- WARN(resource, "Incorrect resource name: %s\n", ptr);
+ WARN("Incorrect resource name: %s\n", ptr);
return 0;
}
}
@@ -307,7 +307,7 @@
if (ptr[0] == '#')
if (!(type = (LPCSTR)atoi( ptr + 1 )))
{
- WARN(resource, "Incorrect resource type: %s\n", ptr);
+ WARN("Incorrect resource type: %s\n", ptr);
return 0;
}
}
@@ -331,14 +331,14 @@
break;
if ((pNameInfo = NE_FindResourceFromType( pResTab, pTypeInfo, name )))
{
- TRACE(resource, " Found id %08lx\n", (DWORD)name );
+ TRACE(" Found id %08lx\n", (DWORD)name );
return (HRSRC16)( (int)pNameInfo - (int)pModule );
}
- TRACE(resource, " Not found, going on\n" );
+ TRACE(" Not found, going on\n" );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
- WARN(resource, "failed!\n");
+ WARN("failed!\n");
return 0;
}
@@ -354,7 +354,7 @@
NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule || !pModule->res_table || !hRsrc) return 0;
- TRACE( resource, "module=%04x res=%04x size=%ld\n", hModule, hRsrc, size );
+ TRACE("module=%04x res=%04x size=%ld\n", hModule, hRsrc, size );
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
@@ -372,12 +372,12 @@
HGLOBAL16 WINAPI DirectResAlloc16( HINSTANCE16 hInstance, WORD wType,
UINT16 wSize )
{
- TRACE(resource,"(%04x,%04x,%04x)\n",
+ TRACE("(%04x,%04x,%04x)\n",
hInstance, wType, wSize );
if (!(hInstance = GetExePtr( hInstance ))) return 0;
if(wType != 0x10) /* 0x10 is the only observed value, passed from
CreateCursorIndirect. */
- TRACE(resource, "(wType=%x)\n", wType);
+ TRACE("(wType=%x)\n", wType);
return GLOBAL_Alloc(GMEM_MOVEABLE, wSize, hInstance, FALSE, FALSE, FALSE);
}
@@ -391,7 +391,7 @@
if (!pModule || !pModule->res_table || !hRsrc) return -1;
- TRACE(resource, "module=%04x res=%04x\n", pModule->self, hRsrc );
+ TRACE("module=%04x res=%04x\n", pModule->self, hRsrc );
if ((fd = _lopen16( NE_MODULE_NAME(pModule), OF_READ )) != HFILE_ERROR16)
{
@@ -413,7 +413,7 @@
if (!pModule || !pModule->res_table) return 0;
- TRACE(resource, "module=%04x res=%04x\n", pModule->self, hRsrc );
+ TRACE("module=%04x res=%04x\n", pModule->self, hRsrc );
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
@@ -430,7 +430,7 @@
NE_NAMEINFO *pNameInfo = NULL;
int d;
- TRACE( resource, "module=%04x res=%04x\n", pModule->self, hRsrc );
+ TRACE("module=%04x res=%04x\n", pModule->self, hRsrc );
if (!hRsrc || !pModule || !pModule->res_table) return 0;
/* First, verify hRsrc (just an offset from pModule to the needed pNameInfo) */
@@ -461,7 +461,7 @@
&& !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED))
{
pNameInfo->usage++;
- TRACE(resource, " Already loaded, new count=%d\n",
+ TRACE(" Already loaded, new count=%d\n",
pNameInfo->usage );
}
else
@@ -497,7 +497,7 @@
if (!handle || !pModule || !pModule->res_table) return handle;
- TRACE(resource, "handle=%04x\n", handle );
+ TRACE("handle=%04x\n", handle );
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
while (pTypeInfo->type_id)
diff --git a/loader/pe_resource.c b/loader/pe_resource.c
index b6c7754..e415b48 100644
--- a/loader/pe_resource.c
+++ b/loader/pe_resource.c
@@ -22,7 +22,7 @@
#include "libres.h"
#include "stackframe.h"
#include "neexe.h"
-#include "debug.h"
+#include "debugtools.h"
/**********************************************************************
* HMODULE32toPE_MODREF
diff --git a/loader/signal.c b/loader/signal.c
index 1fdb019..5e3e6f5 100644
--- a/loader/signal.c
+++ b/loader/signal.c
@@ -38,7 +38,7 @@
#include "miscemu.h"
#include "dosexe.h"
#include "thread.h"
-#include "debug.h"
+#include "debugtools.h"
void (*fnWINE_Debugger)(int,SIGCONTEXT*) = NULL;
void (*ctx_debug_call)(int sig,CONTEXT*ctx)=NULL;
@@ -268,22 +268,22 @@
#endif
if (IS_SELECTOR_SYSTEM(CS_sig(HANDLER_CONTEXT)))
{
- MSG("%s in 32-bit code (0x%08lx).\n", fault, EIP_sig(HANDLER_CONTEXT));
+ MESSAGE("%s in 32-bit code (0x%08lx).\n", fault, EIP_sig(HANDLER_CONTEXT));
}
else
{
- MSG("%s in 16-bit code (%04x:%04lx).\n", fault,
+ MESSAGE("%s in 16-bit code (%04x:%04lx).\n", fault,
(WORD)CS_sig(HANDLER_CONTEXT), EIP_sig(HANDLER_CONTEXT) );
}
#ifdef CR2_sig
- MSG("Fault address is 0x%08lx\n",CR2_sig(HANDLER_CONTEXT));
+ MESSAGE("Fault address is 0x%08lx\n",CR2_sig(HANDLER_CONTEXT));
#endif
#endif
if (fnWINE_Debugger)
fnWINE_Debugger( signal, HANDLER_CONTEXT );
else {
- MSG("stopping pid %d due to unhandled %s.\n",getpid(),fault);
+ MESSAGE("stopping pid %d due to unhandled %s.\n",getpid(),fault);
kill(getpid(),SIGSTOP);
}
}