aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-08-28 14:08:42 +0000
committerYao Qi <yao@codesourcery.com>2012-08-28 14:08:42 +0000
commit883b9c6c986112470844e07039d55789d11f706b (patch)
tree746d4f3654a1d4ab572f82dd5596b8b745d59729 /gdb/top.c
parent1292279a4ef1c77bd8e6ffb26346ebc0592e1a8d (diff)
downloadgdb-883b9c6c986112470844e07039d55789d11f706b.zip
gdb-883b9c6c986112470844e07039d55789d11f706b.tar.gz
gdb-883b9c6c986112470844e07039d55789d11f706b.tar.bz2
gdb/
* 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.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 7084116..99fd5ff 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -710,7 +710,7 @@ show_write_history_p (struct ui_file *file, int from_tty,
value);
}
-static int history_size;
+static unsigned int history_size;
static void
show_history_size (struct ui_file *file, int from_tty,
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
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. */
/* First determine the length of the history list. */
@@ -1445,15 +1445,16 @@ show_commands (char *args, int from_tty)
static void
set_history_size_command (char *args, int from_tty, struct cmd_list_element *c)
{
- if (history_size == INT_MAX)
- unstifle_history ();
- else if (history_size >= 0)
- stifle_history (history_size);
- else
+ /* The type of parameter in stifle_history is int, so values from INT_MAX up
+ mean 'unlimited'. */
+ if (history_size >= INT_MAX)
{
- history_size = INT_MAX;
- error (_("History size must be non-negative"));
+ /* Ensure that 'show history size' prints 'unlimited'. */
+ history_size = UINT_MAX;
+ unstifle_history ();
}
+ else
+ stifle_history (history_size);
}
void
@@ -1633,13 +1634,13 @@ Without an argument, saving is enabled."),
show_write_history_p,
&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,"), _("\
Show the size of the command history,"), _("\
ie. the number of previous commands to keep a record of."),
- set_history_size_command,
- show_history_size,
- &sethistlist, &showhistlist);
+ set_history_size_command,
+ show_history_size,
+ &sethistlist, &showhistlist);
add_setshow_filename_cmd ("filename", no_class, &history_filename, _("\
Set the filename in which to record the command history"), _("\