static int tui_resume (void *data) { struct ui_file *stream; /* gdb_setup_readline will change gdb_stdout. If the TUI was previously writing to gdb_stdout, then set it to the new gdb_stdout afterwards. */ stream = cli_out_set_stream (tui_old_uiout, gdb_stdout); if (stream != gdb_stdout) { cli_out_set_stream (tui_old_uiout, stream); stream = NULL; } gdb_setup_readline (); if (stream != NULL) cli_out_set_stream (tui_old_uiout, gdb_stdout); if (tui_start_enabled) tui_enable (); return 1; }
static int cli_interpreter_resume (void *data) { struct ui_file *stream; /*sync_execution = 1; */ /* gdb_setup_readline will change gdb_stdout. If the CLI was previously writing to gdb_stdout, then set it to the new gdb_stdout afterwards. */ stream = cli_out_set_stream (cli_uiout, gdb_stdout); if (stream != gdb_stdout) { cli_out_set_stream (cli_uiout, stream); stream = NULL; } gdb_setup_readline (); if (stream != NULL) cli_out_set_stream (cli_uiout, gdb_stdout); return 1; }
/* This is the only new function needed for the console-quoted interpreter. * This outputs console text in an mi-quoted form, so an mi-parser will * NOT be fooled by spurious * at beginning of line goofs... */ int cli_quoted_interpreter_resume(void *data) { static struct ui_file *quoted_stdout = NULL; static struct ui_file *quoted_stderr = NULL; static struct ui_file *quoted_stdtarg = NULL; sync_execution = 1; print_frame_more_info_hook = 0; gdb_setup_readline (); if (quoted_stdout == NULL) { struct ui_file *raw_stdout; raw_stdout = stdio_fileopen (stdout); quoted_stdout = mi_console_file_new (raw_stdout, "~", '"'); quoted_stderr = mi_console_file_new (raw_stdout, "&", '"'); quoted_stdtarg = mi_console_file_new (raw_stdout, "@", '"'); } gdb_stdout = quoted_stdout; gdb_stderr = quoted_stderr; gdb_stdlog = gdb_stderr; gdb_stdtarg = quoted_stdtarg; return 1; }
static int cli_interpreter_resume (void *data) { struct ui_file *stream; /* APPLE LOCAL: This is commented out in the FSF code. Maybe it doesn't work with the async remote or something? We need it. */ sync_execution = 1; print_frame_more_info_hook = 0; /* gdb_setup_readline will change gdb_stdout. If the CLI was previously writing to gdb_stdout, then set it to the new gdb_stdout afterwards. */ stream = cli_out_set_stream (cli_uiout, gdb_stdout); if (stream != gdb_stdout) { cli_out_set_stream (cli_uiout, stream); stream = NULL; } gdb_setup_readline (); if (stream != NULL) cli_out_set_stream (cli_uiout, gdb_stdout); return 1; }
static int mi_interpreter_resume (void *data) { struct mi_interp *mi = data; /* As per hack note in mi_interpreter_init, swap in the output channels... */ gdb_setup_readline (); /* These overwrite some of the initialization done in _intialize_event_loop. */ call_readline = gdb_readline2; input_handler = mi_execute_command_wrapper; add_file_handler (input_fd, stdin_event_handler, 0); async_command_editing_p = 0; /* FIXME: This is a total hack for now. PB's use of the MI implicitly relies on a bug in the async support which allows asynchronous commands to leak through the commmand loop. The bug involves (but is not limited to) the fact that sync_execution was erroneously initialized to 0. Duplicate by initializing it thus here... */ sync_execution = 0; gdb_stdout = mi->out; /* Route error and log output through the MI */ gdb_stderr = mi->err; gdb_stdlog = mi->log; /* Route target output through the MI. */ gdb_stdtarg = mi->targ; /* Route target error through the MI as well. */ gdb_stdtargerr = mi->targ; /* Replace all the hooks that we know about. There really needs to be a better way of doing this... */ clear_interpreter_hooks (); deprecated_show_load_progress = mi_load_progress; /* If we're _the_ interpreter, take control. */ if (current_interp_named_p (INTERP_MI1)) deprecated_command_loop_hook = mi1_command_loop; else if (current_interp_named_p (INTERP_MI2)) deprecated_command_loop_hook = mi2_command_loop; else if (current_interp_named_p (INTERP_MI3)) deprecated_command_loop_hook = mi3_command_loop; else deprecated_command_loop_hook = mi2_command_loop; return 1; }