Move ptype/o printing code to typeprint.c
This moves the hole-printing support code for ptype/o from
c-typeprint.c to be methods on print_offset_data. This allows the
code to be used from non-C languages.
gdb/ChangeLog
2018-06-26 Tom Tromey <tom@tromey.com>
* typeprint.h (struct print_offset_data) <update, finish,
maybe_print_hole>: New methods.
<indentation>: New constant.
* typeprint.c (print_offset_data::indentation): Define.
(print_offset_data::maybe_print_hole, print_offset_data::update)
(print_offset_data::finish): Move from c-typeprint.c and rename.
* c-typeprint.c (OFFSET_SPC_LEN): Remove.
(print_spaces_filtered_with_print_options): Update.
(c_print_type_union_field_offset, maybe_print_hole)
(c_print_type_struct_field_offset): Move to typeprint.c and
rename.
(c_type_print_base_struct_union): Update.