gdb: bool-ify ext_lang_auto_load_enabled and friends
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 13 Jan 2021 16:57:24 +0000 (11:57 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 13 Jan 2021 16:57:24 +0000 (11:57 -0500)
Make it and related functions return bool.  Move function comments to
header where applicable.

gdb/ChangeLog:

* auto-load.h (auto_load_gdb_scripts_enabled): Return bool, move
comment here.
* auto-load.c (auto_load_gdb_scripts_enabled): Return bool, move
comment to header.
* extension-priv.h (struct extension_language_script_ops)
<auto_load_enabled>: Return bool.
* extension.h (ext_lang_auto_load_enabled): Return bool, move
comment here.
* extension.c (ext_lang_auto_load_enabled): Return bool, move
comment to header.
* guile/guile-header.h (gdbscm_auto_load_enabled): Return bool,
move comment here.
* guile/scm-auto-load.c (gdbscm_auto_load_enabled): Return bool,
move comment to header.
* python/python-header.h (gdbpy_auto_load_enabled): Return bool,
move comment here.
* python/py-auto-load.c (gdbpy_auto_load_enabled): Return bool,
move comment to header.

Change-Id: I657a17d2dab77a36884a137ce9b23a2cc6d53140

gdb/ChangeLog
gdb/auto-load.c
gdb/auto-load.h
gdb/extension-priv.h
gdb/extension.c
gdb/extension.h
gdb/guile/guile-internal.h
gdb/guile/scm-auto-load.c
gdb/python/py-auto-load.c
gdb/python/python-internal.h

index d0b78c708d789fe299015a925fa17638c078fe02..e9f7982cf00a6a4abeca8b55e43f13efd6fc9b77 100644 (file)
@@ -1,3 +1,24 @@
+2021-01-13  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * auto-load.h (auto_load_gdb_scripts_enabled): Return bool, move
+       comment here.
+       * auto-load.c (auto_load_gdb_scripts_enabled): Return bool, move
+       comment to header.
+       * extension-priv.h (struct extension_language_script_ops)
+       <auto_load_enabled>: Return bool.
+       * extension.h (ext_lang_auto_load_enabled): Return bool, move
+       comment here.
+       * extension.c (ext_lang_auto_load_enabled): Return bool, move
+       comment to header.
+       * guile/guile-header.h (gdbscm_auto_load_enabled): Return bool,
+       move comment here.
+       * guile/scm-auto-load.c (gdbscm_auto_load_enabled): Return bool,
+       move comment to header.
+       * python/python-header.h (gdbpy_auto_load_enabled): Return bool,
+       move comment here.
+       * python/py-auto-load.c (gdbpy_auto_load_enabled): Return bool,
+       move comment to header.
+
 2021-01-13  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * auto-load.h (file_is_auto_load_safe): Change return type to
index 7b4cd73ea574b26d2d5dab455d4472214d0fc749..0d5532b4882e4789de39a92a2cb8f990b24e6550 100644 (file)
@@ -93,9 +93,9 @@ show_auto_load_gdb_scripts (struct ui_file *file, int from_tty,
                    value);
 }
 
-/* Return non-zero if auto-loading gdb scripts is enabled.  */
+/* See auto-load.h.  */
 
-int
+bool
 auto_load_gdb_scripts_enabled (const struct extension_language_defn *extlang)
 {
   return auto_load_gdb_scripts;
index c644b4694accc5d3d432aba6a12d6fd48a930f21..ec802395d3ed0ee84ea2c411878f924b9fb908c9 100644 (file)
@@ -56,7 +56,9 @@ extern bool file_is_auto_load_safe (const char *filename,
                                    const char *debug_fmt, ...)
   ATTRIBUTE_PRINTF (2, 3);
 
-extern int auto_load_gdb_scripts_enabled
+/* Return true if auto-loading gdb scripts is enabled.  */
+
+extern bool auto_load_gdb_scripts_enabled
   (const struct extension_language_defn *extlang);
 
 #endif /* AUTO_LOAD_H */
index 7f99f3e1ca1268ccb64575831b6475726b58b260..1b6701ba6cc9c27479010595b7fa4e47482f462e 100644 (file)
@@ -92,7 +92,7 @@ struct extension_language_script_ops
 
   /* Return non-zero if auto-loading scripts in this extension language
      is enabled.  */
-  int (*auto_load_enabled) (const struct extension_language_defn *);
+  bool (*auto_load_enabled) (const struct extension_language_defn *);
 };
 
 /* The interface for making calls from GDB to an external extension
index 289f527ee4977f5dbfeb75b0951cd80c3a7afe63..0e0d42685fc7e44d698c9245c893f075e61d66c6 100644 (file)
@@ -282,14 +282,13 @@ ext_lang_objfile_script_executor
   return extlang->script_ops->objfile_script_executor;
 }
 
-/* Return non-zero if auto-loading of EXTLANG scripts is enabled.
-   Zero is returned if support for this language isn't compiled in.  */
+/* See extension.h.  */
 
