static void gdbtk_command_loop (void) { extern FILE *instream; /* We no longer want to use stdin as the command input stream */ instream = NULL; if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_preloop") != TCL_OK) { const char *msg; /* Force errorInfo to be set up propertly. */ Tcl_AddErrorInfo (gdbtk_interp, ""); msg = Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY); #ifdef _WIN32 MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL); #else fputs_unfiltered (msg, gdb_stderr); #endif } #ifdef _WIN32 close_bfds (); #endif Tk_MainLoop (); }
void gdbtk_interp::pre_command_loop () { /* We no longer want to use stdin as the command input stream: disable events from stdin. */ main_ui->input_fd = -1; if (Tcl_Eval (gdbtk_tcl_interp, "gdbtk_tcl_preloop") != TCL_OK) { const char *msg; /* Force errorInfo to be set up propertly. */ Tcl_AddErrorInfo (gdbtk_tcl_interp, ""); msg = Tcl_GetVar (gdbtk_tcl_interp, "errorInfo", TCL_GLOBAL_ONLY); #ifdef _WIN32 MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL); #else fputs_unfiltered (msg, gdb_stderr); #endif } #ifdef _WIN32 close_bfds (); #endif }