* demangle.c (demangling_style_names): New variable.
authorEli Zaretskii <eliz@gnu.org>
Mon, 19 Feb 2001 11:47:16 +0000 (11:47 +0000)
committerEli Zaretskii <eliz@gnu.org>
Mon, 19 Feb 2001 11:47:16 +0000 (11:47 +0000)
(_initialize_demangler): Fill demangling_style_names with the
names of known demangling styles from libiberty_demanglers[].  Use
add_set_enum_cmd instead of add_set_cmd, to get completion on
demangling style names.

* proc-api.c (_initialize_proc_api): Make `procfs-file' use
file-name completion.

* remote-rdi.c (_initialize_remote_rdi): Ditto for `rdilogfile'.

* solib.c (_initialize_solib): Ditto for `solib-search-path' and
`solib-absolute-prefix'.

* tracepoint.c (_initialize_tracepoint): Ditto for
`save-tracepoints'.

* win32-nat.c (_initialize_inftarg): Ditto for `dll-symbols'.

* cli/cli-cmds.c (init_cli_cmds): Make `shell' and `make' use
file-name completion.

* infcmd.c (_initialize_infcmd): Make the following commands use
the file-name completer: `tty', `args', `path', `paths', and
`run'.

gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/demangle.c
gdb/infcmd.c
gdb/proc-api.c
gdb/remote-rdi.c
gdb/solib.c
gdb/tracepoint.c
gdb/win32-nat.c
gdb/windows-nat.c

index 3623e027daf7d1c3c68122a174fb799c8f5a8e81..fada1562fb7470a15b9b0d3d5e3b9175836dbbbf 100644 (file)
@@ -1,3 +1,31 @@
+2001-02-19  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * demangle.c (demangling_style_names): New variable.
+       (_initialize_demangler): Fill demangling_style_names with the
+       names of known demangling styles from libiberty_demanglers[].  Use
+       add_set_enum_cmd instead of add_set_cmd, to get completion on
+       demangling style names.
+
+       * proc-api.c (_initialize_proc_api): Make `procfs-file' use
+       file-name completion.
+
+       * remote-rdi.c (_initialize_remote_rdi): Ditto for `rdilogfile'.
+
+       * solib.c (_initialize_solib): Ditto for `solib-search-path' and
+       `solib-absolute-prefix'.
+
+       * tracepoint.c (_initialize_tracepoint): Ditto for
+       `save-tracepoints'.
+
+       * win32-nat.c (_initialize_inftarg): Ditto for `dll-symbols'.
+
+       * cli/cli-cmds.c (init_cli_cmds): Make `shell' and `make' use
+       file-name completion.
+
+       * infcmd.c (_initialize_infcmd): Make the following commands use
+       the file-name completer: `tty', `args', `path', `paths', and
+       `run'.
+
 2001-02-18  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * go32-nat.c: Include i387-nat.h.
index 4cc4aa34156ff730f69f2a18810107dab66765ab..19b597062b2293cece16e1864e45640f397b125b 100644 (file)
@@ -778,9 +778,10 @@ from the target.", &setlist),
                  "Generic command for showing gdb debugging flags",
                  &showdebuglist, "show debug ", 0, &showlist);
 
-  add_com ("shell", class_support, shell_escape,
-          "Execute the rest of the line as a shell command.  \n\
+  c = add_com ("shell", class_support, shell_escape,
+              "Execute the rest of the line as a shell command.  \n\
 With no arguments, run an inferior shell.");
