mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
Add switch to control compact/verbose printing of capabilities
Add a new option set/show "print compact-capabilities" that default to "on". This makes GDB default to printing capabilities in compact format, the CHERI format. gdb/ChangeLog: 2020-12-30 Luis Machado <luis.machado@arm.com> * valprint.c (user_print_options): Initialize compact_capabilities. (show_print_compact_capabilities): New function. (generic_value_print_capability): Use compact_capabilities option. (value_print_option_defs): New compact_capabilities option. * valprint.h (value_print_options) <compact_capabilities>: New member variable.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2020-12-30 Luis Machado <luis.machado@arm.com>
|
||||
|
||||
* valprint.c (user_print_options): Initialize compact_capabilities.
|
||||
(show_print_compact_capabilities): New function.
|
||||
(generic_value_print_capability): Use compact_capabilities option.
|
||||
(value_print_option_defs): New compact_capabilities option.
|
||||
* valprint.h (value_print_options) <compact_capabilities>: New member
|
||||
variable.
|
||||
|
||||
2020-11-11 Luis Machado <luis.machado@arm.com>
|
||||
|
||||
* aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Don't return LR
|
||||
|
||||
@@ -114,6 +114,7 @@ struct value_print_options user_print_options =
|
||||
0, /* format */
|
||||
0, /* stop_print_at_null */
|
||||
0, /* print_array_indexes */
|
||||
1, /* compact_capabilities */
|
||||
0, /* deref_ref */
|
||||
1, /* static_field_print */
|
||||
1, /* pascal_static_field_print */
|
||||
@@ -193,6 +194,18 @@ show_print_array_indexes (struct ui_file *file, int from_tty,
|
||||
fprintf_filtered (file, _("Printing of array indexes is %s.\n"), value);
|
||||
}
|
||||
|
||||
/* By default we print capabilities in compact form. This may be changed to
|
||||
print them in a more verbose format. */
|
||||
|
||||
static void
|
||||
show_print_compact_capabilities (struct ui_file *file, int from_tty,
|
||||
struct cmd_list_element *c,
|
||||
const char *value)
|
||||
{
|
||||
fprintf_filtered (file, _("Printing of compact capabilities is %s.\n"),
|
||||
value);
|
||||
}
|
||||
|
||||
/* Print repeat counts if there are more than this many repetitions of an
|
||||
element in an array. Referenced by the low level language dependent
|
||||
print routines. */
|
||||
@@ -513,7 +526,8 @@ generic_value_print_capability (struct value *val, struct ui_file *stream,
|
||||
uint128_t dummy_cap;
|
||||
memcpy (&dummy_cap, contents, length);
|
||||
capability cap (dummy_cap, tag);
|
||||
fprintf_filtered (stream, "%s ", cap.to_str (true).c_str ());
|
||||
fprintf_filtered (stream, "%s ",
|
||||
cap.to_str (options->compact_capabilities).c_str ());
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -3053,6 +3067,15 @@ static const gdb::option::option_def value_print_option_defs[] = {
|
||||
NULL, /* help_doc */
|
||||
},
|
||||
|
||||
boolean_option_def {
|
||||
"compact-capabilities",
|
||||
[] (value_print_options *opt) { return &opt->compact_capabilities; },
|
||||
show_print_compact_capabilities, /* show_cmd_cb */
|
||||
N_("Set compact printing of capabilities."),
|
||||
N_("Show compact printing of capabilities."),
|
||||
NULL, /* help_doc */
|
||||
},
|
||||
|
||||
uinteger_option_def {
|
||||
"elements",
|
||||
[] (value_print_options *opt) { return &opt->print_max; },
|
||||
|
||||
@@ -72,6 +72,9 @@ struct value_print_options
|
||||
an array. */
|
||||
bool print_array_indexes;
|
||||
|
||||
/* True if capabilities should be displayed in a compact form. */
|
||||
bool compact_capabilities;
|
||||
|
||||
/* If true, then dereference references, otherwise just print
|
||||
them like pointers. */
|
||||
bool deref_ref;
|
||||
|
||||
Reference in New Issue
Block a user