Fix ptype/o comment formatting
authorTom Tromey <tromey@adacore.com>
Mon, 29 Apr 2019 18:11:52 +0000 (12:11 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 8 May 2019 16:15:51 +0000 (10:15 -0600)
commit844333e24966817fe4d622494a75c8ae0acdb91f
tree2343113e735702b3eea6443eb81bb69bdb707fd4
parent988915ee7b880ff059f849893b71118d9bd2c4fc
Fix ptype/o comment formatting

I noticed that ptype/o will print:

    /*    3: 3   |     1 */    signed char a4 : 2;
    /* XXX  3-bit hole  */

That is, "*/" at the end of the "hole" message does not line up with
the other comment ends.  I thought it would be a bit nicer if this did
line up, so I fixed it.  Then, to my surprise, I found that I could
not make ptype-offsets.exp fail.

I still am not sure why it doesn't fail, but changing the tests to use
string_to_regexp and changing the quoting helped.  This in turn showed
that some of the existing test cases were wrong, so I've also updated
them here.

gdb/ChangeLog
2019-05-08  Tom Tromey  <tromey@adacore.com>

* typeprint.c (print_offset_data::maybe_print_hole): Add extra
padding at end of comment.

gdb/testsuite/ChangeLog
2019-05-08  Tom Tromey  <tromey@adacore.com>

* gdb.base/ptype-offsets.exp: Use string_to_regexp.  Fix test
cases.
* gdb.base/ptype-offsets.cc (struct abc) <my_int_type>: Now
"short".
gdb/ChangeLog
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/ptype-offsets.cc
gdb/testsuite/gdb.base/ptype-offsets.exp
gdb/typeprint.c
This page took 0.025318 seconds and 4 git commands to generate.