* 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'.
This commit is contained in:
Eli Zaretskii 2001-02-19 11:47:16 +00:00
parent fb33b90691
commit fa58ee1196
10 changed files with 114 additions and 41 deletions

View 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.

View 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\

View 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;
int i, ndems;
set = add_set_cmd ("demangle-style", class_support, var_string_noescape,
(char *) &current_demangling_style_string,
"Set the current C++ demangling style.\n\
/* 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;

View 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,

View 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,

View 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,

View 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;
}

View 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.");

View 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);

View 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);