Changeset 12768
- Timestamp:
- Sep 6, 2009, 10:43:06 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/lisp-kernel/lisp-debug.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/lisp-debug.c
r12713 r12768 111 111 stdIn = GetStdHandle(STD_INPUT_HANDLE); 112 112 return (stdIn == NULL); 113 } 114 #endif 115 116 117 #ifdef WINDOWS 118 Boolean first_debugger_call = TRUE; 119 120 void 121 setup_debugger_streams() 122 { 123 HANDLE h; 124 int fd; 125 FILE *f; 126 127 if (first_debugger_call) { 128 first_debugger_call = FALSE; 129 if (stdin_is_dev_null()) 130 AllocConsole(); 131 // Reassociate C's stdin with Windows' stdin 132 h = GetStdHandle(STD_INPUT_HANDLE); 133 fd = _open_osfhandle((intptr_t)h, _O_TEXT); 134 if (fd >= 0) { 135 f = _fdopen(fd, "r"); 136 *stdin = *f; 137 } 138 // Reassociate C's stdout with Windows' stdout 139 h = GetStdHandle(STD_OUTPUT_HANDLE); 140 fd = _open_osfhandle((intptr_t)h, _O_TEXT); 141 if (fd >= 0) { 142 f = _fdopen(fd, "w"); 143 *stdout = *f; 144 } 145 // Reassociate C's stderr with Windows' stderr 146 h = GetStdHandle(STD_ERROR_HANDLE); 147 fd = _open_osfhandle((intptr_t)h, _O_TEXT); 148 if (fd >= 0) { 149 f = _fdopen(fd, "w"); 150 *stderr = *f; 151 } 152 dbgout = stderr; 153 } 154 return; 113 155 } 114 156 #endif … … 708 750 { 709 751 752 #ifdef WINDOWS 753 setup_debugger_streams(); 754 #endif 755 710 756 #ifdef PPC 711 757 #ifdef PPC64 … … 1122 1168 #endif 1123 1169 1124 #ifdef WINDOWS1125 Boolean first_debugger_call = TRUE;1126 #endif1127 1128 1170 1129 1171 OSStatus … … 1139 1181 1140 1182 #ifdef WINDOWS 1141 HANDLE h; 1142 int fd; 1143 FILE *f; 1144 1145 if (first_debugger_call) { 1146 first_debugger_call = FALSE; 1147 if (stdin_is_dev_null()) 1148 AllocConsole(); 1149 // Reassociate C's stdin with Windows' stdin 1150 h = GetStdHandle(STD_INPUT_HANDLE); 1151 fd = _open_osfhandle((intptr_t)h, _O_TEXT); 1152 if (fd >= 0) { 1153 f = _fdopen(fd, "r"); 1154 *stdin = *f; 1155 } 1156 // Reassociate C's stdout with Windows' stdout 1157 h = GetStdHandle(STD_OUTPUT_HANDLE); 1158 fd = _open_osfhandle((intptr_t)h, _O_TEXT); 1159 if (fd >= 0) { 1160 f = _fdopen(fd, "w"); 1161 *stdout = *f; 1162 } 1163 // Reassociate C's stderr with Windows' stderr 1164 h = GetStdHandle(STD_ERROR_HANDLE); 1165 fd = _open_osfhandle((intptr_t)h, _O_TEXT); 1166 if (fd >= 0) { 1167 f = _fdopen(fd, "w"); 1168 *stderr = *f; 1169 } 1170 dbgout = stderr; 1171 } 1183 setup_debugger_streams(); 1172 1184 #endif 1173 1185 … … 1225 1237 fprintf(dbgout, "[%d] Clozure CL kernel debugger: ", main_thread_pid); 1226 1238 #endif 1239 fflush(dbgout); 1227 1240 state = apply_debug_command(xp, readc(), info, why); 1228 1241 }
Note:
See TracChangeset
for help on using the changeset viewer.
