* cli/cli-cmds.c (max_user_call_depth): Add 'unsigned'.
	(init_cmds): Call add_setshow_uinteger_cmd for command
	'max-user-call-depth'.
	* cli/cli-script.c (execute_user_command): Add 'unsigned' to the
	declaration of 'max_user_call_depth'.
	* frame.c (backtrace_limit): Add 'unsigned'.
	(_initialize_frame): Call add_setshow_uinteger_cmd for command
	'limit'.
	* remote.c (remoteaddresssize): Add 'unsigned'.
	(remote_address_masked): Change local var 'address_size' to
	'unsigned'.
	(_initialize_remote): Call add_setshow_uinteger_cmd for
	'remoteaddresssize'.
	* top.c (history_size): Add 'unsigned'.
	(show_commands): Change local variables to 'unsigned'.
	(set_history_size_command): Don't check history_size is negative.
	Adjust the condition to call unstifle_history and set history_size
	to UNIT_MAX.
This commit is contained in:
Yao Qi
2012-08-28 14:08:42 +00:00
parent 1292279a4e
commit 883b9c6c98
6 changed files with 55 additions and 33 deletions

View File

@@ -1,3 +1,24 @@
2012-08-28 Yao Qi <yao@codesourcery.com>
* cli/cli-cmds.c (max_user_call_depth): Add 'unsigned'.
(init_cmds): Call add_setshow_uinteger_cmd for command
'max-user-call-depth'.
* cli/cli-script.c (execute_user_command): Add 'unsigned' to the
declaration of 'max_user_call_depth'.
* frame.c (backtrace_limit): Add 'unsigned'.
(_initialize_frame): Call add_setshow_uinteger_cmd for command
'limit'.
* remote.c (remoteaddresssize): Add 'unsigned'.
(remote_address_masked): Change local var 'address_size' to
'unsigned'.
(_initialize_remote): Call add_setshow_uinteger_cmd for
'remoteaddresssize'.
* top.c (history_size): Add 'unsigned'.
(show_commands): Change local variables to 'unsigned'.
(set_history_size_command): Don't check history_size is negative.
Adjust the condition to call unstifle_history and set history_size
to UNIT_MAX.
2012-08-28 Pedro Alves <palves@redhat.com> 2012-08-28 Pedro Alves <palves@redhat.com>
PR gdb/14428 PR gdb/14428

View File

