gdb: initialise extension languages after processing early startup files
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 26 Aug 2020 16:31:12 +0000 (17:31 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 28 Apr 2021 08:56:20 +0000 (09:56 +0100)
Now (thanks to the last few commits) all extension languages are
fully initialised in their finish_initialization method, this commit
delays the call to this method until after the early initialization
files have been processed.

Right now there's no benefit from doing this, but in a later commit I
plan to add new options for Python that will control how Python is
initialized.

With this commit in place, my next commits will allow the user to add
options to their early initialization file and alter how Python starts
up.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* main.c (captured_main_1): Add a call to
finish_ext_lang_initialization.
* top.c (gdb_init): Remove call to finish_ext_lang_initialization.

gdb/ChangeLog
gdb/main.c
gdb/top.c

index 9c7dcd8eee78afc00d86f16f94d5f372314fa205..5cf843954b49207aff85f3882fd950a97667bb17 100644 (file)
@@ -1,3 +1,9 @@
+2021-04-28  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * main.c (captured_main_1): Add a call to
+       finish_ext_lang_initialization.
+       * top.c (gdb_init): Remove call to finish_ext_lang_initialization.
+
 2021-04-28  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * guile/guile.c (gdbscm_set_backtrace): Add declaration.
index 652e6f76fa0f5c10572386d1bb50d77a1f66387e..2a1c3a4866fdf0e30d7b92131d69109182732253 100644 (file)
@@ -1053,6 +1053,9 @@ captured_main_1 (struct captured_main_args *context)
   execute_cmdargs (&cmdarg_vec, CMDARG_EARLYINIT_FILE,
                   CMDARG_EARLYINIT_COMMAND, &ret);
 
+  /* Finish initializing the extension languges.  */
+  finish_ext_lang_initialization ();
+
   /* Recheck if we're starting up quietly after processing the startup
      scripts and commands.  */
   if (!quiet)
index b58cd4facfcc25f0de80e145ed28f1639f0015a9..a83d16bed1571e0355f7db647979c838a8c73fa0 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2408,12 +2408,6 @@ gdb_init ()
   set_language (language_c);
   expected_language = current_language;        /* Don't warn about the change.  */
 
-  /* Python initialization, for example, can require various commands to be
-     installed.  For example "info pretty-printer" needs the "info"
-     prefix to be installed.  Keep things simple and just do final
-     script initialization here.  */
-  finish_ext_lang_initialization ();
-
   /* Create $_gdb_major and $_gdb_minor convenience variables.  */
   init_gdb_version_vars ();
 }
This page took 0.03268 seconds and 4 git commands to generate.