Fix crash when exiting TUI with gdb -tui
[deliverable/binutils-gdb.git] / gdb / cli / cli-decode.h
index e18b7097672d32589ab82296f4df320135dda4f9..f4719bfac47ab855cf1c11c3e1ddc67e8482ada4 100644 (file)
@@ -1,6 +1,6 @@
 /* Header file for GDB command decoding library.
 
-   Copyright (C) 2000-2018 Free Software Foundation, Inc.
+   Copyright (C) 2000-2020 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -15,8 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#if !defined (CLI_DECODE_H)
-#define CLI_DECODE_H 1
+#ifndef CLI_CLI_DECODE_H
+#define CLI_CLI_DECODE_H
 
 /* This file defines the private interfaces for any code implementing
    command internals.  */
@@ -25,6 +25,7 @@
 #include "command.h"
 #include "gdb_regex.h"
 #include "cli-script.h"
+#include "completer.h"
 
 #if 0
 /* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
@@ -54,6 +55,7 @@ struct cmd_list_element
        deprecated_warn_user (0),
        malloced_replacement (0),
        doc_allocated (0),
+       name_allocated (0),
        hook_in (0),
        allow_unknown (0),
        abbrev_flag (0),
@@ -68,6 +70,8 @@ struct cmd_list_element
     {
       if (doc && doc_allocated)
        xfree ((char *) doc);
+      if (name_allocated)
+       xfree ((char *) name);
     }
 
     DISABLE_COPY_AND_ASSIGN (cmd_list_element);
@@ -108,6 +112,10 @@ struct cmd_list_element
 
     unsigned int doc_allocated : 1;
 
+    /* Set if the name field should be xfree'd.  */
+
+    unsigned int name_allocated : 1;
+
     /* Flag that specifies if this command is already running its hook.  */
     /* Prevents the possibility of hook recursion.  */
     unsigned int hook_in : 1;
@@ -241,15 +249,12 @@ struct cmd_list_element
     int *suppress_notification = nullptr;
   };
 
-extern void help_cmd_list (struct cmd_list_element *, enum command_class,
-                          const char *, int, struct ui_file *);
-
 /* Functions that implement commands about CLI commands.  */
 
 extern void help_cmd (const char *, struct ui_file *);
 
 extern void apropos_cmd (struct ui_file *, struct cmd_list_element *,
-                         compiled_regex &, const char *);
+                        bool verbose, compiled_regex &, const char *);
 
 /* Used to mark commands that don't do anything.  If we just leave the
    function field NULL, the command is interpreted as a help topic, or
@@ -257,10 +262,19 @@ extern void apropos_cmd (struct ui_file *, struct cmd_list_element *,
 
 extern void not_just_help_class_command (const char *arg, int from_tty);
 
-/* Exported to cli/cli-setshow.c */
+/* Print only the first line of STR on STREAM.
+   FOR_VALUE_PREFIX true indicates that the first line is output
+   to be a prefix to show a value (see deprecated_show_value_hack):
+   the first character is printed in uppercase, and the trailing
+   dot character is not printed.  */
+
+extern void print_doc_line (struct ui_file *stream, const char *str,
+                           bool for_value_prefix);
 
-extern void print_doc_line (struct ui_file *, const char *);
+/* The enums of boolean commands.  */
+extern const char * const boolean_enums[];
 
+/* The enums of auto-boolean commands.  */
 extern const char * const auto_boolean_enums[];
 
 /* Verify whether a given cmd_list_element is a user-defined command.
@@ -270,4 +284,4 @@ extern int cli_user_command_p (struct cmd_list_element *);
 
 extern int find_command_name_length (const char *);
 
-#endif /* !defined (CLI_DECODE_H) */
+#endif /* CLI_CLI_DECODE_H */
This page took 0.025227 seconds and 4 git commands to generate.