From cc8dee1f1c67be4155225c6c29dc1245abb89812 Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Wed, 9 Oct 2019 23:27:33 -0500 Subject: [PATCH] Move declaration of max_user_call_depth to header 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 * 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 | 8 ++++++++ gdb/cli/cli-cmds.c | 3 +-- gdb/cli/cli-cmds.h | 4 ++++ gdb/cli/cli-script.c | 1 - 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b898bf77f98..d58a55fb8ee 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2019-10-12 Christian Biesinger + + * 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 * gdbsupport/print-utils.h (pulongest): Fix comment. diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 9f7b052d8e0..a39ea226045 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -74,7 +74,7 @@ static void ambiguous_line_spec (gdb::array_view sals, static void filter_sals (std::vector &); -/* 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) { diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h index 1a8b9a0d506..94ae81475d6 100644 --- a/gdb/cli/cli-cmds.h +++ b/gdb/cli/cli-cmds.h @@ -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); diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 4fc9c70259c..3137955265f 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -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. */ -- 2.30.2