Base support for <unavailable> value contents.
gdb/ * value.h (value_bytes_available): Declare. (mark_value_bytes_unavailable): Declare. * value.c (struct range): New struct. (range_s): New typedef. (ranges_overlap): New function. (range_lessthan): New function. (ranges_contain_p): New function. (struct value) <unavailable>: New field. (value_bytes_available): New function. (mark_value_bytes_unavailable): New function. (require_not_optimized_out): Constify parameter. (require_available): New function. (value_contents_all, value_contents): Require all bytes be available. (value_free): Free `unavailable'. (value_copy): Copy `unavailable'. * valprint.h (val_print_unavailable): Declare. * valprint.c (valprint_check_validity): Rename `offset' parameter to `embedded_offset'. If printing a scalar, check whether the value chunk is available. (val_print_unavailable): New. (val_print_scalar_formatted): Check whether the value is available. * python/py-prettyprint.c (apply_val_pretty_printer): Refuse pretty-printing unavailable values.
This commit is contained in:
parent
498cd2a0fd
commit
4e07d55ffb
6 changed files with 364 additions and 5 deletions
|
@ -690,6 +690,11 @@ apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
|
|||
struct cleanup *cleanups;
|
||||
int result = 0;
|
||||
enum string_repr_result print_result;
|
||||
|
||||
/* No pretty-printer support for unavailable values. */
|
||||
if (!value_bytes_available (val, embedded_offset, TYPE_LENGTH (type)))
|
||||
return 0;
|
||||
|
||||
cleanups = ensure_python_env (gdbarch, language);
|
||||
|
||||
/* Instantiate the printer. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue