source: trunk/src/kernel32/dbglocal.cpp@ 9945

Last change on this file since 9945 was 9945, checked in by sandervl, 22 years ago

updates

File size: 3.6 KB
Line 
1/* $Id: dbglocal.cpp,v 1.28 2003-03-27 14:00:52 sandervl Exp $ */
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>
14#include <ctype.h>
15#include "dbglocal.h"
16
17#ifdef DEBUG
18
19USHORT DbgEnabledKERNEL32[DBG_MAXFILES] = {0};
20USHORT DbgEnabledLvl2KERNEL32[DBG_MAXFILES] = {0};
21
22static char *DbgFileNames[DBG_MAXFILES] =
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",
68"hmsemaphore",
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",
113"oslibdebug",
114"registry",
115"queue",
116"hmthread",
117"hmprocess",
118"vsemaphore",
119"exceptstackdump",
120"hmfile",
121"hmnpipe",
122"hmdisk",
123"version",
124"hmstd",
125"module",
126"mailslot",
127"hmmailslot",
128"hmparport",
129"hmnul",
130"overlappedio",
131"trace",
132"event",
133"mutex",
134"semaphore",
135"nls",
136"memory",
137"system",
138"string",
139"char",
140"osliblvm",
141"oslibtime",
142"conodin32",
143"oslibmem",
144"mmapview",
145"mmapdup",
146"oslibthread"
147};
148//******************************************************************************
149//******************************************************************************
150void ParseLogStatusKERNEL32()
151{
152 char *envvar = getenv(DBG_ENVNAME);
153 char *envvar2= getenv(DBG_ENVNAME_LVL2);
154 char *dbgvar;
155 int i;
156
157 for(i=0;i<DBG_MAXFILES;i++) {
158 DbgEnabledKERNEL32[i] = 1;
159 }
160
161 if(envvar) {
162 dbgvar = strstr(envvar, "dll");
163 if(dbgvar) {
164 if(*(dbgvar-1) == '-') {
165 for(i=0;i<DBG_MAXFILES;i++) {
166 DbgEnabledKERNEL32[i] = 0;
167 }
168 }
169 }
170 for(i=0;i<DBG_MAXFILES;i++) {
171 int len = strlen(DbgFileNames[i]);
172 dbgvar = strstr(envvar, DbgFileNames[i]);
173 if(dbgvar && !islower(dbgvar[len])) {
174 if(*(dbgvar-1) == '-') {
175 DbgEnabledKERNEL32[i] = 0;
176 }
177 else
178 if(*(dbgvar-1) == '+') {
179 DbgEnabledKERNEL32[i] = 1;
180 }
181 }
182 }
183 }
184 if(envvar2) {
185 dbgvar = strstr(envvar2, "dll");
186 if(dbgvar) {
187 if(*(dbgvar-1) == '+') {
188 for(i=0;i<DBG_MAXFILES;i++) {
189 DbgEnabledLvl2KERNEL32[i] = 1;
190 }
191 }
192 }
193 for(i=0;i<DBG_MAXFILES;i++) {
194 int len = strlen(DbgFileNames[i]);
195 dbgvar = strstr(envvar2, DbgFileNames[i]);
196 if(dbgvar && !islower(dbgvar[len])) {
197 if(*(dbgvar-1) == '-') {
198 DbgEnabledLvl2KERNEL32[i] = 0;
199 }
200 else
201 if(*(dbgvar-1) == '+') {
202 DbgEnabledLvl2KERNEL32[i] = 1;
203 }
204 }
205 }
206 }
207}
208//******************************************************************************
209//******************************************************************************
210
211#endif
Note: See TracBrowser for help on using the repository browser.