aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/valprint.h')
-rw-r--r--gdb/valprint.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/gdb/valprint.h b/gdb/valprint.h
index 68382a1..cf5e2f2 100644
--- a/gdb/valprint.h
+++ b/gdb/valprint.h
@@ -51,12 +51,15 @@ struct value_print_options
in its vtables. */
bool objectprint;
- /* Maximum number of chars to print for a string pointer value or vector
- contents, or UINT_MAX for no limit. Note that "set print elements 0"
- stores UINT_MAX in print_max, which displays in a show command as
- "unlimited". */
+ /* Maximum number of elements to print for vector contents, or UINT_MAX
+ for no limit. Note that "set print elements 0" stores UINT_MAX in
+ print_max, which displays in a show command as "unlimited". */
unsigned int print_max;
+ /* Maximum number of string chars to print for a string pointer value,
+ zero if to follow the value of print_max, or UINT_MAX for no limit. */
+ unsigned int print_max_chars;
+
/* Print repeat counts if there are more than this many repetitions
of an element in an array. */
unsigned int repeat_count_threshold;
@@ -105,6 +108,21 @@ struct value_print_options
int max_depth;
};
+/* The value to use for `print_max_chars' to follow `print_max'. */
+#define PRINT_MAX_CHARS_ELEMENTS 0
+
+/* The value to use for `print_max_chars' for no limit. */
+#define PRINT_MAX_CHARS_UNLIMITED UINT_MAX
+
+/* Return the character count limit for printing strings. */
+
+static inline unsigned int
+get_print_max_chars (const struct value_print_options *options)
+{
+ return (options->print_max_chars != PRINT_MAX_CHARS_ELEMENTS
+ ? options->print_max_chars : options->print_max);
+}
+
/* Create an option_def_group for the value_print options, with OPTS
as context. */
extern gdb::option::option_def_group make_value_print_options_def_group