Changeset 12828
- Timestamp:
- Sep 12, 2009, 12:35:33 PM (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
r12768 r12828 53 53 if (f) { 54 54 if (setvbuf(f, NULL, _IONBF, 0) == 0) { 55 #ifdef WINDOWS 56 if (fileno(stdin) < 0) { 57 fileno(stdin) = 0; 58 } 59 #endif 55 60 dbgout = f; 56 61 return true; … … 115 120 116 121 117 #ifdef WINDOWS118 Boolean first_debugger_call = TRUE;119 120 void121 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' stdin132 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' stdout139 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' stderr146 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;155 }156 #endif157 122 158 123 … … 750 715 { 751 716 752 #ifdef WINDOWS753 setup_debugger_streams();754 #endif755 717 756 718 #ifdef PPC … … 1180 1142 debug_command_return state = debug_continue; 1181 1143 1182 #ifdef WINDOWS1183 setup_debugger_streams();1184 #endif1185 1144 1186 1145 if (stdin_is_dev_null()) { … … 1237 1196 fprintf(dbgout, "[%d] Clozure CL kernel debugger: ", main_thread_pid); 1238 1197 #endif 1239 fflush(dbgout); 1198 fflush(dbgout); /* dbgout should be unbuffered, so this shouldn't be necessary. But it can't hurt ... */ 1240 1199 state = apply_debug_command(xp, readc(), info, why); 1241 1200 }
Note:
See TracChangeset
for help on using the changeset viewer.
