\f
/* Limit the call depth of user-defined commands */
-int max_user_call_depth;
+unsigned int max_user_call_depth;
/* Define all cmd_list_elements. */
struct cmd_list_element *killlist;
-/* Chain containing all defined "enable breakpoint" subcommands. */
-
-struct cmd_list_element *enablebreaklist;
-
/* Chain containing all defined set subcommands */
struct cmd_list_element *setlist;
struct cmd_list_element *showchecklist;
-struct cmd_list_element *skiplist;
-
/* Command tracing state. */
int source_verbose = 0;
complete_command (char *arg, int from_tty)
{
int argpoint;
- char **completions, *point, *arg_prefix;
+ char *point, *arg_prefix;
+ VEC (char_ptr) *completions;
dont_repeat ();
if (completions)
{
- int item, size;
+ int ix, size = VEC_length (char_ptr, completions);
+ char *item, *prev = NULL;
- for (size = 0; completions[size]; ++size)
- ;
- qsort (completions, size, sizeof (char *), compare_strings);
+ qsort (VEC_address (char_ptr, completions), size,
+ sizeof (char *), compare_strings);
/* We do extra processing here since we only want to print each
unique item once. */
- item = 0;
- while (item < size)
+ for (ix = 0; VEC_iterate (char_ptr, completions, ix, item); ++ix)
{
int next_item;
- printf_unfiltered ("%s%s\n", arg_prefix, completions[item]);
- next_item = item + 1;
- while (next_item < size
- && ! strcmp (completions[item], completions[next_item]))
+ if (prev == NULL || strcmp (item, prev) != 0)
{
- xfree (completions[next_item]);
- ++next_item;
+ printf_unfiltered ("%s%s\n", arg_prefix, item);
+ xfree (prev);
+ prev = item;
}
-
- xfree (completions[item]);
- item = next_item;
+ else
+ xfree (item);
}
- xfree (completions);
+ xfree (prev);
+ VEC_free (char_ptr, completions);
}
}
static void
show_version (char *args, int from_tty)
{
- immediate_quit++;
print_gdb_version (gdb_stdout);
printf_filtered ("\n");
- immediate_quit--;
}
/* Handle the quit command. */
dont_repeat ();
if (dir == 0)
- error_no_arg (_("new working directory"));
+ dir = "~";
dir = tilde_expand (dir);
make_cleanup (xfree, dir);
else
sals_end = decode_line_1 (&arg1, DECODE_LINE_LIST_MODE,
sal.symtab, sal.line);
- filter_sals (&sals);
+ filter_sals (&sals_end);
if (sals_end.nelts == 0)
return;
if (sals_end.nelts > 1)
frame = get_selected_frame (_("No frame selected."));
gdbarch = get_frame_arch (frame);
- pc = get_frame_pc (frame);
+ pc = get_frame_address_in_block (frame);
if (find_pc_partial_function (pc, &name, &low, &high) == 0)
error (_("No function contains program counter for selected frame."));
#if defined(TUI)
}
else
{
- int i;
dyn_string_t alias_prefix_dyn_string, command_prefix_dyn_string;
char *alias_prefix, *command_prefix;
struct cmd_list_element *c_alias, *c_command;
++out;
}
}
- sals->nelts = out;
if (sals->nelts == 0)
{
xfree (sals->sals);
sals->sals = NULL;
}
+ else
+ sals->nelts = out;
}
static void
stoplist = NULL;
deletelist = NULL;
detachlist = NULL;
- enablebreaklist = NULL;
setlist = NULL;
unsetlist = NULL;
showlist = NULL;
showprintlist = NULL;
setchecklist = NULL;
showchecklist = NULL;
- skiplist = NULL;
}
static void
show_remote_debug,
&setdebuglist, &showdebuglist);
- add_setshow_integer_cmd ("remotetimeout", no_class, &remote_timeout, _("\
+ add_setshow_zuinteger_unlimited_cmd ("remotetimeout", no_class,
+ &remote_timeout, _("\
Set timeout limit to wait for target to respond."), _("\
Show timeout limit to wait for target to respond."), _("\
This value is used to set the time limit for gdb to wait for a response\n\
from the target."),
- NULL,
- show_remote_timeout,
- &setlist, &showlist);
+ NULL,
+ show_remote_timeout,
+ &setlist, &showlist);
add_prefix_cmd ("debug", no_class, set_debug,
_("Generic command for setting gdb debugging flags"),
add_com ("apropos", class_support, apropos_command,
_("Search for commands matching a REGEXP"));
- add_setshow_integer_cmd ("max-user-call-depth", no_class,
+ add_setshow_uinteger_cmd ("max-user-call-depth", no_class,
&max_user_call_depth, _("\
Set the max call depth for non-python user-defined commands."), _("\
Show the max call depth for non-python user-defined commands."), NULL,
- NULL,
- show_max_user_call_depth,
- &setlist, &showlist);
+ NULL,
+ show_max_user_call_depth,
+ &setlist, &showlist);
add_setshow_boolean_cmd ("trace-commands", no_class, &trace_commands, _("\
Set tracing of GDB CLI commands."), _("\