This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Change ptype/o to print bit offset


> From: Tom Tromey <tromey@adacore.com>
> Cc: Tom Tromey <tromey@adacore.com>
> Date: Mon, 29 Apr 2019 12:31:05 -0600
> 
> With this patch, the output is now:
> 
>     (gdb) ptype/o struct outer
>     /* offset    |  size */  type = struct outer {
>     /*    0: 0   |     1 */    unsigned char o : 3;
>     /* XXX  5-bit hole  */
>     /*    1      |     8 */    struct inner {
>     /*    1      |     4 */        unsigned int x;
>     /*    5: 0   |     4 */        unsigned int y : 3;
>     /*    5: 3   |     4 */        unsigned int z : 3;
>     /* XXX  2-bit padding  */
>     /* XXX  3-byte padding */

This loses information, because now the bits part is just a trivial
conversion of the field size in the declaration.  The current display
shows something that cannot be trivially gleaned by looking at the
bitfield sizes.

I'm not objecting to the change, I'm just saying we lose something
here.

> gdb/doc/ChangeLog
> 2019-04-29  Tom Tromey  <tromey@adacore.com>
> 
> 	* gdb.texinfo (Symbols): Document change to ptype/o.

This seems to be a mechanical change, so OK.

Do we need to call this out in NEWS?

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]