This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v6 2/2] Implement pahole-like 'ptype /o' option
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: gdb-patches at sourceware dot org, tom at tromey dot com, simon dot marchi at ericsson dot com, palves at redhat dot com, keiths at redhat dot com
- Date: Thu, 14 Dec 2017 18:29:26 +0200
- Subject: Re: [PATCH v6 2/2] Implement pahole-like 'ptype /o' option
- Authentication-results: sourceware.org; auth=none
- References: <20171121160709.23248-1-sergiodj@redhat.com> <20171214024816.29629-1-sergiodj@redhat.com> <20171214024816.29629-3-sergiodj@redhat.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Sergio Durigan Junior <sergiodj@redhat.com>
> Cc: Tom Tromey <tom@tromey.com>,
> Eli Zaretskii <eliz@gnu.org>,
> Simon Marchi <simon.marchi@ericsson.com>,
> Pedro Alves <palves@redhat.com>,
> Keith Seitz <keiths@redhat.com>,
> Sergio Durigan Junior <sergiodj@redhat.com>
> Date: Wed, 13 Dec 2017 21:48:16 -0500
>
> gdb/ChangeLog:
> yyyy-mm-dd Sergio Durigan Junior <sergiodj@redhat.com>
> Pedro Alves <palves@redhat.com>
>
> PR cli/16224
> * NEWS (Changes since GDB 8.0): Mention new '/o' flag.
> * c-typeprint.c (OFFSET_SPC_LEN): New define.
> (c_type_print_varspec_prefix): New argument 'struct
> print_offset_data *'.
> (c_type_print_base_1): New function and prototype.
> (c_print_type_1): New function, with code from 'c_print_type'.
> (c_print_type): Use 'c_print_type_1'.
> (c_type_print_varspec_prefix): New argument 'struct
> print_offset_data *'. Use it. Call 'c_type_print_base_1'
> instead of 'c_print_type_base'.
> (print_spaces_filtered_with_print_options): New function.
> (output_access_specifier): Take new argument FLAGS. Modify
> function to call 'print_spaces_filtered_with_print_options'.
> (c_print_type_vtable_offset_marker): New function.
> (c_print_type_union_field_offset): New function.
> (c_print_type_struct_field_offset): New function.
> (c_type_print_base_struct_union): New argument 'struct
> print_offset_data *'. Print offsets and sizes for
> struct/union/class fields.
> * typeprint.c (const struct type_print_options
> type_print_raw_options): Initialize 'print_offsets'.
> (static struct type_print_options default_ptype_flags):
> Likewise.
> (struct print_offset_data print_offset_default_data): New
> variable.
> (whatis_exp): Handle '/o' option.
> (_initialize_typeprint): Add '/o' flag to ptype's help.
> * typeprint.h (struct print_offset_data): New struct.
> (struct type_print_options) <print_offsets>: New field.
>
> gdb/testsuite/ChangeLog:
> yyyy-mm-dd Sergio Durigan Junior <sergiodj@redhat.com>
>
> PR cli/16224
> * gdb.base/ptype-offsets.cc: New file.
> * gdb.base/ptype-offsets.exp: New file.
>
> gdb/doc/ChangeLog:
> yyyy-mm-dd Sergio Durigan Junior <sergiodj@redhat.com>
>
> PR cli/16224
> * gdb.texinfo (ptype): Add documentation for new flag '/o'.
OK for the documentation parts, thanks.