#include "readline/readline.h"
#include "readline/tilde.h"
#include "completer.h"
-#include "target.h" /* For baud_rate, remote_debug and remote_timeout */
-#include "gdb_wait.h" /* For shell escape implementation */
-#include "gdb_regex.h" /* Used by apropos_command */
+#include "target.h" /* For baud_rate, remote_debug and remote_timeout. */
+#include "gdb_wait.h" /* For shell escape implementation. */
+#include "gdb_regex.h" /* Used by apropos_command. */
#include "gdb_string.h"
#include "gdb_vfork.h"
#include "linespec.h"
#include "frame.h"
#include "value.h"
#include "language.h"
-#include "filenames.h" /* for DOSish file names */
+#include "filenames.h" /* For DOSish file names. */
#include "objfiles.h"
#include "source.h"
#include "disasm.h"
#include "python/python.h"
#ifdef TUI
-#include "tui/tui.h" /* For tui_active et.al. */
+#include "tui/tui.h" /* For tui_active et.al. */
#endif
#include <fcntl.h>
struct cmd_list_element *infolist;
-/* Chain containing all defined enable subcommands. */
+/* Chain containing all defined enable subcommands. */
struct cmd_list_element *enablelist;
-/* Chain containing all defined disable subcommands. */
+/* Chain containing all defined disable subcommands. */
struct cmd_list_element *disablelist;
-/* Chain containing all defined toggle subcommands. */
+/* Chain containing all defined toggle subcommands. */
struct cmd_list_element *togglelist;
-/* Chain containing all defined stop subcommands. */
+/* Chain containing all defined stop subcommands. */
struct cmd_list_element *stoplist;
-/* Chain containing all defined delete subcommands. */
+/* Chain containing all defined delete subcommands. */
struct cmd_list_element *deletelist;
-/* Chain containing all defined detach subcommands. */
+/* Chain containing all defined detach subcommands. */
struct cmd_list_element *detachlist;
-/* Chain containing all defined kill subcommands. */
+/* Chain containing all defined kill subcommands. */
struct cmd_list_element *killlist;
-/* Chain containing all defined "enable breakpoint" subcommands. */
+/* Chain containing all defined "enable breakpoint" subcommands. */
struct cmd_list_element *enablebreaklist;
struct cmd_list_element *unsethistlist;
-/* Chain containing all defined maintenance subcommands. */
+/* Chain containing all defined maintenance subcommands. */
struct cmd_list_element *maintenancelist;
-/* Chain containing all defined "maintenance info" subcommands. */
+/* Chain containing all defined "maintenance info" subcommands. */
struct cmd_list_element *maintenanceinfolist;
-/* Chain containing all defined "maintenance print" subcommands. */
+/* Chain containing all defined "maintenance print" subcommands. */
struct cmd_list_element *maintenanceprintlist;
static const char *script_ext_mode = script_ext_soft;
\f
/* Utility used everywhere when at least one argument is needed and
- none is supplied. */
+ none is supplied. */
void
error_no_arg (char *why)
}
/* The "info" command is defined as a prefix, with allow_unknown = 0.
- Therefore, its own definition is called only for "info" with no args. */
+ Therefore, its own definition is called only for "info" with no
+ args. */
static void
info_command (char *arg, int from_tty)
arg = "";
argpoint = strlen (arg);
- /* complete_line assumes that its first argument is somewhere within,
- and except for filenames at the beginning of, the word to be completed.
- The following crude imitation of readline's word-breaking tries to
- accomodate this. */
+ /* complete_line assumes that its first argument is somewhere
+ within, and except for filenames at the beginning of, the word to
+ be completed. The following crude imitation of readline's
+ word-breaking tries to accomodate this. */
point = arg + argpoint;
while (point > arg)
{
}
}
else
- /* We are dealing with leading repetitions of "/..", for example
- "/../..", which is the Mach super-root. */
+ /* We are dealing with leading repetitions of "/..", for
+ example "/../..", which is the Mach super-root. */
p += 3;
}
else
if (!find_and_open_script (file, search_path, &stream, &full_path))
{
- /* The script wasn't found, or was otherwise inaccessible.
- If the source command was invoked interactively, throw an error.
- Otherwise (e.g. if it was invoked by a script), silently ignore
- the error. */
+ /* The script wasn't found, or was otherwise inaccessible.
+ If the source command was invoked interactively, throw an
+ error. Otherwise (e.g. if it was invoked by a script),
+ silently ignore the error. */
if (from_tty)
perror_with_name (file);
else
int search_path = 0;
*old_source_verbose = source_verbose;
- old_cleanups = make_cleanup (source_verbose_cleanup, old_source_verbose);
+ old_cleanups = make_cleanup (source_verbose_cleanup,
+ old_source_verbose);
/* -v causes the source command to run in verbose mode.
-s causes the file to be searched in the source search path,
{
while (args[0] != '\0')
{
- /* Make sure leading white space does not break the comparisons. */
+ /* Make sure leading white space does not break the
+ comparisons. */
while (isspace(args[0]))
args++;
gdb_flush (gdb_stderr);
}
#ifdef GLOBAL_CURDIR
- /* Make sure to return to the directory GDB thinks it is, in case the
- shell command we just ran changed it. */
+ /* Make sure to return to the directory GDB thinks it is, in case
+ the shell command we just ran changed it. */
chdir (current_directory);
#endif
#else /* Can fork. */
if ((user_shell = (char *) getenv ("SHELL")) == NULL)
user_shell = "/bin/sh";
- /* Get the name of the shell for arg0 */
+ /* Get the name of the shell for arg0. */
if ((p = strrchr (user_shell, '/')) == NULL)
p = user_shell;
else
sal = get_current_source_symtab_and_line ();
}
- /* bare "edit" edits file with present line. */
+ /* Bare "edit" edits file with present line. */
if (arg == 0)
{
if (*arg1)
error (_("Junk at end of line specification."));
- /* If line was specified by address,
- first print exactly which line, and which file.
- In this case, sal.symtab == 0 means address is outside
- of all known source files, not that user failed to give a filename. */
+ /* If line was specified by address, first print exactly which
+ line, and which file. In this case, sal.symtab == 0 means
+ address is outside of all known source files, not that user
+ failed to give a filename. */
if (*arg == '*')
{
struct gdbarch *gdbarch;
sal.symtab->filename, sal.line);
}
- /* If what was given does not imply a symtab, it must be an undebuggable
- symbol which means no source code. */
+ /* If what was given does not imply a symtab, it must be an
+ undebuggable symbol which means no source code. */
if (sal.symtab == 0)
error (_("No line number known for %s."), arg);
int linenum_beg = 0;
char *p;
- /* Pull in the current default source line if necessary */
+ /* Pull in the current default source line if necessary. */
if (arg == 0 || arg[0] == '+' || arg[0] == '-')
{
set_default_source_symtab_and_line ();
return;
}
- /* "l -" lists previous ten lines, the ones before the ten just listed. */
+ /* "l -" lists previous ten lines, the ones before the ten just
+ listed. */
if (strcmp (arg, "-") == 0)
{
print_source_lines (cursal.symtab,
if (dummy_beg && dummy_end)
error (_("Two empty args do not say what lines to list."));
- /* if line was specified by address,
+ /* If line was specified by address,
first print exactly which line, and which file.
- In this case, sal.symtab == 0 means address is outside
- of all known source files, not that user failed to give a filename. */
+
+ In this case, sal.symtab == 0 means address is outside of all
+ known source files, not that user failed to give a filename. */
if (*arg == '*')
{
struct gdbarch *gdbarch;
sal.symtab->filename, sal.line);
}
- /* If line was not specified by just a line number,
- and it does not imply a symtab, it must be an undebuggable symbol
- which means no source code. */
+ /* If line was not specified by just a line number, and it does not
+ imply a symtab, it must be an undebuggable symbol which means no
+ source code. */
if (!linenum_beg && sal.symtab == 0)
error (_("No line number known for %s."), arg);
}
/* Search through names of commands and documentations for a certain
- regular expression.
-*/
+ regular expression. */
+
void
apropos_command (char *searchstr, int from_tty)
{
- extern struct cmd_list_element *cmdlist; /*This is the main command list*/
+ extern struct cmd_list_element *cmdlist; /* This is the main command
+ list. */
regex_t pattern;
char *pattern_fastmap;
char errorbuffer[512];
}
\f
/* Print a list of files and line numbers which a user may choose from
- in order to list a function which was specified ambiguously (as with
- `list classname::overloadedfuncname', for example). The vector in
- SALS provides the filenames and line numbers. */
+ in order to list a function which was specified ambiguously (as
+ with `list classname::overloadedfuncname', for example). The
+ vector in SALS provides the filenames and line numbers. */
static void
ambiguous_line_spec (struct symtabs_and_lines *sals)
&cmdlist);
add_cmd ("running", class_run, NULL, _("Running the program."), &cmdlist);
- /* Define general commands. */
+ /* Define general commands. */
add_com ("pwd", class_files, pwd_command, _("\
Print working directory. This is used for your program as well."));
and should be terminated by the word 'else' or `end'. If an else clause\n\
is used, the same rules apply to its nested commands as to the first ones."));
- /* If target is open when baud changes, it doesn't take effect until the
- next open (I think, not sure). */
+ /* If target is open when baud changes, it doesn't take effect until
+ the next open (I think, not sure). */
add_setshow_zinteger_cmd ("remotebaud", no_class, &baud_rate, _("\
Set baud rate for remote serial I/O."), _("\
Show baud rate for remote serial I/O."), _("\
this. Instead it adds support for the form ``(gdb) ! ls''
(i.e. the space is required). If the ``!'' command below is
added the complains about no ``!'' command would be replaced by
- complains about how the ``!'' command is broken :-) */
+ complains about how the ``!'' command is broken :-) */
if (xdb_commands)
add_com_alias ("!", "shell", class_support, 0);