diff options
author | Tom Tromey <tom@tromey.com> | 2022-06-19 14:59:32 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-08-19 08:23:20 -0600 |
commit | 37163dcf1a1b32115a49a51410e352366cc02fbc (patch) | |
tree | 1dc2314d4c10b1a77d90431786f45f01c7ab5a0a /gdb/top.c | |
parent | d7c83303890edf9b59a93fb0ed4942f80b734af7 (diff) | |
download | gdb-37163dcf1a1b32115a49a51410e352366cc02fbc.zip gdb-37163dcf1a1b32115a49a51410e352366cc02fbc.tar.gz 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.c | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -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 (); |