public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/7] gdb: initialise extension languages after processing early startup files
Date: Thu, 22 Apr 2021 22:02:46 +0100	[thread overview]
Message-ID: <d1305d741e5a73c6ef9783a6d5c39230c1b676e3.1619125261.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1619125261.git.andrew.burgess@embecosm.com>

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 | 6 ++++++
 gdb/main.c    | 3 +++
 gdb/top.c     | 6 ------
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/gdb/main.c b/gdb/main.c
index 652e6f76fa0..2a1c3a4866f 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -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)
diff --git a/gdb/top.c b/gdb/top.c
index b58cd4facfc..a83d16bed15 100644
--- 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 ();
 }
-- 
2.25.4


  parent reply	other threads:[~2021-04-23  8:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 21:02 [PATCH 0/7] New options to control how Python is initialized Andrew Burgess
2021-04-22 21:02 ` [PATCH 1/7] gdb: remove unused argument from gdb_init Andrew Burgess
2021-04-23 14:15   ` Tom Tromey
2021-04-22 21:02 ` [PATCH 2/7] gdb: ensure SIGINT is set to SIG_DFL during initialisation Andrew Burgess
2021-04-23 14:16   ` Tom Tromey
2021-04-22 21:02 ` [PATCH 3/7] gdb: delay python initialisation until gdbpy_finish_initialization Andrew Burgess
2021-04-23 14:26   ` Tom Tromey
2021-04-22 21:02 ` [PATCH 4/7] gdb delay guile initialization until gdbscm_finish_initialization Andrew Burgess
2021-04-23 14:29   ` Tom Tromey
2021-04-22 21:02 ` Andrew Burgess [this message]
2021-04-23 14:30   ` [PATCH 5/7] gdb: initialise extension languages after processing early startup files Tom Tromey
2021-04-22 21:02 ` [PATCH 6/7] gdb: extension languages finish_initialization to initialize Andrew Burgess
2021-04-23 14:31   ` Tom Tromey
2021-04-22 21:02 ` [PATCH 7/7] gdb: startup commands to control Python extension language Andrew Burgess
2021-04-23 10:31   ` Eli Zaretskii
2021-04-23 14:32   ` Tom Tromey
2021-04-29  8:32   ` Tom de Vries
2021-04-29  9:35     ` Andrew Burgess
2021-04-29  9:46     ` Andrew Burgess
2021-04-29 10:08       ` Tom de Vries
2021-05-02 10:31         ` Andrew Burgess
2021-05-02 18:15           ` Tom de Vries
2021-04-29 12:17       ` Eli Zaretskii
2021-04-29 12:32         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d1305d741e5a73c6ef9783a6d5c39230c1b676e3.1619125261.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).