Fix ptype/o bug with "<no data fields>"
authorTom Tromey <tom@tromey.com>
Fri, 23 Apr 2021 01:39:56 +0000 (19:39 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 23 Apr 2021 01:39:56 +0000 (19:39 -0600)
commit432ce4cf6800a3693656fde1306d83ce767e2b2a
treebdcee743c2655bfc754a470e1e64b500d3517239
parentae6a3f81a178760dc2e1dafcb680b69dc4be9a92
Fix ptype/o bug with "<no data fields>"

I noticed that when using ptype/o, the "<no data fields>" text that
may be emitted is indented incorrectly.  This patch fixes the bug and
adds a new test case.

I also removed a stray backslash from ptype-offsets.exp that I noticed
while writing the test.  This seemed too trivial to warrant a separate
patch.

gdb/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

* c-typeprint.c (c_type_print_base_struct_union): Use
print_spaces_filtered_with_print_options.

gdb/testsuite/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

* gdb.base/ptype-offsets.cc (struct empty_member): New.
(main): Use empty_member.
* gdb.base/ptype-offsets.exp: Add new test.
gdb/ChangeLog
gdb/c-typeprint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/ptype-offsets.cc
gdb/testsuite/gdb.base/ptype-offsets.exp