diff options
author | qiyao <qiyao> | 2012-08-28 14:08:37 +0000 |
---|---|---|
committer | qiyao <qiyao> | 2012-08-28 14:08:37 +0000 |
commit | 575722288a9e2e7eb3e239b2c3f2b2682fea1645 (patch) | |
tree | 963285bb9ada643aa76564ad228f903f88ba7f54 /gdb/top.c | |
parent | bb55c3f9f5b4c0505d02a303217950bee7c9ca05 (diff) | |
download | gdb-575722288a9e2e7eb3e239b2c3f2b2682fea1645.tar.gz |
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.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gdb/top.c b/gdb/top.c index 7084116bbfb..99fd5fff6bd 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"), _("\ |