-int
+bool
 ext_lang_auto_load_enabled (const struct extension_language_defn *extlang)
 {
   if (extlang->script_ops == NULL)
-    return 0;
+    return false;
 
   /* The extension language is required to implement this function.  */
   gdb_assert (extlang->script_ops->auto_load_enabled != NULL);
index 98a4d7cf839b5d86bbcc4163a9e27da628c3bef6..a505c68d25e8be3994c4637cf382674271d9e763 100644 (file)
@@ -268,7 +268,10 @@ extern objfile_script_sourcer_func *ext_lang_objfile_script_sourcer
 extern objfile_script_executor_func *ext_lang_objfile_script_executor
   (const struct extension_language_defn *);
 
-extern int ext_lang_auto_load_enabled (const struct extension_language_defn *);
+/* Return true if auto-loading of EXTLANG scripts is enabled.
+   False is returned if support for this language isn't compiled in.  */
+
+extern bool ext_lang_auto_load_enabled (const struct extension_language_defn *);
 
 /* Wrappers for each extension language API function that iterate over all
    extension languages.  */
index 1fa60c5d38215f64e1c53025e93bfc2c66e02f75..c48547a41cde76bdd484e5cbfcdd8fa703b23a97 100644 (file)
@@ -595,7 +595,10 @@ extern struct value *vlscm_convert_value_from_scheme
 extern objfile_script_sourcer_func gdbscm_source_objfile_script;
 extern objfile_script_executor_func gdbscm_execute_objfile_script;
 
-extern int gdbscm_auto_load_enabled (const struct extension_language_defn *);
+/* Return true if auto-loading Guile scripts is enabled.
+   This is the extension_language_script_ops.auto_load_enabled "method".  */
+
+extern bool gdbscm_auto_load_enabled (const struct extension_language_defn *);
 
 extern void gdbscm_preserve_values
   (const struct extension_language_defn *,
index 4a7b2e2df1f42b270f5272bb9efc1b2011b25918..569a47f69ca3ba5d2c435338e8c5fe0b08a4c4d8 100644 (file)
@@ -41,10 +41,9 @@ show_auto_load_guile_scripts (struct ui_file *file, int from_tty,
   fprintf_filtered (file, _("Auto-loading of Guile scripts is %s.\n"), value);
 }
 
-/* Return non-zero if auto-loading Guile scripts is enabled.
-   This is the extension_language_script_ops.auto_load_enabled "method".  */
+/* See guile-internal.h.  */
 
-int
+bool
 gdbscm_auto_load_enabled (const struct extension_language_defn *extlang)
 {
   return auto_load_guile_scripts;
index 1879346db244fe2a58e84af5666ae50bf9c43d58..3b279312e888152524b2cc89a60198f61b4d2798 100644 (file)
@@ -40,10 +40,9 @@ show_auto_load_python_scripts (struct ui_file *file, int from_tty,
   fprintf_filtered (file, _("Auto-loading of Python scripts is %s.\n"), value);
 }
 
-/* Return non-zero if auto-loading Python scripts is enabled.
-   This is the extension_language_script_ops.auto_load_enabled "method".  */
+/* See python-internal.h.  */
 
-int
+bool
 gdbpy_auto_load_enabled (const struct extension_language_defn *extlang)
 {
   return auto_load_python_scripts;
index e1b62f6323cae34b8b95a7f6d94713480ab2380e..56702cad53a0a54c8f2f951123c602f8668d7957 100644 (file)
@@ -379,7 +379,10 @@ extern struct cmd_list_element *show_python_list;
 \f
 /* extension_language_script_ops "methods".  */
 
-extern int gdbpy_auto_load_enabled (const struct extension_language_defn *);
+/* Return true if auto-loading Python scripts is enabled.
+   This is the extension_language_script_ops.auto_load_enabled "method".  */
+
+extern bool gdbpy_auto_load_enabled (const struct extension_language_defn *);
 
 /* extension_language_ops "methods".  */
 
This page took 0.031176 seconds and 4 git commands to generate.