+2019-07-11 Tom Tromey <tromey@adacore.com>
+
+ * main.c (get_init_files): Use GDBINIT, not gdbinit.
+ * auto-load.c (file_is_auto_load_safe): Use GDBINIT, not gdbinit.
+ * top.h (gdbinit): Don't declare.
+ * cli/cli-cmds.c (init_cli_cmds): Remove, merging contents
+ into...
+ (_initialize_cli_cmds): ...here. Use GDBINIT, not gdbinit.
+ * top.c (gdb_init): Don't call init_cli_cmds.
+ (gdbinit): Remove.
+ * cli/cli-cmds.h (init_cli_cmds): Don't declare.
+
2019-07-11 Tom Tromey <tromey@adacore.com>
* python/py-inferior.c (add_thread_object): Don't use thread_obj
if (homedir == NULL)
homedir = "$HOME";
- std::string homeinit = string_printf ("%s/%s", homedir, gdbinit);
+ std::string homeinit = string_printf ("%s/%s", homedir, GDBINIT);
printf_filtered (_("\
To enable execution of this file add\n\
alias spe = set print elements\n\
Make \"elms\" an alias of \"elements\" in the \"set print\" command:\n\
alias -a set print elms = set print elements"));
-}
-
-void
-init_cli_cmds (void)
-{
- struct cmd_list_element *c;
- char *source_help_text;
- source_help_text = xstrprintf (_("\
+ const char *source_help_text = xstrprintf (_("\
Read commands from a file named FILE.\n\
\n\
Usage: source [-s] [-v] FILE\n\
-v: each command in FILE is echoed as it is executed.\n\
\n\
Note that the file \"%s\" is read automatically in this way\n\
-when GDB is started."), gdbinit);
+when GDB is started."), GDBINIT);
c = add_cmd ("source", class_support, source_command,
source_help_text, &cmdlist);
set_cmd_completer (c, filename_completer);
void init_cmd_lists (void);
-void init_cli_cmds (void);
-
int is_complete_command (struct cmd_list_element *cmd);
/* Exported to gdb/main.c */
if (homedir)
{
- homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
+ homeinit = xstrprintf ("%s/%s", homedir, GDBINIT);
if (stat (homeinit, &homebuf) != 0)
{
xfree (homeinit);
}
}
- if (stat (gdbinit, &cwdbuf) == 0)
+ if (stat (GDBINIT, &cwdbuf) == 0)
{
if (!homeinit
|| memcmp ((char *) &homebuf, (char *) &cwdbuf,
sizeof (struct stat)))
- localinit = gdbinit;
+ localinit = GDBINIT;
}
initialized = 1;
gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdlog)
gen_ret_current_ui_field_ptr (struct ui_out *, current_uiout)
-/* Initialization file name for gdb. This is host-dependent. */
-
-const char gdbinit[] = GDBINIT;
-
int inhibit_gdbinit = 0;
extern char lang_frame_mismatch_warn[]; /* language.c */
initialize_progspace ();
initialize_inferiors ();
initialize_current_architecture ();
- init_cli_cmds();
init_main (); /* But that omits this file! Do it now. */
initialize_stdin_serial ();
/* From top.c. */
extern int confirm;
extern int inhibit_gdbinit;
-extern const char gdbinit[];
/* Print the GDB version banner to STREAM. If INTERACTIVE is false,
then information referring to commands (e.g., "show configuration")