source: trunk/src/kernel32/dbglocal.cpp

Last change on this file was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 3.6 KB
RevLine 
[10384]1/* $Id: dbglocal.cpp,v 1.29 2004-01-12 16:09:00 sandervl Exp $ */
[2802]2
3/*
4 * debug logging functions for OS/2
5 *
6 *
7 * Copyright 2000 Sander van Leeuwen
8 * Project Odin Software License can be found in LICENSE.TXT
9 */
10#include <os2wrap.h>
11#include <stdlib.h>
12#include <stdio.h>
13#include <string.h>
[8627]14#include <ctype.h>
[2802]15#include "dbglocal.h"
16
[2859]17#ifdef DEBUG
18
[6375]19USHORT DbgEnabledKERNEL32[DBG_MAXFILES] = {0};
20USHORT DbgEnabledLvl2KERNEL32[DBG_MAXFILES] = {0};
[3461]21
[21916]22static const char *DbgFileNames[DBG_MAXFILES] =
[2802]23{
24"kernel32",
25"kobjects",
26"console",
27"conin",
28"conbuffer",
29"conout",
30"network",
31"hmdevio",
32"profile",
33"thread",
34"virtual",
35"thunk",
36"obsolete",
37"comm",
38"message",
39"resource",
40"exceptions",
41"heapshared",
42"cpuhlp",
43"heapcode",
44"lfile",
45"npipe",
46"oslibdos",
47"oslibmisc",
48"misc",
49"exceptutil",
50"lang",
51"iccio",
52"map",
53"win32util",
54"heap",
55"heapstring",
56"os2heap",
57"vmutex",
58"initterm",
59"handlemanager",
60"environ",
61"initsystem",
62"hmdevice",
63"hmopen32",
64"hmobjects",
65"hmevent",
66"hmmutex",
67"hmcomm",
[7847]68"hmsemaphore",
[2802]69"wprocess",
70"conprop",
71"conprop2",
72"winimagelx",
73"winimagebase",
74"windllbase",
75"winexebase",
76"time",
77"mmap",
78"winimagepe2lx",
79"winimagepeldr",
80"windllpe2lx",
81"windlllx",
82"windllpeldr",
83"winexepe2lx",
84"winexelx",
85"winexepeldr",
86"winres",
87"critsection",
88"pefile",
89"winimgres",
90"wintls",
91"async",
92"fileio",
93"hmtoken",
94"kernelrsrc",
95"atom",
96"disk",
97"directory",
98"cvtbitmap",
99"hmmmap",
100"cvtaccel",
101"cvticon",
102"cvticongrp",
103"oslibexcept",
104"cpu",
105"process",
106"cvtcursor",
107"cvtcursorgrp",
108"stubs",
109"interlock",
110"toolhelp",
111"codepage",
112"debug",
[3059]113"oslibdebug",
114"registry",
[3128]115"queue",
116"hmthread",
[3206]117"hmprocess",
[3483]118"vsemaphore",
[3642]119"exceptstackdump",
[3819]120"hmfile",
[4256]121"hmnpipe",
[4372]122"hmdisk",
[5019]123"version",
[5587]124"hmstd",
125"module",
126"mailslot",
[7328]127"hmmailslot",
[7476]128"hmparport",
[7549]129"hmnul",
[7846]130"overlappedio",
[7847]131"trace",
132"event",
133"mutex",
134"semaphore",
[7848]135"nls",
136"memory",
137"system",
[7886]138"string",
[8397]139"char",
[8775]140"osliblvm",
141"oslibtime",
[8864]142"conodin32",
143"oslibmem",
[9945]144"mmapview",
145"mmapdup",
[10384]146"oslibthread",
[21302]147"mmapnotify",
148"_ras"
[2802]149};
150//******************************************************************************
151//******************************************************************************
[6375]152void ParseLogStatusKERNEL32()
[2802]153{
154 char *envvar = getenv(DBG_ENVNAME);
[3461]155 char *envvar2= getenv(DBG_ENVNAME_LVL2);
[2802]156 char *dbgvar;
157 int i;
158
159 for(i=0;i<DBG_MAXFILES;i++) {
[6375]160 DbgEnabledKERNEL32[i] = 1;
[2802]161 }
162
[3461]163 if(envvar) {
164 dbgvar = strstr(envvar, "dll");
165 if(dbgvar) {
166 if(*(dbgvar-1) == '-') {
167 for(i=0;i<DBG_MAXFILES;i++) {
[6375]168 DbgEnabledKERNEL32[i] = 0;
[3461]169 }
170 }
171 }
172 for(i=0;i<DBG_MAXFILES;i++) {
[8627]173 int len = strlen(DbgFileNames[i]);
[3461]174 dbgvar = strstr(envvar, DbgFileNames[i]);
[8627]175 if(dbgvar && !islower(dbgvar[len])) {
[3461]176 if(*(dbgvar-1) == '-') {
[6375]177 DbgEnabledKERNEL32[i] = 0;
[3461]178 }
179 else
180 if(*(dbgvar-1) == '+') {
[6375]181 DbgEnabledKERNEL32[i] = 1;
[3461]182 }
183 }
[2802]184 }
185 }
[3461]186 if(envvar2) {
187 dbgvar = strstr(envvar2, "dll");
188 if(dbgvar) {
189 if(*(dbgvar-1) == '+') {
190 for(i=0;i<DBG_MAXFILES;i++) {
[6375]191 DbgEnabledLvl2KERNEL32[i] = 1;
[3461]192 }
193 }
194 }
195 for(i=0;i<DBG_MAXFILES;i++) {
[8627]196 int len = strlen(DbgFileNames[i]);
[3461]197 dbgvar = strstr(envvar2, DbgFileNames[i]);
[8627]198 if(dbgvar && !islower(dbgvar[len])) {
[3461]199 if(*(dbgvar-1) == '-') {
[6375]200 DbgEnabledLvl2KERNEL32[i] = 0;
[3461]201 }
202 else
203 if(*(dbgvar-1) == '+') {
[6375]204 DbgEnabledLvl2KERNEL32[i] = 1;
[3461]205 }
206 }
[2802]207 }
208 }
209}
210//******************************************************************************
211//******************************************************************************
212
[2859]213#endif
Note: See TracBrowser for help on using the repository browser.