gdbpy_ref<> result;
*out_value = NULL;
- TRY
+ try
{
if (!PyObject_HasAttr (printer, gdbpy_to_string_cst))
result = gdbpy_ref<>::new_reference (Py_None);
}
}
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
}
- END_CATCH
return result;
}
error (_("Error while executing Python code."));
}
else
- common_val_print (value, stream, recurse + 1, options, language);
+ {
+ /* 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)
if (printer == Py_None)
return EXT_LANG_RC_NOP;
+ if (val_print_check_max_depth (stream, recurse, options, language))
+ return EXT_LANG_RC_OK;
+
/* If we are printing a map, we want some special formatting. */
gdb::unique_xmalloc_ptr<char> hint (gdbpy_get_display_hint (printer.get ()));
gdbpy_ref<>
gdbpy_get_varobj_pretty_printer (struct value *value)
{
- TRY
+ try
{
value = value_copy (value);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
GDB_PY_HANDLE_EXCEPTION (except);
}
- END_CATCH
gdbpy_ref<> val_obj (value_to_value_object (value));
if (val_obj == NULL)