@@ -96,7 +96,7 @@ static void filter_sals (struct symtabs_and_lines *);
/* Limit the call depth of user-defined commands */ /* Limit the call depth of user-defined commands */
int max_user_call_depth; unsigned int max_user_call_depth;
/* Define all cmd_list_elements. */ /* Define all cmd_list_elements. */
@@ -1907,13 +1907,13 @@ With no argument, show definitions of all user defined commands."), &showlist);
add_com ("apropos", class_support, apropos_command, add_com ("apropos", class_support, apropos_command,
_("Search for commands matching a REGEXP")); _("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, _("\ &max_user_call_depth, _("\
Set the max call depth for non-python user-defined commands."), _("\ Set the max call depth for non-python user-defined commands."), _("\
Show the max call depth for non-python user-defined commands."), NULL, Show the max call depth for non-python user-defined commands."), NULL,
NULL, NULL,
show_max_user_call_depth, show_max_user_call_depth,
&setlist, &showlist); &setlist, &showlist);
add_setshow_boolean_cmd ("trace-commands", no_class, &trace_commands, _("\ add_setshow_boolean_cmd ("trace-commands", no_class, &trace_commands, _("\
Set tracing of GDB CLI commands."), _("\ Set tracing of GDB CLI commands."), _("\

View File

@@ -314,7 +314,7 @@ execute_user_command (struct cmd_list_element *c, char *args)
struct cleanup *old_chain; struct cleanup *old_chain;
enum command_control_type ret; enum command_control_type ret;
static int user_call_depth = 0; static int user_call_depth = 0;
extern int max_user_call_depth; extern unsigned int max_user_call_depth;
cmdlines = c->user_commands; cmdlines = c->user_commands;
if (cmdlines == 0) if (cmdlines == 0)

View File

@@ -196,7 +196,7 @@ show_backtrace_past_entry (struct ui_file *file, int from_tty,
value); value);
} }
static int backtrace_limit = INT_MAX; static unsigned int backtrace_limit = UINT_MAX;
static void static void
show_backtrace_limit (struct ui_file *file, int from_tty, show_backtrace_limit (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
@@ -2488,16 +2488,16 @@ the rest of the stack trace."),
&set_backtrace_cmdlist, &set_backtrace_cmdlist,
&show_backtrace_cmdlist); &show_backtrace_cmdlist);
add_setshow_integer_cmd ("limit", class_obscure, add_setshow_uinteger_cmd ("limit", class_obscure,
&backtrace_limit, _("\ &backtrace_limit, _("\
Set an upper bound on the number of backtrace levels."), _("\ Set an upper bound on the number of backtrace levels."), _("\
Show the upper bound on the number of backtrace levels."), _("\ Show the upper bound on the number of backtrace levels."), _("\
No more than the specified number of frames can be displayed or examined.\n\ No more than the specified number of frames can be displayed or examined.\n\
Zero is unlimited."), Zero is unlimited."),
NULL, NULL,
show_backtrace_limit, show_backtrace_limit,
&set_backtrace_cmdlist, &set_backtrace_cmdlist,
&show_backtrace_cmdlist); &show_backtrace_cmdlist);
/* Debug this files internals. */ /* Debug this files internals. */
add_setshow_zuinteger_cmd ("frame", class_maintenance, &frame_debug, _("\ add_setshow_zuinteger_cmd ("frame", class_maintenance, &frame_debug, _("\

View File

@@ -834,7 +834,7 @@ static struct serial *remote_desc = NULL;
some remote targets this variable is principly provided to some remote targets this variable is principly provided to
facilitate backward compatibility. */ facilitate backward compatibility. */
static int remote_address_size; static unsigned int remote_address_size;
/* Temporary to track who currently owns the terminal. See /* Temporary to track who currently owns the terminal. See
remote_terminal_* for more details. */ remote_terminal_* for more details. */
@@ -6314,7 +6314,7 @@ hexnumnstr (char *buf, ULONGEST num, int width)
static CORE_ADDR static CORE_ADDR
remote_address_masked (CORE_ADDR addr) remote_address_masked (CORE_ADDR addr)
{ {
int address_size = remote_address_size; unsigned int address_size = remote_address_size;
/* If "remoteaddresssize" was not set, default to target address size. */ /* If "remoteaddresssize" was not set, default to target address size. */
if (!address_size) if (!address_size)
@@ -11461,13 +11461,13 @@ Specify a negative limit for unlimited."),
breakpoints is %s. */ breakpoints is %s. */
&remote_set_cmdlist, &remote_show_cmdlist); &remote_set_cmdlist, &remote_show_cmdlist);
add_setshow_integer_cmd ("remoteaddresssize", class_obscure, add_setshow_uinteger_cmd ("remoteaddresssize", class_obscure,
&remote_address_size, _("\ &remote_address_size, _("\
Set the maximum size of the address (in bits) in a memory packet."), _("\ Set the maximum size of the address (in bits) in a memory packet."), _("\
Show the maximum size of the address (in bits) in a memory packet."), NULL, Show the maximum size of the address (in bits) in a memory packet."), NULL,
NULL, NULL,
NULL, /* FIXME: i18n: */ NULL, /* FIXME: i18n: */
&setlist, &showlist); &setlist, &showlist);
add_packet_config_cmd (&remote_protocol_packets[PACKET_X], add_packet_config_cmd (&remote_protocol_packets[PACKET_X],
"X", "binary-download", 1); "X", "binary-download", 1);

View File

@@ -710,7 +710,7 @@ show_write_history_p (struct ui_file *file, int from_tty,
value); value);
} }
static int history_size; static unsigned int history_size;
static void static void
show_history_size (struct ui_file *file, int from_tty, show_history_size (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
@@ -1380,7 +1380,7 @@ show_commands (char *args, int from_tty)
/* The first command in the history which doesn't exist (i.e. one more /* The first command in the history which doesn't exist (i.e. one more
than the number of the last command). Relative to history_base. */ than the number of the last command). Relative to history_base. */
int hist_len; unsigned int hist_len;
/* Print out some of the commands from the command history. */ /* Print out some of the commands from the command history. */
/* First determine the length of the history list. */ /* First determine the length of the history list. */
@@ -1445,15 +1445,16 @@ show_commands (char *args, int from_tty)
static void static void
set_history_size_command (char *args, int from_tty, struct cmd_list_element *c) set_history_size_command (char *args, int from_tty, struct cmd_list_element *c)
{ {
if (history_size == INT_MAX) /* The type of parameter in stifle_history is int, so values from INT_MAX up
unstifle_history (); mean 'unlimited'. */
else if (history_size >= 0) if (history_size >= INT_MAX)
stifle_history (history_size);
else
{ {
history_size = INT_MAX; /* Ensure that 'show history size' prints 'unlimited'. */
error (_("History size must be non-negative")); history_size = UINT_MAX;
unstifle_history ();
} }
else
stifle_history (history_size);
} }
void void
@@ -1633,13 +1634,13 @@ Without an argument, saving is enabled."),
show_write_history_p, show_write_history_p,
&sethistlist, &showhistlist); &sethistlist, &showhistlist);
add_setshow_integer_cmd ("size", no_class, &history_size, _("\ add_setshow_uinteger_cmd ("size", no_class, &history_size, _("\
Set the size of the command history,"), _("\ Set the size of the command history,"), _("\
Show the size of the command history,"), _("\ Show the size of the command history,"), _("\
ie. the number of previous commands to keep a record of."), ie. the number of previous commands to keep a record of."),
set_history_size_command, set_history_size_command,
show_history_size, show_history_size,
&sethistlist, &showhistlist); &sethistlist, &showhistlist);
add_setshow_filename_cmd ("filename", no_class, &history_filename, _("\ add_setshow_filename_cmd ("filename", no_class, &history_filename, _("\
Set the filename in which to record the command history"), _("\ Set the filename in which to record the command history"), _("\