]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/cli/cli-cmds.c
Fix PR gdb/17035: "show user" doesn't list user-defined commands that
[thirdparty/binutils-gdb.git] / gdb / cli / cli-cmds.c
index b415267d888fcb2efe890c5a20b5ace65b4cb892..b0f1bdfa4d0168b2a09d1fdb18627e7d6e6cc019 100644 (file)
@@ -1245,8 +1245,7 @@ show_user (char *args, int from_tty)
       const char *comname = args;
 
       c = lookup_cmd (&comname, cmdlist, "", 0, 1);
-      /* c->user_commands would be NULL if it's a python/scheme command.  */
-      if (c->class != class_user || !c->user_commands)
+      if (!cli_user_command_p (c))
        error (_("Not a user command."));
       show_user_1 (c, "", args, gdb_stdout);
     }
@@ -1254,7 +1253,7 @@ show_user (char *args, int from_tty)
     {
       for (c = cmdlist; c; c = c->next)
        {
-         if (c->class == class_user || c->prefixlist != NULL)
+         if (cli_user_command_p (c) || c->prefixlist != NULL)
            show_user_1 (c, "", c->name, gdb_stdout);
        }
     }