@@ -1,5 +1,30 @@
2016-11-11 Andrew Burgess <andrew.burgess@embecosm.com>
+ * dcache.c (set_dcache_size): Don't change value on error path.
+ (set_dcache_line_size): Likewise.
+ * record.c (record_insn_history_size_setshow_var): Remove.
+ (record_call_history_size_setshow_var): Remove.
+ (validate_history_size): Simplify to just the error check.
+ (set_record_insn_history_size): Update call to
+ validate_history_size.
+ (set_record_call_history_size): Likewise.
+ (_initialize_record): Remove use of *_setshow_var.
+ * symtab.c (new_symbol_cache_size): Remove.
+ (symbol_cache_size): Update comment.
+ (set_symbol_cache_size_handler): Simplify error check.
+ (_initialize_symtab): Remove use of new_symbol_cache_size.
+ * valprint.c (input_radix_1): Remove.
+ (set_input_radix): Remove use of input_radix_1.
+ (set_input_radix_1): Likewise.
+ (output_radix_1): Remove.
+ (set_output_radix): Remove use of output_radix_1.
+ (set_output_radix_1): Likewise.
+ (_initialize_valprint): Remove use of output_radix_1 and
+ input_radix_1.
+ * value.c (set_max_value_size): Simplify error case.
+
+2016-11-11 Andrew Burgess <andrew.burgess@embecosm.com>
+
* cli/cli-setshow.c: Add exceptions.h include.
(do_set_comment): When installing a settings new value, don't
loose the previous value until the set-hook has been called. If
@@ -652,10 +652,7 @@ set_dcache_size (char *args, int from_tty,
struct cmd_list_element *c)
{
if (dcache_size == 0)
- {
- dcache_size = DCACHE_DEFAULT_SIZE;
- error (_("Dcache size must be greater than 0."));
- }
+ error (_("Dcache size must be greater than 0."));
target_dcache_invalidate ();
}
@@ -665,11 +662,8 @@ set_dcache_line_size (char *args, int from_tty,
{
if (dcache_line_size < 2
|| (dcache_line_size & (dcache_line_size - 1)) != 0)
- {
- unsigned d = dcache_line_size;
- dcache_line_size = DCACHE_DEFAULT_LINE_SIZE;
- error (_("Invalid dcache line size: %u (must be power of 2)."), d);
- }
+ error (_("Invalid dcache line size: %u (must be power of 2)."),
+ dcache_line_size);
target_dcache_invalidate ();
}
@@ -35,18 +35,9 @@ unsigned int record_debug = 0;
/* The number of instructions to print in "record instruction-history". */
static unsigned int record_insn_history_size = 10;
-/* The variable registered as control variable in the "record
- instruction-history" command. Necessary for extra input
- validation. */
-static unsigned int record_insn_history_size_setshow_var;
-
/* The number of functions to print in "record function-call-history". */
static unsigned int record_call_history_size = 10;
-/* The variable registered as control variable in the "record
- call-history" command. Necessary for extra input validation. */
-static unsigned int record_call_history_size_setshow_var;
-
struct cmd_list_element *record_cmdlist = NULL;
struct cmd_list_element *record_goto_cmdlist = NULL;
struct cmd_list_element *set_record_cmdlist = NULL;
@@ -690,23 +681,13 @@ cmd_record_call_history (char *arg, int from_tty)
/* Helper for "set record instruction-history-size" and "set record
function-call-history-size" input validation. COMMAND_VAR is the
- variable registered in the command as control variable. *SETTING
- is the real setting the command allows changing. */
+ variable registered in the command as control variable. */
static void
-validate_history_size (unsigned int *command_var, unsigned int *setting)
+validate_history_size (unsigned int command_var)
{
- if (*command_var != UINT_MAX && *command_var > INT_MAX)
- {
- unsigned int new_value = *command_var;
-
- /* Restore previous value. */
- *command_var = *setting;
- error (_("integer %u out of range"), new_value);
- }
-
- /* Commit new value. */
- *setting = *command_var;
+ if (command_var != UINT_MAX && command_var > INT_MAX)
+ error (_("integer %u out of range"), command_var);
}
/* Called by do_setshow_command. We only want values in the
@@ -717,8 +698,7 @@ static void
set_record_insn_history_size (char *args, int from_tty,
struct cmd_list_element *c)
{
- validate_history_size (&record_insn_history_size_setshow_var,
- &record_insn_history_size);
+ validate_history_size (record_insn_history_size);
}
/* Called by do_setshow_command. We only want values in the
@@ -729,8 +709,7 @@ static void
set_record_call_history_size (char *args, int from_tty,
struct cmd_list_element *c)
{
- validate_history_size (&record_call_history_size_setshow_var,
- &record_call_history_size);
+ validate_history_size (record_call_history_size);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
@@ -750,7 +729,7 @@ _initialize_record (void)
&showdebuglist);
add_setshow_uinteger_cmd ("instruction-history-size", no_class,
- &record_insn_history_size_setshow_var, _("\
+ &record_insn_history_size, _("\
Set number of instructions to print in \"record instruction-history\"."), _("\
Show number of instructions to print in \"record instruction-history\"."), _("\
A size of \"unlimited\" means unlimited instructions. The default is 10."),
@@ -758,7 +737,7 @@ A size of \"unlimited\" means unlimited instructions. The default is 10."),
&set_record_cmdlist, &show_record_cmdlist);
add_setshow_uinteger_cmd ("function-call-history-size", no_class,
- &record_call_history_size_setshow_var, _("\
+ &record_call_history_size, _("\
Set number of function to print in \"record function-call-history\"."), _("\
Show number of functions to print in \"record function-call-history\"."), _("\
A size of \"unlimited\" means unlimited lines. The default is 10."),
@@ -855,8 +834,4 @@ from the first argument.\n\
The number of functions to print can be defined with \"set record \
function-call-history-size\"."),
&record_cmdlist);
-
- /* Sync command control variables. */
- record_insn_history_size_setshow_var = record_insn_history_size;
- record_call_history_size_setshow_var = record_call_history_size;
}
@@ -212,12 +212,7 @@ unsigned int symtab_create_debug = 0;
/* When non-zero, print debugging messages related to symbol lookup. */
unsigned int symbol_lookup_debug = 0;
-/* The size of the cache is staged here. */
-static unsigned int new_symbol_cache_size = DEFAULT_SYMBOL_CACHE_SIZE;
-
-/* The current value of the symbol cache size.
- This is saved so that if the user enters a value too big we can restore
- the original value from here. */
+/* The current value of the symbol cache size. */
static unsigned int symbol_cache_size = DEFAULT_SYMBOL_CACHE_SIZE;
/* Non-zero if a file may be known by two different basenames.
@@ -1285,17 +1280,9 @@ static void
set_symbol_cache_size_handler (char *args, int from_tty,
struct cmd_list_element *c)
{
- if (new_symbol_cache_size > MAX_SYMBOL_CACHE_SIZE)
- {
- /* Restore the previous value.
- This is the value the "show" command prints. */
- new_symbol_cache_size = symbol_cache_size;
-
- error (_("Symbol cache size is too large, max is %u."),
- MAX_SYMBOL_CACHE_SIZE);
- }
- symbol_cache_size = new_symbol_cache_size;
-
+ if (symbol_cache_size > MAX_SYMBOL_CACHE_SIZE)
+ error (_("Symbol cache size is too large, max is %u."),
+ MAX_SYMBOL_CACHE_SIZE);
set_symbol_cache_size (symbol_cache_size);
}
@@ -6222,7 +6209,7 @@ When enabled (non-zero), symbol lookups are logged."),
&setdebuglist, &showdebuglist);
add_setshow_zuinteger_cmd ("symbol-cache-size", no_class,
- &new_symbol_cache_size,
+ &symbol_cache_size,
_("Set the size of the symbol cache."),
_("Show the size of the symbol cache."), _("\
The size of the symbol cache.\n\
@@ -1,5 +1,9 @@
2016-11-11 Andrew Burgess <andrew.burgess@embecosm.com>
+ * gdb.base/max-value-size.exp: Update expected output.
+
+2016-11-11 Andrew Burgess <andrew.burgess@embecosm.com>
+
* gdb.base/dcache-line-set-error.exp: New file.
2016-11-09 Pedro Alves <palves@redhat.com>
@@ -90,8 +90,8 @@ set_and_check_max_value_size "unlimited"
# Check that we can't set the maximum size stupidly low.
gdb_test "set max-value-size 1" \
- "max-value-size set too low, increasing to \[0-9\]+ bytes"
+ "max-value-size 1 bytes is too low"
gdb_test "set max-value-size 0" \
- "max-value-size set too low, increasing to \[0-9\]+ bytes"
+ "max-value-size 0 bytes is too low"
gdb_test "set max-value-size -5" \
"only -1 is allowed to set as unlimited"
@@ -2955,11 +2955,6 @@ val_print_string (struct type *elttype, const char *encoding,
}
-/* The 'set input-radix' command writes to this auxiliary variable.
- If the requested radix is valid, INPUT_RADIX is updated; otherwise,
- it is left unchanged. */
-
-static unsigned input_radix_1 = 10;
/* Validate an input or output radix setting, and make sure the user
knows what they really did here. Radix setting is confusing, e.g.
@@ -2968,7 +2963,7 @@ static unsigned input_radix_1 = 10;
static void
set_input_radix (char *args, int from_tty, struct cmd_list_element *c)
{
- set_input_radix_1 (from_tty, input_radix_1);
+ set_input_radix_1 (from_tty, input_radix);
}
static void
@@ -2982,12 +2977,9 @@ set_input_radix_1 (int from_tty, unsigned radix)
(FIXME). */
if (radix < 2)
- {
- input_radix_1 = input_radix;
- error (_("Nonsense input radix ``decimal %u''; input radix unchanged."),
- radix);
- }
- input_radix_1 = input_radix = radix;
+ error (_("Nonsense input radix ``decimal %u''; input radix unchanged."),
+ radix);
+ input_radix = radix;
if (from_tty)
{
printf_filtered (_("Input radix now set to "
@@ -2996,16 +2988,10 @@ set_input_radix_1 (int from_tty, unsigned radix)
}
}
-/* The 'set output-radix' command writes to this auxiliary variable.
- If the requested radix is valid, OUTPUT_RADIX is updated,
- otherwise, it is left unchanged. */
-
-static unsigned output_radix_1 = 10;
-
static void
set_output_radix (char *args, int from_tty, struct cmd_list_element *c)
{
- set_output_radix_1 (from_tty, output_radix_1);
+ set_output_radix_1 (from_tty, output_radix);
}
static void
@@ -3025,12 +3011,11 @@ set_output_radix_1 (int from_tty, unsigned radix)
user_print_options.output_format = 'o'; /* octal */
break;
default:
- output_radix_1 = output_radix;
error (_("Unsupported output radix ``decimal %u''; "
"output radix unchanged."),
radix);
}
- output_radix_1 = output_radix = radix;
+ output_radix = radix;
if (from_tty)
{
printf_filtered (_("Output radix now set to "
@@ -3208,7 +3193,7 @@ Show printing of symbol names when printing pointers."),
show_symbol_print,
&setprintlist, &showprintlist);
- add_setshow_zuinteger_cmd ("input-radix", class_support, &input_radix_1,
+ add_setshow_zuinteger_cmd ("input-radix", class_support, &input_radix,
_("\
Set default input radix for entering numbers."), _("\
Show default input radix for entering numbers."), NULL,
@@ -3216,7 +3201,7 @@ Show default input radix for entering numbers."), NULL,
show_input_radix,
&setlist, &showlist);
- add_setshow_zuinteger_cmd ("output-radix", class_support, &output_radix_1,
+ add_setshow_zuinteger_cmd ("output-radix", class_support, &output_radix,
_("\
Set default output radix for printing of values."), _("\
Show default output radix for printing of values."), NULL,
@@ -987,11 +987,7 @@ set_max_value_size (char *args, int from_tty,
gdb_assert (max_value_size == -1 || max_value_size >= 0);
if (max_value_size > -1 && max_value_size < MIN_VALUE_FOR_MAX_VALUE_SIZE)
- {
- max_value_size = MIN_VALUE_FOR_MAX_VALUE_SIZE;
- error (_("max-value-size set too low, increasing to %d bytes"),
- max_value_size);
- }
+ error (_("max-value-size %d bytes is too low"), max_value_size);
}
/* Implement the "show max-value-size" command. */