From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54461 invoked by alias); 9 Oct 2019 18:19:08 -0000 Mailing-List: contact gdb-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: gdb-cvs-owner@sourceware.org List-Subscribe: Sender: gdb-cvs-owner@sourceware.org Received: (qmail 54415 invoked by uid 10256); 9 Oct 2019 18:19:08 -0000 Date: Wed, 09 Oct 2019 18:19:00 -0000 Message-ID: <20191009181908.54414.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Christian Biesinger To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Mark guile_{extension_,}script_ops as static X-Act-Checkin: binutils-gdb X-Git-Author: Christian Biesinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 1d3787499d6edd07b30f3fc7b26962a1c695b8a4 X-Git-Newrev: 6a25e8a290eb5453d1464f68889c9c9a1084191a X-SW-Source: 2019-10/txt/msg00090.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6a25e8a290eb5453d1464f68889c9c9a1084191a commit 6a25e8a290eb5453d1464f68889c9c9a1084191a Author: Christian Biesinger Date: Mon Oct 7 17:38:51 2019 -0500 Mark guile_{extension_,}script_ops as static This makes it clearer that the structs are only used in this file. It required moving the definition of extension_language_guile further down in the file, because static structs can't be forward-declared. gdb/ChangeLog: 2019-10-09 Christian Biesinger * guile/guile.c (guile_extension_script_ops): Remove forward declaration and mark as static. (guile_script_ops): Likewise. (extension_language_guile): Move further down in the file so it can reference the definitions for guile_{extension_,}script_ops. Diff: --- gdb/ChangeLog | 8 ++++++++ gdb/guile/guile.c | 55 ++++++++++++++++++++++++++----------------------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 35614cc..2a39ab2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2019-10-09 Christian Biesinger + + * guile/guile.c (guile_extension_script_ops): Remove forward + declaration and mark as static. + (guile_script_ops): Likewise. + (extension_language_guile): Move further down in the file so + it can reference the definitions for guile_{extension_,}script_ops. + 2019-10-09 Andreas Arnez * s390-tdep.c (390_process_record): Handle new arch13 instructions diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c index defe554..55929f4 100644 --- a/gdb/guile/guile.c +++ b/gdb/guile/guile.c @@ -71,33 +71,6 @@ static const char *const guile_print_excp_enums[] = the default. */ const char *gdbscm_print_excp = gdbscm_print_excp_message; -#ifdef HAVE_GUILE -/* Forward decls, these are defined later. */ -extern const struct extension_language_script_ops guile_extension_script_ops; -extern const struct extension_language_ops guile_extension_ops; -#endif - -/* The main struct describing GDB's interface to the Guile - extension language. */ -extern const struct extension_language_defn extension_language_guile = -{ - EXT_LANG_GUILE, - "guile", - "Guile", - - ".scm", - "-gdb.scm", - - guile_control, - -#ifdef HAVE_GUILE - &guile_extension_script_ops, - &guile_extension_ops -#else - NULL, - NULL -#endif -}; #ifdef HAVE_GUILE @@ -126,7 +99,7 @@ static const char boot_scm_filename[] = "boot.scm"; /* The interface between gdb proper and loading of python scripts. */ -const struct extension_language_script_ops guile_extension_script_ops = +static const struct extension_language_script_ops guile_extension_script_ops = { gdbscm_source_script, gdbscm_source_objfile_script, @@ -136,7 +109,7 @@ const struct extension_language_script_ops guile_extension_script_ops = /* The interface between gdb proper and guile scripting. */ -const struct extension_language_ops guile_extension_ops = +static const struct extension_language_ops guile_extension_ops = { gdbscm_finish_initialization, gdbscm_initialized, @@ -159,7 +132,31 @@ const struct extension_language_ops guile_extension_ops = NULL, /* gdbscm_check_quit_flag, */ NULL, /* gdbscm_set_quit_flag, */ }; +#endif + +/* The main struct describing GDB's interface to the Guile + extension language. */ +extern const struct extension_language_defn extension_language_guile = +{ + EXT_LANG_GUILE, + "guile", + "Guile", + + ".scm", + "-gdb.scm", + guile_control, + +#ifdef HAVE_GUILE + &guile_extension_script_ops, + &guile_extension_ops +#else + NULL, + NULL +#endif +}; + +#ifdef HAVE_GUILE /* Implementation of the gdb "guile-repl" command. */ static void