This is the mail archive of the gdb-prs@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]

[Bug tui/21216] [8.0 regression]: TUI line breaks regression


https://sourceware.org/bugzilla/show_bug.cgi?id=21216

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9753a2f6d74dc92d2ad94993a5479ee0edbc6887

commit 9753a2f6d74dc92d2ad94993a5479ee0edbc6887
Author: Pedro Alves <palves@redhat.com>
Date:   Wed Mar 8 00:14:59 2017 +0000

    Fix PR tui/21216: TUI line breaks regression

    Commit d7e747318f4d04 ("Eliminate make_cleanup_ui_file_delete / make
    ui_file a class hierarchy") regressed the TUI's command window.
    Newlines miss doing a "carriage return", resulting in output like:

    ~~~~~~~~~~~~~~~~~~
    (gdb) helpList of classes of commands:

                                          aliases -- Aliases of other commands
                                                                             
breakpoints -- Making program stop at certain points
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Before the commit mentioned above, the default ui_file->to_write
    implementation had a hack that would defer into the ui_file->to_fputs
    method.  The TUI's ui_file did not implement the to_write method, so
    all writes would end up going to the ncurses window via tui_file_fputs
    -> tui_puts.

    After the commit above, the hack is gone, but the TUI's ui_file still
    does not implement the ui_file::write method.  Since tui_file inherits
    from stdio_file, writing to a tui_file ends up doing fwrite on the
    FILE stream the TUI is "associated" with, via stdio_file::write,
    instead of writing to the ncurses window.

    The fix is to have tui_file override the "write" method.

    New test included.

    gdb/ChangeLog:
    2017-03-08  Pedro Alves  <palves@redhat.com>

        PR tui/21216
        * tui/tui-file.c (tui_file::write): New.
        * tui/tui-file.h (tui_file): Override "write".
        * tui/tui-io.c (do_tui_putc, update_start_line): New functions,
        factored out from ...
        (tui_puts): ... here.
        (tui_putc): Use them.
        (tui_write): New function.
        * tui/tui-io.h (tui_write): Declare.

    gdb/testsuite/ChangeLog:
    2017-03-08  Pedro Alves  <palves@redhat.com>

        PR tui/21216
        * gdb.tui/tui-nl-filtered-output.exp: New file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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