aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-06-19 14:59:32 -0600
committerTom Tromey <tom@tromey.com>2022-08-19 08:23:20 -0600
commit37163dcf1a1b32115a49a51410e352366cc02fbc (patch)
tree1dc2314d4c10b1a77d90431786f45f01c7ab5a0a /gdb/top.c
parentd7c83303890edf9b59a93fb0ed4942f80b734af7 (diff)
downloadfsf-binutils-gdb-37163dcf1a1b32115a49a51410e352366cc02fbc.zip
fsf-binutils-gdb-37163dcf1a1b32115a49a51410e352366cc02fbc.tar.gz
fsf-binutils-gdb-37163dcf1a1b32115a49a51410e352366cc02fbc.tar.bz2
Remove two initialization functions
I noticed a couple of initialization functions that aren't really needed, and that currently require explicit calls in gdb_init. This patch removes these functions, simplifying gdb a little. Regression tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 453fa23..07e4914 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2232,17 +2232,6 @@ show_startup_quiet (struct ui_file *file, int from_tty,
}
static void
-init_gdb_version_vars (void)
-{
- struct internalvar *major_version_var = create_internalvar ("_gdb_major");
- struct internalvar *minor_version_var = create_internalvar ("_gdb_minor");
- int vmajor = 0, vminor = 0, vrevision = 0;
- sscanf (version, "%d.%d.%d", &vmajor, &vminor, &vrevision);
- set_internalvar_integer (major_version_var, vmajor);
- set_internalvar_integer (minor_version_var, vminor + (vrevision > 0));
-}
-
-static void
init_main (void)
{
struct cmd_list_element *c;
@@ -2405,6 +2394,13 @@ Usage: new-ui INTERPRETER TTY\n\
The first argument is the name of the interpreter to run.\n\
The second argument is the terminal the UI runs on."), &cmdlist);
set_cmd_completer (c, interpreter_completer);
+
+ struct internalvar *major_version_var = create_internalvar ("_gdb_major");
+ struct internalvar *minor_version_var = create_internalvar ("_gdb_minor");
+ int vmajor = 0, vminor = 0, vrevision = 0;
+ sscanf (version, "%d.%d.%d", &vmajor, &vminor, &vrevision);
+ set_internalvar_integer (major_version_var, vmajor);
+ set_internalvar_integer (minor_version_var, vminor + (vrevision > 0));
}
/* See top.h. */
@@ -2423,8 +2419,6 @@ gdb_init ()
make_final_cleanup (do_chdir_cleanup, xstrdup (current_directory));
#endif
- init_cmd_lists (); /* This needs to be done first. */
-
init_page_info ();
/* Here is where we call all the _initialize_foo routines. */
@@ -2454,9 +2448,6 @@ gdb_init ()
during startup. */
set_language (language_c);
expected_language = current_language; /* Don't warn about the change. */
-
- /* Create $_gdb_major and $_gdb_minor convenience variables. */
- init_gdb_version_vars ();
}
void _initialize_top ();