/* GDB/Scheme pretty-printing.
- Copyright (C) 2008-2019 Free Software Foundation, Inc.
+ Copyright (C) 2008-2020 Free Software Foundation, Inc.
This file is part of GDB.
ppscm_print_exception_unless_memory_error (except_scm, stream);
break;
}
- common_val_print (value, stream, recurse + 1, options, language);
+ else
+ {
+ /* When printing the key of a map we allow one additional
+ level of depth. This means the key will print before the
+ value does. */
+ struct value_print_options opt = *options;
+ if (is_map && i % 2 == 0
+ && opt.max_depth != -1
+ && opt.max_depth < INT_MAX)
+ ++opt.max_depth;
+ common_val_print (value, stream, recurse + 1, &opt, language);
+ }
}
if (is_map && i % 2 == 0)
}
gdb_assert (ppscm_is_pretty_printer_worker (printer));
+ if (val_print_check_max_depth (stream, recurse, options, language))
+ {
+ result = EXT_LANG_RC_OK;
+ goto done;
+ }
+
/* If we are printing a map, we want some special formatting. */
hint = ppscm_get_display_hint_enum (printer);
if (hint == HINT_ERROR)