+  c->completer = filename_completer;
 
   /* NOTE: cagney/2000-03-20: Being able to enter ``(gdb) !ls'' would
      be a really useful feature.  Unfortunately, the below wont do
@@ -791,8 +792,9 @@ With no arguments, run an inferior shell.");
   if (xdb_commands)
     add_com_alias ("!", "shell", class_support, 0);
 
-  add_com ("make", class_support, make_command,
-       "Run the ``make'' program using the rest of the line as arguments.");
+  c = add_com ("make", class_support, make_command,
+          "Run the ``make'' program using the rest of the line as arguments.");
+  c->completer = filename_completer;
   add_cmd ("user", no_class, show_user,
           "Show definitions of user defined commands.\n\
 Argument is the name of the user defined command.\n\
index 2c59deca9116dc5cbef8e5c78ebac1f1126452cc..20758befd9f18af935dc530a4ab9c136bcab650f 100644 (file)
@@ -49,6 +49,11 @@ extern void _initialize_demangler (void);
 
 static char *current_demangling_style_string;
 
+/* The array of names of the known demanglyng styles.  Generated by
+   _initialize_demangler from libiberty_demanglers[] array.  */
+
+static const char **demangling_style_names;
+
 static void set_demangling_command (char *, int, struct cmd_list_element *);
 
 /* Set current demangling style.  Called by the "set demangle-style"
@@ -173,12 +178,26 @@ void
 _initialize_demangler (void)
 {
   struct cmd_list_element *set, *show;
-
-  set = add_set_cmd ("demangle-style", class_support, var_string_noescape,
-                    (char *) &current_demangling_style_string,
-                    "Set the current C++ demangling style.\n\
+  int i, ndems;
+
+  /* Fill the demangling_style_names[] array.  */
+  for (ndems = 0;
+       libiberty_demanglers[ndems].demangling_style != unknown_demangling; 
+       ndems++)
+    ;
+  demangling_style_names = xmalloc (ndems * sizeof (char *));
+  for (i = 0;
+       libiberty_demanglers[i].demangling_style != unknown_demangling; 
+       i++)
+    demangling_style_names[i] =
+      xstrdup (libiberty_demanglers[i].demangling_style_name);
+
+  set = add_set_enum_cmd ("demangle-style", class_support,
+                         demangling_style_names,
+                         (const char **) &current_demangling_style_string,
+                         "Set the current C++ demangling style.\n\
 Use `set demangle-style' without arguments for a list of demangling styles.",
-                    &setlist);
+                         &setlist);
   show = add_show_from_set (set, &showlist);
   set->function.sfunc = set_demangling_command;
 
index 5ae5c6a4b9c617aff4154fce66138d63301f976a..b7642c7b12b819d2a96c8923a9ce22049b5453f9 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 #include "event-top.h"
 #include "parser-defs.h"
+#include "completer.h"
 
 /* Functions exported for general use: */
 
@@ -1794,16 +1795,17 @@ _initialize_infcmd (void)
 {
   struct cmd_list_element *c;
 
-  add_com ("tty", class_run, tty_command,
-          "Set terminal for future runs of program being debugged.");
+  c= add_com ("tty", class_run, tty_command,
+             "Set terminal for future runs of program being debugged.");
+  c->completer = filename_completer;
 
-  add_show_from_set
-    (add_set_cmd ("args", class_run, var_string_noescape,
-                 (char *) &inferior_args,
-                 "Set argument list to give program being debugged when it is started.\n\
+  c = add_set_cmd ("args", class_run, var_string_noescape,
+                  (char *) &inferior_args,
+                  "Set argument list to give program being debugged when it is started.\n\
 Follow this command with any number of args, to be passed to the program.",
-                 &setlist),
-     &showlist);
+                  &setlist);
+  add_show_from_set (c, &showlist);
+  c->completer = filename_completer;
 
   c = add_cmd
     ("environment", no_class, environment_info,
@@ -1831,12 +1833,13 @@ This does not affect the program until the next \"run\" command.",
               &setlist);
   c->completer = noop_completer;
 
-  add_com ("path", class_files, path_command,
-          "Add directory DIR(s) to beginning of search path for object files.\n\
+  c = add_com ("path", class_files, path_command,
+              "Add directory DIR(s) to beginning of search path for object files.\n\
 $cwd in the path means the current working directory.\n\
 This path is equivalent to the $PATH shell variable.  It is a list of\n\
 directories, separated by colons.  These directories are searched to find\n\
 fully linked executable files and separately compiled object files as needed.");
+  c->completer = filename_completer;
 
   c = add_cmd ("paths", no_class, path_info,
               "Current search path for finding object files.\n\
@@ -1928,13 +1931,14 @@ the breakpoint won't break until the Nth time it is reached).");
   add_com_alias ("c", "cont", class_run, 1);
   add_com_alias ("fg", "cont", class_run, 1);
 
-  add_com ("run", class_run, run_command,
+  c = add_com ("run", class_run, run_command,
           "Start debugged program.  You may specify arguments to give it.\n\
 Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
 Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
 With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n\
 To cancel previous arguments and run with no arguments,\n\
 use \"set args\" without arguments.");
+  c->completer = filename_completer;
   add_com_alias ("r", "run", class_run, 1);
   if (xdb_commands)
     add_com ("R", class_run, run_no_args_command,
index 8a28b0061f6e5d2f0d8d8a5f5a82f870503ec15c..813923ab4bd84ab3ef5a5bf7c5f62ec70a7e2224 100644 (file)
@@ -770,6 +770,7 @@ _initialize_proc_api (void)
 
   add_show_from_set (c, &showlist);
   c->function.sfunc = set_procfs_trace_cmd;
+  c->completer = filename_completer;
 
   c = add_set_cmd ("procfs-file", no_class, var_filename,
                   (char *) &procfs_filename, 
index a4b2428e42515fe3a18f78ba93c3c07c80917453..d97cb65c2c916e5ef6246ebae4ce611e1b0f29b1 100644 (file)
@@ -32,6 +32,7 @@
 #include "gdbthread.h"
 #include "gdbcore.h"
 #include "breakpoint.h"
+#include "completer.h"
 
 #ifdef USG
 #include <sys/types.h>
@@ -1021,6 +1022,8 @@ rdilogenable_command (char *args, int from_tty)
 void
 _initialize_remote_rdi (void)
 {
+  struct cmd_list_element *c;
+
   init_rdi_ops ();
   add_target (&arm_rdi_ops);
 
@@ -1028,14 +1031,15 @@ _initialize_remote_rdi (void)
   Adp_SetLogfile (log_filename);
   Adp_SetLogEnable (log_enable);
 
-  add_cmd ("rdilogfile", class_maintenance,
-          rdilogfile_command,
-          "Set filename for ADP packet log.\n\
+  c = add_cmd ("rdilogfile", class_maintenance,
+              rdilogfile_command,
+              "Set filename for ADP packet log.\n\
 This file is used to log Angel Debugger Protocol packets.\n\
 With a single argument, sets the logfile name to that value.\n\
 Without an argument, shows the current logfile name.\n\
 See also: rdilogenable\n",
           &maintenancelist);
+  c->completer = filename_completer;
 
   add_cmd ("rdilogenable", class_maintenance,
           rdilogenable_command,
index 9808e8983d5a4b60b08be8ee83147bd70cbacafa..5fdb9a1d14857937923a44eef9557740d62ade89 100644 (file)
@@ -37,6 +37,7 @@
 #include "environ.h"
 #include "language.h"
 #include "gdbcmd.h"
+#include "completer.h"
 
 #include "solist.h"
 
@@ -790,6 +791,8 @@ sharedlibrary_command (char *args, int from_tty)
 void
 _initialize_solib (void)
 {
+  struct cmd_list_element *c;
+
   add_com ("sharedlibrary", class_files, sharedlibrary_command,
           "Load shared object library symbols for files matching REGEXP.");
   add_info ("sharedlibrary", info_sharedlibrary_command,
@@ -806,19 +809,19 @@ must be loaded manually, using `sharedlibrary'.",
                  &setlist),
      &showlist);
 
-  add_show_from_set
-    (add_set_cmd ("solib-absolute-prefix", class_support, var_filename,
-                 (char *) &solib_absolute_prefix,
-                 "Set prefix for loading absolute shared library symbol files.\n\
+  c = add_set_cmd ("solib-absolute-prefix", class_support, var_filename,
+                  (char *) &solib_absolute_prefix,
+                  "Set prefix for loading absolute shared library symbol files.\n\
 For other (relative) files, you can add values using `set solib-search-path'.",
-                 &setlist),
-     &showlist);
-  add_show_from_set
-    (add_set_cmd ("solib-search-path", class_support, var_string,
-                 (char *) &solib_search_path,
-                 "Set the search path for loading non-absolute shared library symbol files.\n\
-This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.",
-                 &setlist),
-     &showlist);
+                  &setlist);
+  add_show_from_set (c, &showlist);
+  c->completer = filename_completer;
 
+  c = add_set_cmd ("solib-search-path", class_support, var_string,
+                  (char *) &solib_search_path,
+                  "Set the search path for loading non-absolute shared library symbol files.\n\
+This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.",
+                  &setlist);
+  add_show_from_set (c, &showlist);
+  c->completer = filename_completer;
 }
index f275458dfa24fbf086ccb43522b086114484c7aa..a1feb18fc2eb9f1fa6c355ed490a9fb2d476d759 100644 (file)
@@ -32,6 +32,7 @@
 #include "tracepoint.h"
 #include "remote.h"
 #include "linespec.h"
+#include "completer.h"
 
 #include "ax.h"
 #include "ax-gdb.h"
@@ -2600,6 +2601,8 @@ get_traceframe_number (void)
 void
 _initialize_tracepoint (void)
 {
+  struct cmd_list_element *c;
+
   tracepoint_chain = 0;
   tracepoint_count = 0;
   traceframe_number = -1;
@@ -2651,9 +2654,10 @@ last tracepoint set.");
 
   add_info_alias ("tp", "tracepoints", 1);
 
-  add_com ("save-tracepoints", class_trace, tracepoint_save_command,
-          "Save current tracepoint definitions as a script.\n\
+  c = add_com ("save-tracepoints", class_trace, tracepoint_save_command,
+              "Save current tracepoint definitions as a script.\n\
 Use the 'source' command in another debug session to restore them.");
+  c->completer = filename_completer;
 
   add_com ("tdump", class_trace, trace_dump_command,
           "Print everything collected at the current tracepoint.");
index ce06fddad0b591acfaf42dcf239b239862ac19ec..71e10e952bf40924530d84bf454129da064bc2c2 100644 (file)
@@ -30,6 +30,7 @@
 #include "target.h"
 #include "gdbcore.h"
 #include "command.h"
+#include "completer.h"
 #include <signal.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -1377,10 +1378,13 @@ init_child_ops (void)
 void
 _initialize_inftarg (void)
 {
+  struct cmd_list_element *c;
+
   init_child_ops ();
 
-  add_com ("dll-symbols", class_files, dll_symbol_command,
-          "Load dll library symbols from FILE.");
+  c = add_com ("dll-symbols", class_files, dll_symbol_command,
+              "Load dll library symbols from FILE.");
+  c->completer = filename_completer;
 
   auto_solib_add = 1;
   add_com_alias ("sharedlibrary", "dll-symbols", class_alias, 1);
index ce06fddad0b591acfaf42dcf239b239862ac19ec..71e10e952bf40924530d84bf454129da064bc2c2 100644 (file)
@@ -30,6 +30,7 @@
 #include "target.h"
 #include "gdbcore.h"
 #include "command.h"
+#include "completer.h"
 #include <signal.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -1377,10 +1378,13 @@ init_child_ops (void)
 void
 _initialize_inftarg (void)
 {
+  struct cmd_list_element *c;
+
   init_child_ops ();
 
-  add_com ("dll-symbols", class_files, dll_symbol_command,
-          "Load dll library symbols from FILE.");
+  c = add_com ("dll-symbols", class_files, dll_symbol_command,
+              "Load dll library symbols from FILE.");
+  c->completer = filename_completer;
 
   auto_solib_add = 1;
   add_com_alias ("sharedlibrary", "dll-symbols", class_alias, 1);
This page took 0.033155 seconds and 4 git commands to generate.