38#include "gdbsupport/job-control.h"
42#include "gdbsupport/version.h"
45#include "gdbsupport/event-loop.h"
53#include "gdbsupport/buffer.h"
54#include "gdbsupport/gdb_select.h"
55#include "gdbsupport/scope-exit.h"
57#include "gdbsupport/pathstuff.h"
62#include "readline/readline.h"
63#include "readline/history.h"
88#define PROMPT(X) the_prompts.prompt_stack[the_prompts.top + X].prompt
89#define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix
90#define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix
95#define DEFAULT_PROMPT "(gdb) "
139 gdb_printf (file, _(
"Whether to confirm potentially "
140 "dangerous operations is %s.\n"),
197#ifdef HAVE_USEFUL_SBRK
238char *(*deprecated_readline_hook) (
const char *);
251 const char *cmd,
int from_tty);
286 setbuf (stream,
nullptr);
291 setbuf (stream,
nullptr);
297ui::ui (FILE *instream_, FILE *outstream_, FILE *errstream_)
299 stdin_stream (instream_),
300 instream (instream_),
301 outstream (outstream_),
302 errstream (errstream_),
303 input_fd (fileno (instream)),
304 m_input_interactive_p (
ISATTY (instream)),
326 struct ui *
ui, *uiprev;
334 gdb_assert (
ui != NULL);
352 scoped_fd fd = gdb_open_cloexec (
name, O_RDWR |
O_NOCTTY, 0);
356 return fd.to_file (
"w+");
365 const char *interpreter_name;
366 const char *tty_name;
370 gdb_argv argv (args);
371 argc = argv.count ();
374 error (_(
"Usage: new-ui INTERPRETER TTY"));
376 interpreter_name = argv[0];
380 scoped_restore save_ui = make_scoped_restore (&
current_ui);
387 std::unique_ptr<ui>
ui
388 (
new struct ui (stream.get (), stream.get (), stream.get ()));
443 scoped_restore save_instream
444 = make_scoped_restore (&
ui->
instream, stream);
452 std::string command_buffer;
455 if (command ==
nullptr)
463do_chdir_cleanup (
void *old_dir)
465 chdir ((
const char *) old_dir);
489 static int warned = 0;
532 scoped_restore save_ui = make_scoped_restore (&
current_ui);
542 while (gdb_do_one_event () >= 0)
578 const char *cmd_start = p;
586 cleanup_if_error.release ();
592 while (*p ==
' ' || *p ==
'\t')
599 std::string default_args_and_arg;
610 scoped_restore save_repeat_args
612 const char *args_pointer = p;
620 arg = default_args_and_arg.c_str ();
625 arg = *p ==
'\0' ? nullptr : p;
638 std::string without_whitespace;
643 const char *old_end = arg + strlen (arg) - 1;
645 while (p >= arg && (*p ==
' ' || *p ==
'\t'))
649 without_whitespace = std::string (arg, p + 1);
650 arg = without_whitespace.c_str ();
671 std::string prefixname_no_space
674 (
"\"%s\" must be followed by the name of a subcommand.\n",
675 prefixname_no_space.c_str ());
684 error (_(
"That is not a command, just a help topic."));
696 const char *cmd2 = cmd_start;
716 cleanup_if_error.release ();
728 scoped_restore save_async = make_scoped_restore (&
current_ui->
async, 0);
733 scoped_restore save_stdout
735 scoped_restore save_stderr
737 scoped_restore save_stdlog
739 scoped_restore save_stdtarg
741 scoped_restore save_stdtargerr
763 res = std::move (str_file.
string ());
768 res = std::move (str_file.
string ());
775 const char *p,
int from_tty)
841 error (_(
"No previous command to relaunch"));
847scoped_restore_tmpl<int>
885 struct buffer line_buffer;
890 int fd = fileno (stream);
913 FD_SET (fd, &readfds);
978 gdb_printf (file, _(
"Saving of the history record on exit is %s.\n"),
981 gdb_printf (file, _(
"Saving of the history is disabled due to "
982 "the value of 'history filename'.\n"));
993 gdb_printf (file, _(
"The size of the command history is %s.\n"),
1006 _(
"The number of history entries to look back at for "
1007 "duplicates is %s.\n"),
1017 gdb_printf (file, _(
"The filename in which to record "
1018 "the command history is \"%ps\".\n"),
1021 gdb_printf (file, _(
"There is no filename currently set for "
1022 "recording the command history in.\n"));
1098 ? rl_already_prompted : 0),
1165 rl_already_prompted = 1;
1168 (*after_char_processing_hook) ();
1171 while (gdb_do_one_event () >= 0)
1191 rl_get_previous_history (delta, 0);
1198 rl_pre_input_hook = NULL;
1215 where = where_history();
1217 if ((history_is_stifled () && (history_length >= history_max_entries))
1218 || (where >= history_length - 1))
1223 return rl_newline (1, key);
1240 int lookbehind_threshold;
1253 for (lookbehind = 0; lookbehind < lookbehind_threshold; lookbehind++)
1255 HIST_ENTRY *temp = previous_history ();
1260 if (strcmp (temp->line, command) == 0)
1262 HIST_ENTRY *prev = remove_history (where_history ());
1264 free_history_entry (prev);
1271 add_history (command);
1280 int ret, saved_errno;
1282 std::string local_history_filename
1283 = string_printf (
"%s-gdb%ld~",
history_filename.c_str (), (
long) getpid ());
1286 saved_errno = errno;
1287 if (ret < 0 && saved_errno != ENOENT)
1289 warning (_(
"Could not rename %ps to %ps: %s"),
1293 local_history_filename.c_str ()),
1294 safe_strerror (saved_errno));
1308 gdb_assert (saved_errno == ENOENT);
1309 write_history (local_history_filename.c_str ());
1313 append_history (
command_count, local_history_filename.c_str ());
1314 if (history_is_stifled ())
1315 history_truncate_file (local_history_filename.c_str (),
1316 history_max_entries);
1320 saved_errno = errno;
1321 if (ret < 0 && saved_errno != EEXIST)
1322 warning (_(
"Could not rename %s to %s: %s"),
1324 safe_strerror (saved_errno));
1340 const char *annotation_suffix)
1343 const char *prompt = prompt_arg;
1348 if (annotation_suffix == NULL)
1349 annotation_suffix =
"";
1356 = (
char *) alloca ((prompt == NULL ? 0 : strlen (prompt))
1357 + strlen (annotation_suffix) + 40);
1359 local_prompt[0] =
'\0';
1361 strcpy (local_prompt, prompt);
1362 strcat (local_prompt,
"\n\032\032");
1363 strcat (local_prompt, annotation_suffix);
1364 strcat (local_prompt,
"\n");
1366 prompt = local_prompt;
1371 signal (SIGTSTP, handle_sigtstp);
1376 gdb::unique_xmalloc_ptr<char> rl;
1409 0, annotation_suffix);
1410 if (cmd == (
char *) EOF)
1426 signal (SIGTSTP, SIG_DFL);
1447 "Copyright (C) 2023 Free Software Foundation, Inc.\n");
1455License GPLv3+: GNU GPL version 3 or later <%ps>\
1456\nThis is free software: you are free to change and redistribute it.\n\
1457There is NO WARRANTY, to the extent permitted by law.",
1459 "http://gnu.org/licenses/gpl.html"));
1464 gdb_printf (stream, (
"\nType \"show copying\" and "
1465 "\"show warranty\" for details.\n"));
1469 gdb_printf (stream,
"This GDB was configured as \"");
1481 gdb_printf (stream, _(
"Type \"show configuration\" "
1482 "for configuration details.\n"));
1487 _(
"For bug reporting instructions, please see:\n"));
1493 _(
"Find the GDB manual and other documentation \
1494resources online at:\n <%ps>."),
1496 "http://www.gnu.org/software/gdb/documentation/"));
1498 gdb_printf (stream, _(
"For help, type \"help\".\n"));
1500 _(
"Type \"apropos word\" to search for commands \
1501related to \"word\"."));
1509This GDB was configured as follows:\n\
1510 configure --host=%s --target=%s\n\
1514 --with-auto-load-dir=%s\n\
1515 --with-auto-load-safe-path=%s\n\
1530 --with-gdb-datadir=%s%s\n\
1535 --with-iconv-bin=%s%s\n\
1536"), ICONV_BIN, ICONV_BIN_RELOCATABLE ?
" (relocatable)" :
"");
1541 --with-jit-reader-dir=%s%s\n\
1544#if HAVE_LIBUNWIND_IA64_H
1546 --with-libunwind-ia64\n\
1550 --without-libunwind-ia64\n\
1564#if HAVE_LIBBABELTRACE
1566 --with-babeltrace\n\
1570 --without-babeltrace\n\
1580 --without-intel-pt\n\
1602#ifdef WITH_PYTHON_PATH
1604 --with-python=%s%s\n\
1611#ifdef WITH_PYTHON_LIBDIR
1613 --with-python-libdir=%s%s\n\
1617 --without-python-libdir\n\
1621#if HAVE_LIBDEBUGINFOD
1623 --with-debuginfod\n\
1627 --without-debuginfod\n\
1641#if HAVE_SOURCE_HIGHLIGHT
1643 --enable-source-highlight\n\
1647 --disable-source-highlight\n\
1653 --enable-threading\n\
1657 --disable-threading\n\
1663 --with-relocated-sources=%s\n\
1669 --with-separate-debug-dir=%s%s\n\
1674 --with-sysroot=%s%s\n\
1679 --with-system-gdbinit=%s%s\n\
1684 --with-system-gdbinit-dir=%s%s\n\
1690(\"Relocatable\" means the directory can be moved with the GDB installation\n\
1691tree, and GDB will still find it.)\n\
1734 if (
inf->attach_flag)
1751 if (
inf->attach_flag)
1753 _(
"\tInferior %d [%s] will be detached.\n"),
inf->num,
1757 _(
"\tInferior %d [%s] will be killed.\n"),
inf->num,
1774 stb.
puts (_(
"A debugging session is active.\n\n"));
1779 stb.
puts (_(
"\nQuit anyway? "));
1815 exit_code = *exit_arg;
1832 catch (
const gdb_exception &ex)
1843 inf->pop_all_targets ();
1845 catch (
const gdb_exception &ex)
1873 catch (
const gdb_exception &ex)
1887 do_final_cleanups ();
1889 catch (
const gdb_exception &ex)
1908 gdb_printf (file,
"Debugger's interactive mode "
1909 "is %s (currently %s).\n",
1940#define Hist_print 10
1955 if (args[0] ==
'+' && args[1] ==
'\0')
1984 gdb_printf (
"%5d %s\n", history_base + offset,
1985 (history_get (history_base + offset))->line);
1995 if (from_tty && args)
2006 gdb_assert (history_size >= -1);
2008 if (history_size == -1)
2009 unstifle_history ();
2011 stifle_history (history_size);
2028 const char *cmdname =
"verbose";
2040 c->
doc = _(
"Set verbose printing of informational messages.");
2041 showcmd->
doc = _(
"Show verbose printing of informational messages.");
2045 c->
doc = _(
"Set verbosity.");
2046 showcmd->
doc = _(
"Show verbosity.");
2062 tmpenv = getenv (
"GDBHISTSIZE");
2069 tmpenv = skip_spaces (tmpenv);
2071 var = strtol (tmpenv, &endptr, 10);
2072 saved_errno = errno;
2073 endptr = skip_spaces (endptr);
2080 if (*endptr !=
'\0')
2082 else if (*tmpenv ==
'\0'
2089 || (
var ==
INT_MAX && saved_errno == ERANGE))
2128 gdb_printf (file, _(
"Editing of command lines as "
2129 "they are typed is %s.\n"),
2144 gdb_printf (file, _(
"Notification of completion for "
2145 "asynchronous execution commands is %s.\n"),
2177 gdb_printf (file, _(
"GDB's data directory is \"%ps\".\n"),
2214 gdb_printf (file, _(
"Whether to start up quietly is %s.\n"),
2238 rl_readline_name =
"gdb";
2239 rl_terminal_name = getenv (
"TERM");
2248 _(
"Set gdb's prompt."),
2249 _(
"Show gdb's prompt."),
2255Don't repeat this command.\nPrimarily \
2256used inside of user-defined commands that should not be repeated when\n\
2261Set editing of command lines as they are typed."), _(
"\
2262Show editing of command lines as they are typed."), _(
"\
2263Use \"on\" to enable the editing, and \"off\" to disable it.\n\
2264Without an argument, command line editing is enabled. To edit, use\n\
2265EMACS-like or VI-like commands like control-P or ESC."),
2271Set saving of the history record on exit."), _(
"\
2272Show saving of the history record on exit."), _(
"\
2273Use \"on\" to enable the saving, and \"off\" to disable it.\n\
2274Without an argument, saving is enabled."),
2281Set the size of the command history."), _(
"\
2282Show the size of the command history."), _(
"\
2283This is the number of previous commands to keep a record of.\n\
2284If set to \"unlimited\", the number of commands kept in the history\n\
2285list is unlimited. This defaults to the value of the environment\n\
2286variable \"GDBHISTSIZE\", or to 256 if this variable is not set."),
2293Set how far back in history to look for and remove duplicate entries."), _(
"\
2294Show how far back in history to look for and remove duplicate entries."), _(
"\
2295If set to a nonzero value N, GDB will look back at the last N history entries\n\
2296and remove the first history entry that is a duplicate of the most recent\n\
2297entry, each time a new history entry is added.\n\
2298If set to \"unlimited\", this lookbehind is unbounded.\n\
2299Only history entries added during this session are considered for removal.\n\
2300If set to 0, removal of duplicate history entries is disabled.\n\
2301By default this option is set to 0."),
2307Set the filename in which to record the command history."), _(
"\
2308Show the filename in which to record the command history."), _(
"\
2309(the list of previous commands of which a record is kept)."),
2315Set whether to confirm potentially dangerous operations."), _(
"\
2316Show whether to confirm potentially dangerous operations."), NULL,
2322Set annotation_level."), _(
"\
2323Show annotation_level."), _(
"\
23240 == normal; 1 == fullname (for use when running under emacs)\n\
23252 == output annotated suitably for use by programs that control GDB."),
2332Set notification of completion for asynchronous execution commands."), _(
"\
2333Show notification of completion for asynchronous execution commands."), _(
"\
2334Use \"on\" to enable the notification, and \"off\" to disable it."),
2341 _(
"Show GDB's data directory."),
2343When set, GDB uses the specified path to search for data files."),
2352Set whether GDB's standard input is a terminal."), _(
"\
2353Show whether GDB's standard input is a terminal."), _(
"\
2354If on, GDB assumes that standard input is a terminal. In practice, it\n\
2355means that GDB should wait for the user to answer queries associated to\n\
2356commands entered at the command prompt. If off, GDB assumes that standard\n\
2357input is not a terminal, and uses the default answer to all queries.\n\
2358If auto (the default), determine which mode to use based on the standard\n\
2366Set whether GDB should start up quietly."), _(
" \
2367Show whether GDB should start up quietly."), _(
"\
2368This setting will not affect the current session. Instead this command\n\
2369should be added to the .gdbearlyinit file in the users home directory to\n\
2370affect future GDB sessions."),
2377Usage: new-ui INTERPRETER TTY\n\
2378The first argument is the name of the interpreter to run.\n\
2379The second argument is the terminal the UI runs on."), &
cmdlist);
2384 int vmajor = 0, vminor = 0, vrevision = 0;
2385 sscanf (
version,
"%d.%d.%d", &vmajor, &vminor, &vrevision);
2403 make_final_cleanup (do_chdir_cleanup, xstrdup (current_directory));
2442 const char *tmpenv = getenv (
"GDBHISTFILE");
2443 if (tmpenv !=
nullptr)
2452 const char *fname =
"_gdb_history";
2454 const char *fname =
".gdb_history";
void initialize_current_architecture(void)
void bpstat_clear_actions(void)
ui_file_style style() const
int m_already_prompted_orig
DISABLE_COPY_AND_ASSIGN(gdb_readline_wrapper_cleanup)
~gdb_readline_wrapper_cleanup()
void(* m_handler_orig)(gdb::unique_xmalloc_ptr< char > &&)
int m_target_is_async_orig
gdb_readline_wrapper_cleanup()
scoped_restore_tmpl< struct ui * > m_save_ui
const char * c_str() const
const std::string & string()
virtual void puts(const char *str)
struct cmd_list_element * showlist
struct cmd_list_element * showhistlist
struct cmd_list_element * cmdlist
struct cmd_list_element * setlist
int is_complete_command(struct cmd_list_element *c)
struct cmd_list_element * sethistlist
void quit_command(const char *args, int from_tty)
set_show_commands add_setshow_filename_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * lookup_cmd(const char **line, struct cmd_list_element *list, const char *cmdtype, std::string *default_args, int allow_unknown, int ignore_help_classes)
set_show_commands add_setshow_zinteger_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
void deprecated_cmd_warning(const char *text, struct cmd_list_element *list)
set_show_commands add_setshow_optional_filename_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * lookup_cmd_1(const char **text, struct cmd_list_element *clist, struct cmd_list_element **result_list, std::string *default_args, int ignore_help_classes, bool lookup_for_completion_p)
set_show_commands add_setshow_string_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
set_show_commands add_setshow_zuinteger_unlimited_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void cmd_func(struct cmd_list_element *cmd, const char *args, int from_tty)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_auto_boolean_cmd(const char *name, enum command_class theclass, enum auto_boolean *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void cli_display_match_list(char **matches, int len, int max)
void execute_cmd_pre_hook(struct cmd_list_element *c)
void print_command_trace(const char *fmt,...)
void execute_cmd_post_hook(struct cmd_list_element *c)
void execute_user_command(struct cmd_list_element *c, const char *args)
void do_show_command(const char *arg, int from_tty, struct cmd_list_element *c)
void do_set_command(const char *arg, int from_tty, struct cmd_list_element *c)
cli_style_option file_name_style
cli_style_option version_style
#define CMD_LIST_AMBIGUOUS
char ** gdb_rl_attempted_completion_function(const char *text, int start, int end)
char * gdb_completion_word_break_characters()
const char * get_gdb_completer_quote_characters(void)
void set_rl_completer_word_break_characters(const char *break_chars)
#define JIT_READER_DIR_RELOCATABLE
#define PYTHON_LIBDIR_RELOCATABLE
#define SYSTEM_GDBINIT_RELOCATABLE
#define TARGET_SYSTEM_ROOT_RELOCATABLE
#define SYSTEM_GDBINIT_DIR_RELOCATABLE
#define WITH_PYTHON_LIBDIR
#define GDB_DATADIR_RELOCATABLE
#define TARGET_SYSTEM_ROOT
#define DEBUGDIR_RELOCATABLE
#define PYTHON_PATH_RELOCATABLE
#define AUTO_LOAD_SAFE_PATH
#define SYSTEM_GDBINIT_DIR
void initialize_inferiors(void)
void initialize_progspace(void)
LONGEST parse_and_eval_long(const char *exp)
void gdb_rl_deprep_term_function(void)
void display_gdb_prompt(const char *new_prompt)
void(* after_char_processing_hook)(void)
void command_handler(const char *command)
const char * handle_line_of_input(std::string &cmd_line_buffer, const char *rl, int repeat, const char *annotation_suffix)
void gdb_rl_callback_handler_remove(void)
int interruptible_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
void gdb_init_signals(void)
void gdb_disable_readline(void)
void change_line_handler(int editing)
void exception_print(struct ui_file *file, const struct gdb_exception &e)
frame_info_ptr deprecated_safe_get_selected_frame(void)
enum language get_frame_language(frame_info_ptr frame)
struct thread_info * inferior_thread(void)
void switch_to_thread(struct thread_info *thr)
struct thread_info * any_thread_of_inferior(inferior *inf)
int have_live_inferiors(void)
all_inferiors_range all_inferiors(process_stratum_target *proc_target=nullptr)
void initialize_stdin_serial(void)
void set_initial_gdb_ttystate(void)
void interp_pre_command_loop(struct interp *interp)
struct interp * top_level_interpreter(void)
void set_top_level_interpreter(const char *name)
void interpreter_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
const char lang_frame_mismatch_warn[]
const struct language_defn * current_language
enum language set_language(enum language lang)
const struct language_defn * expected_language
const char * default_word_break_characters(void)
void set_gdb_data_directory(const char *new_datadir)
int return_child_result_value
struct ui_file * gdb_stdtarg
struct ui_file * gdb_stdtargerr
observable gdb_datadir_changed
observable< int > gdb_exiting
unsigned int doc_allocated
gdb::optional< setting > var
std::string prefixname() const
struct cmd_list_element ** subcommands
counted_command_line user_commands
unsigned int deprecated_warn_user
bool is_command_class_help() const
__extension__ enum cmd_types type
unsigned int allow_unknown
enum command_class theclass
enum language la_language
struct ui_file * m_gdb_stdin
struct ui_file * m_gdb_stdlog
void(* input_handler)(gdb::unique_xmalloc_ptr< char > &&)
struct ui_file * m_gdb_stdout
enum prompt_state prompt_state
struct ui_file * m_gdb_stderr
bool input_interactive_p() const
ui(FILE *instream, FILE *outstream, FILE *errstream)
bool m_input_interactive_p
struct ui_out * m_current_uiout
int secondary_prompt_depth
void target_dcache_invalidate(void)
void target_log_command(const char *p)
void target_async(bool enable)
void target_detach(inferior *inf, int from_tty)
bool target_has_execution(inferior *inf)
std::string target_pid_to_str(ptid_t ptid)
static void show_write_history_p(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct ui_file ** current_ui_gdb_stdout_ptr()
static void show_startup_quiet(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void(* deprecated_readline_end_hook)(void)
static bool command_editing_p
void print_gdb_version(struct ui_file *stream, bool interactive)
void wait_sync_command_done(void)
static void show_history_remove_duplicates(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static int operate_saved_history
static void gdb_readline_wrapper_line(gdb::unique_xmalloc_ptr< char > &&line)
int(* deprecated_query_hook)(const char *, va_list)
static void kill_or_detach(inferior *inf, int from_tty)
char * gdb_readline_wrapper(const char *prompt)
static void show_exec_done_display_p(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
scoped_restore_tmpl< int > prevent_dont_repeat(void)
void quit_force(int *exit_arg, int from_tty)
void execute_command_to_string(std::string &res, const char *p, int from_tty, bool term_out)
static void unbuffer_stream(FILE *stream)
static void undo_terminal_modifications_before_exit(void)
static void set_gdb_datadir(const char *args, int from_tty, struct cmd_list_element *c)
static void dont_repeat_command(const char *ignored, int from_tty)
void(* deprecated_print_frame_info_listing_hook)(struct symtab *s, int line, int stopline, int noerror)
static void show_history_size(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void gdb_safe_append_history(void)
static gdb_file_up open_terminal_stream(const char *name)
void print_gdb_configuration(struct ui_file *stream)
static bool startup_quiet
static void print_inferior_quit_action(inferior *inf, ui_file *out)
char *(* deprecated_readline_hook)(const char *)
void(* deprecated_detach_hook)(void)
void show_commands(const char *args, int from_tty)
static int history_remove_duplicates
void set_prompt(const char *s)
struct ui_file ** current_ui_gdb_stdin_ptr()
static int gdb_readline_wrapper_done
void(* deprecated_attach_hook)(void)
void execute_fn_to_ui_file(struct ui_file *file, std::function< void(void)> fn)
static std::string staged_gdb_datadir
static void set_editing(const char *args, int from_tty, struct cmd_list_element *c)
const std::string & get_prompt()
void execute_fn_to_string(std::string &res, std::function< void(void)> fn, bool term_out)
int gdb_in_secondary_prompt_p(struct ui *ui)
void read_command_file(FILE *stream)
static void set_history_filename(const char *args, int from_tty, struct cmd_list_element *c)
void(* deprecated_warning_hook)(const char *, va_list)
void maybe_wait_sync_command_done(int was_sync)
static std::string history_filename
void save_command_line(const char *cmd)
void(* deprecated_call_command_hook)(struct cmd_list_element *c, const char *cmd, int from_tty)
struct ui_file ** current_ui_gdb_stderr_ptr()
void set_verbose(const char *args, int from_tty, struct cmd_list_element *c)
static const char * previous_repeat_arguments
static bool write_history_p
const char * repeat_previous()
static void show_annotation_level(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static char * previous_saved_command_line
void execute_command_to_ui_file(struct ui_file *file, const char *p, int from_tty)
static void show_prompt(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
const char * command_line_input(std::string &cmd_line_buffer, const char *prompt_arg, const char *annotation_suffix)
struct ui_file ** current_ui_gdb_stdlog_ptr()
static std::string top_prompt
static int gdb_rl_operate_and_get_next(int count, int key)
static void show_editing(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void set_history_size_command(const char *args, int from_tty, struct cmd_list_element *c)
static enum auto_boolean interactive_mode
static void(* saved_after_char_processing_hook)(void)
static void new_ui_command(const char *args, int from_tty)
static const char * repeat_arguments
void initialize_all_files(void)
void(* deprecated_context_hook)(int id)
static int suppress_dont_repeat
void gdb_add_history(const char *command)
char * get_saved_command_line()
static int highest_ui_num
static void gdb_rl_operate_and_get_next_completion(void)
int(* deprecated_ui_loop_hook)(int)
std::string source_file_name
scoped_value_mark prepare_execute_command()
static char * saved_command_line
static void show_gdb_datadir(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void execute_command(const char *p, int from_tty)
struct ui_out ** current_ui_current_uiout_ptr()
static void show_confirm(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void check_frame_language_change(void)
static void show_history_filename(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static char * gdb_readline_wrapper_result
static void init_main(void)
void set_repeat_arguments(const char *args)
static void set_readline_history_size(int history_size)
static void show_interactive_mode(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void(* deprecated_readline_begin_hook)(const char *,...)
static int history_size_setshow_var
static char * gdb_readline_no_editing(const char *prompt)
static ui_range all_uis()
void disconnect_tracing(void)
static styled_string_s * styled_string(const ui_file_style &style, const char *str, styled_string_s &&tmp={})
void perror_with_name(const char *string)
void init_page_info(void)
int query(const char *ctlstr,...)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_flush(struct ui_file *stream)
void printf_unfiltered(const char *format,...)
struct internalvar * create_internalvar(const char *name)
void set_internalvar_integer(struct internalvar *var, LONGEST l)