|
Last change
on this file since 4166 was 3819, checked in by sandervl, 25 years ago |
|
PD: added handlemanager support for named & unnamed pipes
|
|
File size:
3.1 KB
|
| Line | |
|---|
| 1 | /* $Id: dbglocal.cpp,v 1.9 2000-07-12 18:21:41 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 "dbglocal.h"
|
|---|
| 15 |
|
|---|
| 16 | #ifdef DEBUG
|
|---|
| 17 |
|
|---|
| 18 | USHORT DbgEnabled[DBG_MAXFILES] = {0};
|
|---|
| 19 | USHORT DbgEnabledLvl2[DBG_MAXFILES] = {0};
|
|---|
| 20 |
|
|---|
| 21 | char *DbgFileNames[DBG_MAXFILES] =
|
|---|
| 22 | {
|
|---|
| 23 | "kernel32",
|
|---|
| 24 | "kobjects",
|
|---|
| 25 | "console",
|
|---|
| 26 | "conin",
|
|---|
| 27 | "conbuffer",
|
|---|
| 28 | "conout",
|
|---|
| 29 | "unicode",
|
|---|
| 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 | "semaphore",
|
|---|
| 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 | "winfakepeldr",
|
|---|
| 101 | "cvtaccel",
|
|---|
| 102 | "cvticon",
|
|---|
| 103 | "cvticongrp",
|
|---|
| 104 | "oslibexcept",
|
|---|
| 105 | "cpu",
|
|---|
| 106 | "process",
|
|---|
| 107 | "cvtcursor",
|
|---|
| 108 | "cvtcursorgrp",
|
|---|
| 109 | "stubs",
|
|---|
| 110 | "interlock",
|
|---|
| 111 | "toolhelp",
|
|---|
| 112 | "codepage",
|
|---|
| 113 | "debug",
|
|---|
| 114 | "oslibdebug",
|
|---|
| 115 | "registry",
|
|---|
| 116 | "queue",
|
|---|
| 117 | "hmthread",
|
|---|
| 118 | "hmprocess",
|
|---|
| 119 | "vsemaphore",
|
|---|
| 120 | "exceptstackdump",
|
|---|
| 121 | "hmfile",
|
|---|
| 122 | "hmnpipe"
|
|---|
| 123 | };
|
|---|
| 124 | //******************************************************************************
|
|---|
| 125 | //******************************************************************************
|
|---|
| 126 | void ParseLogStatus()
|
|---|
| 127 | {
|
|---|
| 128 | char *envvar = getenv(DBG_ENVNAME);
|
|---|
| 129 | char *envvar2= getenv(DBG_ENVNAME_LVL2);
|
|---|
| 130 | char *dbgvar;
|
|---|
| 131 | int i;
|
|---|
| 132 |
|
|---|
| 133 | for(i=0;i<DBG_MAXFILES;i++) {
|
|---|
| 134 | DbgEnabled[i] = 1;
|
|---|
| 135 | }
|
|---|
| 136 |
|
|---|
| 137 | if(envvar) {
|
|---|
| 138 | dbgvar = strstr(envvar, "dll");
|
|---|
| 139 | if(dbgvar) {
|
|---|
| 140 | if(*(dbgvar-1) == '-') {
|
|---|
| 141 | for(i=0;i<DBG_MAXFILES;i++) {
|
|---|
| 142 | DbgEnabled[i] = 0;
|
|---|
| 143 | }
|
|---|
| 144 | }
|
|---|
| 145 | }
|
|---|
| 146 | for(i=0;i<DBG_MAXFILES;i++) {
|
|---|
| 147 | dbgvar = strstr(envvar, DbgFileNames[i]);
|
|---|
| 148 | if(dbgvar) {
|
|---|
| 149 | if(*(dbgvar-1) == '-') {
|
|---|
| 150 | DbgEnabled[i] = 0;
|
|---|
| 151 | }
|
|---|
| 152 | else
|
|---|
| 153 | if(*(dbgvar-1) == '+') {
|
|---|
| 154 | DbgEnabled[i] = 1;
|
|---|
| 155 | }
|
|---|
| 156 | }
|
|---|
| 157 | }
|
|---|
| 158 | }
|
|---|
| 159 | if(envvar2) {
|
|---|
| 160 | dbgvar = strstr(envvar2, "dll");
|
|---|
| 161 | if(dbgvar) {
|
|---|
| 162 | if(*(dbgvar-1) == '+') {
|
|---|
| 163 | for(i=0;i<DBG_MAXFILES;i++) {
|
|---|
| 164 | DbgEnabledLvl2[i] = 1;
|
|---|
| 165 | }
|
|---|
| 166 | }
|
|---|
| 167 | }
|
|---|
| 168 | for(i=0;i<DBG_MAXFILES;i++) {
|
|---|
| 169 | dbgvar = strstr(envvar2, DbgFileNames[i]);
|
|---|
| 170 | if(dbgvar) {
|
|---|
| 171 | if(*(dbgvar-1) == '-') {
|
|---|
| 172 | DbgEnabledLvl2[i] = 0;
|
|---|
| 173 | }
|
|---|
| 174 | else
|
|---|
| 175 | if(*(dbgvar-1) == '+') {
|
|---|
| 176 | DbgEnabledLvl2[i] = 1;
|
|---|
| 177 | }
|
|---|
| 178 | }
|
|---|
| 179 | }
|
|---|
| 180 | }
|
|---|
| 181 | }
|
|---|
| 182 | //******************************************************************************
|
|---|
| 183 | //******************************************************************************
|
|---|
| 184 |
|
|---|
| 185 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.