Mon Jun 14 09:23:51 1993 Jim Kingdon (kingdon@cygnus.com)
* main.c, gdbcmd.h: Add function filename_completer.
- source.c: Use it for "directory" command.
- (This will be more useful if the word break stuff is fixed).
+ * main.c, symfile.c, source.c, exec.c, core.c: Use it for
+ "directory", "source", "cd", "symbol-file" "add-symbol-file",
+ "load", "file", "exec-file", "core-file" commands.
+ (But '/' is a word break, limiting usefulness; see comments).
* source.c (mod_path): Warning not error if can't find directory.
#include "inferior.h"
#include "symtab.h"
#include "command.h"
+#include "gdbcmd.h"
#include "bfd.h"
#include "target.h"
#include "gdbcore.h"
void
_initialize_core()
{
-
- add_com ("core-file", class_files, core_file_command,
- "Use FILE as core dump for examining memory and registers.\n\
+ struct cmd_list_element *c;
+ c = add_cmd ("core-file", class_files, core_file_command,
+ "Use FILE as core dump for examining memory and registers.\n\
No arg means have no core file. This command has been superseded by the\n\
-`target core' and `detach' commands.");
-
+`target core' and `detach' commands.", &cmdlist);
+ c->completer = filename_completer;
}
add_com ("pwd", class_files, pwd_command,
"Print working directory. This is used for your program as well.");
- add_com ("cd", class_files, cd_command,
+ c = add_cmd ("cd", class_files, cd_command,
"Set working directory to DIR for debugger and program being debugged.\n\
The change does not take effect for the program being debugged\n\
-until the next time it is started.");
+until the next time it is started.", &cmdlist);
+ c->completer = filename_completer;
add_show_from_set
(add_set_cmd ("prompt", class_support, var_string, (char *)&prompt,
Commands defined in this way do not take arguments.");
#ifdef __STDC__
- add_com ("source", class_support, source_command,
+ c = add_cmd ("source", class_support, source_command,
"Read commands from a file named FILE.\n\
Note that the file \"" GDBINIT_FILENAME "\" is read automatically in this way\n\
-when gdb is started.");
+when gdb is started.", &cmdlist);
#else
/* Punt file name, we can't help it easily. */
- add_com ("source", class_support, source_command,
+ c = add_cmd ("source", class_support, source_command,
"Read commands from a file named FILE.\n\
Note that the file \".gdbinit\" is read automatically in this way\n\
-when gdb is started.");
+when gdb is started.", &cmdlist);
#endif
+ c->completer = filename_completer;
add_com ("quit", class_support, quit_command, "Exit gdb.");
add_com ("help", class_support, help_command, "Print list of commands.");