Enum values rename as well. All uses updated.
* valprint.h (value_print_options): Rename member pretty to
pretty format. Rename member prettyprint_arrays to
prettyformat_arrays. Rename member prettyprint_structs to
prettyformat_structs. All uses updated.
(get_no_prettyformat_print_options): Renamed from
get_raw_print_options.
* valprint.c (get_no_prettyformat_print_options): Renamed from
get_raw_print_options. All callers updated.
(show_prettyformat_structs): Renamed from show_prettyprint_structs.
All callers updated.
(show_prettyformat_arrays): Renamed from show_prettyprint_arrays.
All callers updated.
(_initialize_valprint): Improve help text for "set print pretty" and
"set print arrays".
testsuite/
* gdb.base/default.exp: Update expected output of "show print array"
and "show print pretty".
+2013-07-09 Doug Evans <dje@google.com>
+
+ * defs.h (enum val_prettyformat): Renamed from val_prettyprint.
+ Enum values rename as well. All uses updated.
+ * valprint.h (value_print_options): Rename member pretty to
+ pretty format. Rename member prettyprint_arrays to
+ prettyformat_arrays. Rename member prettyprint_structs to
+ prettyformat_structs. All uses updated.
+ (get_no_prettyformat_print_options): Renamed from
+ get_raw_print_options.
+ * valprint.c (get_no_prettyformat_print_options): Renamed from
+ get_raw_print_options. All callers updated.
+ (show_prettyformat_structs): Renamed from show_prettyprint_structs.
+ All callers updated.
+ (show_prettyformat_arrays): Renamed from show_prettyprint_arrays.
+ All callers updated.
+ (_initialize_valprint): Improve help text for "set print pretty" and
+ "set print arrays".
+
2013-07-09 Andrew Burgess <aburgess@broadcom.com>
* value.c (value_bits_valid): Revert previous change, and change
if (i != 0)
{
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
{
fprintf_filtered (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
{
if (j > i0)
{
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
{
fprintf_filtered (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* If requested, look for the first null char and only print
if (print_field_values (type, valaddr, offset,
stream, recurse, val, options,
- 0, type, offset) != 0 && options->pretty)
+ 0, type, offset) != 0 && options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
fprintf_filtered (stream, ", ");
comma_needed = 1;
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
eltlen = TYPE_LENGTH (elttype);
len = high_bound - low_bound + 1;
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
vt_val = value_at (wtype, vt_address);
common_val_print (vt_val, stream, recurse + 1,
options, current_language);
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
{
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
fields_seen = 1;
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
}
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
/* Now do the printing. */
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
extern unsigned input_radix;
extern unsigned output_radix;
-/* Possibilities for prettyprint parameters to routines which print
+/* Possibilities for prettyformat parameters to routines which print
things. Like enum language, this should be in value.h, but needs
to be here for the same reason. FIXME: If we can eliminate this
as an arg to LA_VAL_PRINT, then we can probably move it back to
value.h. */
-enum val_prettyprint
+enum val_prettyformat
{
- Val_no_prettyprint = 0,
- Val_prettyprint,
+ Val_no_prettyformat = 0,
+ Val_prettyformat,
/* Use the default setting which the user has specified. */
- Val_pretty_default
+ Val_prettyformat_default
};
/* Optional native machine support. Non-native (and possibly pure
{
struct value_print_options opts;
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
(*pos) += 3;
value_print (value_from_longest (exp->elts[pc + 1].type,
exp->elts[pc + 2].longconst),
{
struct value_print_options opts;
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
(*pos) += 3;
value_print (value_from_double (exp->elts[pc + 1].type,
exp->elts[pc + 2].doubleconst),
(*pos) += 4;
val = value_at_lazy (exp->elts[pc + 1].type,
(CORE_ADDR) exp->elts[pc + 5].longconst);
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
value_print (val, stream, &opts);
}
else
ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
record_latest_value (value));
ui_out_text (uiout, " = ");
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
value_print (value, stb, &opts);
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
boffset = 0;
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * (recurse + 1), stream);
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
{
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
fields_seen = 1;
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
annotate_field_end ();
}
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
if (TYPE_LENGTH (type) > 0)
{
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* For an array of chars, print with string syntax. */
if (TYPE_LENGTH (type) == 1 &&
{
elttype = check_typedef (TYPE_TARGET_TYPE (type));
len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype);
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* For an array of chars, print with string syntax. */
if (TYPE_LENGTH (elttype) == 1 &&
{
struct value_print_options opts;
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
common_val_print (arg->val, stb, 0, &opts,
language_def (SYMBOL_LANGUAGE (arg->sym)));
{
struct value_print_options opts;
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
common_val_print (val, stb, 0, &opts, current_language);
ui_out_field_stream (uiout, "value", stb);
{
struct value_print_options opts;
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
common_val_print (val, stb, 0, &opts, current_language);
ui_out_field_stream (uiout, "value", stb);
len = high_bound - low_bound + 1;
elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
vt_val = value_at (wtype, vt_address);
common_val_print (vt_val, stream, recurse + 1, options,
current_language);
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
{
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
fields_seen = 1;
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
dont_print_statmem_obstack = tmp_obstack;
}
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
base_valaddr = valaddr;
}
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
make_cleanup_py_decref (iter);
- /* Use the prettyprint_arrays option if we are printing an array,
+ /* Use the prettyformat_arrays option if we are printing an array,
and the pretty option otherwise. */
if (is_array)
- pretty = options->prettyprint_arrays;
+ pretty = options->prettyformat_arrays;
else
{
- if (options->pretty == Val_prettyprint)
+ if (options->prettyformat == Val_prettyformat)
pretty = 1;
else
- pretty = options->prettyprint_structs;
+ pretty = options->prettyformat_structs;
}
/* Manufacture a dummy Python frame to work around Python 2.4 bug,
else
language = current_language;
- get_raw_print_options (&opts);
+ get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
/* True in "summary" mode, false otherwise. */
+2013-07-09 Doug Evans <dje@google.com>
+
+ * gdb.base/default.exp: Update expected output of "show print array"
+ and "show print pretty".
+
2013-07-08 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb.threads/wp-replication.exp: Stop counting available hardware
#test show print address
gdb_test "show print address" "Printing of addresses is on." "show print address"
#test show print array
-gdb_test "show print array" "Prettyprinting of arrays is on." "show print array"
+gdb_test "show print array" "Pretty formatting of arrays is on." "show print array"
#test show print asm-demangle
gdb_test "show print asm-demangle" "Demangling of C\[+\]+/ObjC names in disassembly listings is on." "show print asm-demangle"
#test show print demangle
#test show print object
gdb_test "show print object" "Printing of object's derived type based on vtable info is on." "show print object"
#test show print pretty
-gdb_test "show print pretty" "Prettyprinting of structures is on." "show print pretty"
+gdb_test "show print pretty" "Pretty formatting of structures is on." "show print pretty"
#test show print sevenbit-strings
gdb_test "show print sevenbit-strings" "Printing of 8-bit characters in strings as .nnn is on." "show print sevenbit-strings"
#test show print union
struct value_print_options user_print_options =
{
- Val_pretty_default, /* pretty */
- 0, /* prettyprint_arrays */
- 0, /* prettyprint_structs */
+ Val_prettyformat_default, /* prettyformat */
+ 0, /* prettyformat_arrays */
+ 0, /* prettyformat_structs */
0, /* vtblprint */
1, /* unionprint */
1, /* addressprint */
}
/* Initialize *OPTS to be a copy of the user print options, but with
- pretty-printing disabled. */
+ pretty-formatting disabled. */
void
-get_raw_print_options (struct value_print_options *opts)
+get_no_prettyformat_print_options (struct value_print_options *opts)
{
*opts = user_print_options;
- opts->pretty = Val_no_prettyprint;
+ opts->prettyformat = Val_no_prettyformat;
}
/* Initialize *OPTS to be a copy of the user print options, but using
/* Controls pretty printing of structures. */
static void
-show_prettyprint_structs (struct ui_file *file, int from_tty,
+show_prettyformat_structs (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("Prettyprinting of structures is %s.\n"), value);
+ fprintf_filtered (file, _("Pretty formatting of structures is %s.\n"), value);
}
/* Controls pretty printing of arrays. */
static void
-show_prettyprint_arrays (struct ui_file *file, int from_tty,
+show_prettyformat_arrays (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("Prettyprinting of arrays is %s.\n"), value);
+ fprintf_filtered (file, _("Pretty formatting of arrays is %s.\n"), value);
}
/* If nonzero, causes unions inside structures or other unions to be
if (!get_array_bounds (type, &low_bound, &high_bound))
error (_("Could not determine the array high bound"));
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
struct value_print_options local_opts = *options;
struct type *real_type = check_typedef (type);
- if (local_opts.pretty == Val_pretty_default)
- local_opts.pretty = (local_opts.prettyprint_structs
- ? Val_prettyprint : Val_no_prettyprint);
+ if (local_opts.prettyformat == Val_prettyformat_default)
+ local_opts.prettyformat = (local_opts.prettyformat_structs
+ ? Val_prettyformat : Val_no_prettyformat);
QUIT;
{
if (i != 0)
{
- if (options->prettyprint_arrays)
+ if (options->prettyformat_arrays)
{
fprintf_filtered (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
&setprintlist, &showprintlist);
add_setshow_boolean_cmd ("pretty", class_support,
- &user_print_options.prettyprint_structs, _("\
-Set prettyprinting of structures."), _("\
-Show prettyprinting of structures."), NULL,
+ &user_print_options.prettyformat_structs, _("\
+Set pretty formatting of structures."), _("\
+Show pretty formatting of structures."), NULL,
NULL,
- show_prettyprint_structs,
+ show_prettyformat_structs,
&setprintlist, &showprintlist);
add_setshow_boolean_cmd ("union", class_support,
&setprintlist, &showprintlist);
add_setshow_boolean_cmd ("array", class_support,
- &user_print_options.prettyprint_arrays, _("\
-Set prettyprinting of arrays."), _("\
-Show prettyprinting of arrays."), NULL,
+ &user_print_options.prettyformat_arrays, _("\
+Set pretty formatting of arrays."), _("\
+Show pretty formatting of arrays."), NULL,
NULL,
- show_prettyprint_arrays,
+ show_prettyformat_arrays,
&setprintlist, &showprintlist);
add_setshow_boolean_cmd ("address", class_support,
functions. */
struct value_print_options
{
- /* Pretty-printing control. */
- enum val_prettyprint pretty;
+ /* Pretty-formatting control. */
+ enum val_prettyformat prettyformat;
- /* Controls pretty printing of arrays. */
- int prettyprint_arrays;
+ /* Controls pretty formatting of arrays. */
+ int prettyformat_arrays;
- /* Controls pretty printing of structures. */
- int prettyprint_structs;
+ /* Controls pretty formatting of structures. */
+ int prettyformat_structs;
/* Controls printing of virtual tables. */
int vtblprint;
extern void get_user_print_options (struct value_print_options *opts);
/* Initialize *OPTS to be a copy of the user print options, but with
- pretty-printing disabled. */
-extern void get_raw_print_options (struct value_print_options *opts);
+ pretty-formatting disabled. */
+extern void get_no_prettyformat_print_options (struct value_print_options *);
/* Initialize *OPTS to be a copy of the user print options, but using
FORMAT as the formatting option. */
extern void value_print_array_elements (struct value *val,
struct ui_file *stream, int format,
- enum val_prettyprint pretty);
+ enum val_prettyformat pretty);
extern struct value *value_release_to_mark (struct value *mark);