diff options
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/breakpoint.c | 3 | ||||
-rw-r--r-- | gdb/cli-out.c | 7 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.opt/inline-break.exp | 36 |
5 files changed, 52 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fd9c168..66fe9c9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2018-11-20 Andrew Burgess <andrew.burgess@embecosm.com> + + * breakpoint.c (print_one_breakpoint_location): Reduce whitespace, + and remove insertion of extra spaces in GDB's output. + * cli-out.c (cli_ui_out::do_field_fmt): Update header comment. + Layout field into a temporary buffer, and then output it as a + string field. + 2018-11-20 Philippe Waroquiers <philippe.waroquiers@skynet.be> * NEWS: Document the language choice done by diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3d25434..6bd456e 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -6058,16 +6058,13 @@ print_one_breakpoint_location (struct breakpoint *b, else uiout->field_string ("disp", bpdisp_text (b->disposition)); - /* 4 */ annotate_field (3); if (part_of_multiple) uiout->field_string ("enabled", loc->enabled ? "y" : "n"); else uiout->field_fmt ("enabled", "%c", bpenables[(int) b->enable_state]); - uiout->spaces (2); - /* 5 and 6 */ if (b->ops != NULL && b->ops->print_one != NULL) { diff --git a/gdb/cli-out.c b/gdb/cli-out.c index ad0a34e..9ffd6f0 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -165,7 +165,7 @@ cli_ui_out::do_field_string (int fldno, int width, ui_align align, field_separator (); } -/* This is the only field function that does not align. */ +/* Output field containing ARGS using printf formatting in FORMAT. */ void cli_ui_out::do_field_fmt (int fldno, int width, ui_align align, @@ -175,10 +175,9 @@ cli_ui_out::do_field_fmt (int fldno, int width, ui_align align, if (m_suppress_output) return; - vfprintf_filtered (m_streams.back (), format, args); + std::string str = string_vprintf (format, args); - if (align != ui_noalign) - field_separator (); + do_field_string (fldno, width, align, fldname, str.c_str ()); } void diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8814cd3..093603a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-20 Andrew Burgess <andrew.burgess@embecosm.com> + + * gdb.opt/inline-break.exp: Add test that info breakpoint output + is correctly aligned. + 2018-11-20 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.ada/info_auto_lang.exp: New testcase. diff --git a/gdb/testsuite/gdb.opt/inline-break.exp b/gdb/testsuite/gdb.opt/inline-break.exp index aed38ed..06a0861 100644 --- a/gdb/testsuite/gdb.opt/inline-break.exp +++ b/gdb/testsuite/gdb.opt/inline-break.exp @@ -304,4 +304,40 @@ with_test_prefix "address" { "breakpoint hit presents stop at inlined function" } +with_test_prefix "check alignment" { + + clean_restart $binfile + + if {![runto main]} { + untested "could not run to main" + continue + } + + gdb_test "break func4b" \ + "Breakpoint.*at.*func4b.*\\(2 locations\\)" + + set expected_line_length -1 + gdb_test_multiple "info break \$bpnum" "xxxx" { + -re "Num Type Disp Enb Address What\r\n" { + exp_continue + } + -re "($decimal \[^\r\n\]+)<MULTIPLE>\[^\r\n\]+\r\n" { + if {$expected_line_length != -1} { + fail "multiple header lines seen" + } + set expected_line_length [string length $expect_out(1,string)] + exp_continue + } + -re "($decimal\.($decimal) \[^\r\n\]+)$hex\[^\r\n\]+\r\n" { + set len [string length $expect_out(1,string)] + set loc $expect_out(2,string) + gdb_assert {$len == $expected_line_length} \ + "check alignment of location line $loc" + exp_continue + } + -re "$gdb_prompt $" { + } + } +} + unset -nocomplain results |