Move declaration of max_user_call_depth to header
authorChristian Biesinger <cbiesinger@google.com>
Thu, 10 Oct 2019 04:27:33 +0000 (23:27 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Sat, 12 Oct 2019 19:31:26 +0000 (14:31 -0500)
Also removes an unnecessary declaration of cmdlist in cli-cmds.c.
I don't understand why it is there, the definition of cmdlist is
at the top of the same file.

gdb/ChangeLog:

2019-10-12  Christian Biesinger  <cbiesinger@google.com>

* cli/cli-cmds.c (max_user_call_depth): Move comment to header.
(show_user): Remove declaration of cmdlist.
* cli/cli-cmds.h (max_user_call_depth): Declare.
* cli/cli-script.c (execute_user_command): Remove declaration
of max_user_call_depth.

gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/cli/cli-cmds.h
gdb/cli/cli-script.c

index b898bf77f985f5b415dc7004b3d5fbaa093e82d3..d58a55fb8eede5769266c76f1cd63d0c0262d435 100644 (file)
@@ -1,3 +1,11 @@
+2019-10-12  Christian Biesinger  <cbiesinger@google.com>
+
+       * cli/cli-cmds.c (max_user_call_depth): Move comment to header.
+       (show_user): Remove declaration of cmdlist.
+       * cli/cli-cmds.h (max_user_call_depth): Declare.
+       * cli/cli-script.c (execute_user_command): Remove declaration
+       of max_user_call_depth.
+
 2019-10-11  Jim Wilson  <jimw@sifive.com>
 
        * gdbsupport/print-utils.h (pulongest): Fix comment.
index 9f7b052d8e0249cc398f815ab072e3aa41718204..a39ea22604511c9b09c0581eb8f077f6963b3557 100644 (file)
@@ -74,7 +74,7 @@ static void ambiguous_line_spec (gdb::array_view<const symtab_and_line> sals,
 static void filter_sals (std::vector<symtab_and_line> &);
 
 \f
-/* Limit the call depth of user-defined commands */
+/* See cli-cmds.h. */
 unsigned int max_user_call_depth;
 
 /* Define all cmd_list_elements.  */
@@ -1538,7 +1538,6 @@ static void
 show_user (const char *args, int from_tty)
 {
   struct cmd_list_element *c;
-  extern struct cmd_list_element *cmdlist;
 
   if (args)
     {
index 1a8b9a0d5068dbd61ac01d2e6055442f88991c5b..94ae81475d6ba4bfbfa884152f940a869c00981e 100644 (file)
@@ -101,6 +101,10 @@ extern struct cmd_list_element *setchecklist;
 
 extern struct cmd_list_element *showchecklist;
 
+/* Limit the call depth of user-defined commands */
+
+extern unsigned int max_user_call_depth;
+
 /* Exported to gdb/top.c */
 
 void init_cmd_lists (void);
index 4fc9c70259ca537fc1c4cbd38ebee3f68ca8105f..3137955265f65100ab08c93741cf6b1da4ffc5f0 100644 (file)
@@ -449,7 +449,6 @@ void
 execute_user_command (struct cmd_list_element *c, const char *args)
 {
   counted_command_line cmdlines_copy;
-  extern unsigned int max_user_call_depth;
 
   /* Ensure that the user commands can't be deleted while they are
      executing.  */
This page took 0.032087 seconds and 4 git commands to generate.