gdb: don't print trailing space after base classes in pretty format
After working on the previous patch, the formatting of the values
printed in test gdb.cp/anon-struct-with-base.exp with "print pretty on"
looks wrong to me. I think that with "print pretty on", the "<No data
fields>" string should be on its own line. The closing curly brace
should also be on its own line.
As an exception, when a type has absolutely nothing in it, we print
this, which seem reasonable:
<base_no_data> = {<No data fields>},
Concretely, this patch changes this:
$ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.cp/anon-struct-with-base/anon-struct-with-base -ex "with print pretty -- p v_no_data_base_data" -ex "with print pretty -- p v_no_data_base_no_data" -batch
$1 = {
<base_data> = {
a = 3
}, <No data fields>}
$2 = {
<base_no_data> = {<No data fields>}, <No data fields>}
to this:
$ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.cp/anon-struct-with-base/anon-struct-with-base -ex "with print pretty -- p v_no_data_base_data" -ex "with print pretty -- p v_no_data_base_no_data" -batch
$1 = {
<base_data> = {
a = 3
},
<No data fields>
}
$2 = {
<base_no_data> = {<No data fields>},
<No data fields>
}
Finally, this change also gets rid of some unnecessary trailing spaces
printed after base classes. This is not really visible for users, but
it is visible in the test changes.
Change-Id: Ia1c28c8bf2c6a8442c2cb610e06058e4dac030b9
Approved-By: Kevin Buettner <kevinb@redhat.com>
2 files changed