Fix crash when exiting TUI with gdb -tui
[deliverable/binutils-gdb.git] / gdb / cli / cli-decode.h
index 2ec4a97d8138d646590daf6d5056c97bcebdb1ae..f4719bfac47ab855cf1c11c3e1ddc67e8482ada4 100644 (file)
@@ -1,6 +1,6 @@
 /* Header file for GDB command decoding library.
 
-   Copyright (C) 2000-2019 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
@@ -55,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),
@@ -69,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);
@@ -109,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;
@@ -242,9 +249,6 @@ 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 *);
This page took 0.024165 seconds and 4 git commands to generate.