Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: GDB ui word wrapping broken/interferes with 'set style'  ?
Date: Mon, 07 Jan 2019 16:56:00 -0000	[thread overview]
Message-ID: <1546880163.1926.22.camel@skynet.be> (raw)
In-Reply-To: <878szw1q2t.fsf@tromey.com>

On Mon, 2019-01-07 at 07:48 -0700, Tom Tromey wrote:
> > > > > > "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
> 
> Philippe> Thanks for the investigations.  If you deem it useful, I can do
> Philippe> some manual validation of the patch, waiting for the test case and/or
> Philippe> unit test.
> 
> It's in crude form on my github, branch submit/fix-pager.
> 
> Tom
Seems to work much better, but I still found 2 strange things:

I debugged gdb with this gdb, did various commands, and then a bt full
which was ok:
(top-gdb) bt full
#0  0x00007f0b1ff97660 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:84
No locals.
#1  0x000055bd7edc2af1 in poll (__timeout=-1, __nfds=<optimized out>, __fds=<optimized out>)
    at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
No locals.
#2  gdb_wait_for_event (block=block@entry=1) at ../../binutils-gdb/gdb/event-loop.c:772
        timeout = -1
        file_ptr = <optimized out>
        num_found = 0
        __PRETTY_FUNCTION__ = "int gdb_wait_for_event(int)"


I changed the width to 40, and then there were a few lines and spaces before the  #0 
(I am not completely sure how to reproduce the below.  You might need to quit or C-c
a previous paged command.  So maybe this is the same problem as the next one
(maybe some data that stays in a buffer after a quit or C-c).

(top-gdb) set width 40
(top-gdb) bt full

          #0  0x00007f0b1ff97660 in __poll_nocancel ()
    at ../sysdeps/unix/syscall-template.S:84
No locals.
#1  0x000055bd7edc2af1 in poll (
    __timeout=-1, 
    __nfds=<optimized out>, 
    __fds=<optimized out>)
    at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
No locals.
#2  gdb_wait_for_event (
    block=block@entry=1)
...


Also, when doing q (to stop paging):
...
#3  0x000055bd7edc2c54 in gdb_do_one_event ()
    at ../../binutils-gdb/gdb/event-loop.c:347
        number_of_sources = <optimized out>
        current = 3
        event_source_head = 2
        res = <optimized out>
#4  0x000055bd7edc2de5 in gdb_do_one_event ()
<continue without paging--q
 at ../../binutils-gdb/gdb/common/cQuit
(top-gdb) help
List of classes of commands:

aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
...

We still have the ' at ../../binutils-gdb/gdb/common/cQuit'
shown after the quit. It is shown in green, and then (top-gdb)
and all what follows (the help command, and its output) is in
green.
The color goes back to normal as soon as a command produces
some styled output (e.g.  p $sp).


Also, the msg at the end of each page also appears at different columns,
e.g.

...
#14 0x000055bd7edc37a9 in gdb_rl_callback_read_char_wrapper (
    client_data=<optimized out>)
    at ../../binutils-gdb/gdb/event-top.c:192
        gdb_expt = <optimized out>
<continue without paging--
#15 0x000055bd7edc3d50 in stdin_event_handler (error=<optimized out>, 
    client_data=0x55bd813aa840)
    at ../../binutils-gdb/gdb/event-top.c:511
        ui = 0x55bd813aa840
...
        exception_try_scope_instance = <optimized out>
        ex = <optimized out>
#22 gdb_main (args=<optimized out>)
    at ../../binutils-gdb/gdb/main.c:1193
        exception_try_scope_instance = {<continue without paging--
...


So, maybe something colored is still in a buffer, that is flushed
at various moments ?

Note that I also produced the above symptoms by playing
with set height 8, and quitting or C-c at various 'continue msg'.

Philippe


  reply	other threads:[~2019-01-07 16:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-30 14:51 Philippe Waroquiers
2018-12-30 20:26 ` Tom Tromey
2018-12-30 23:45   ` Tom Tromey
2018-12-31  8:13     ` Philippe Waroquiers
2019-01-06 23:40       ` Tom Tromey
2019-01-07 13:46         ` Philippe Waroquiers
2019-01-07 14:49           ` Tom Tromey
2019-01-07 16:56             ` Philippe Waroquiers [this message]
2019-01-12 17:03               ` Tom Tromey
2019-01-12 17:55                 ` Philippe Waroquiers
2019-01-12 21:08                   ` Philippe Waroquiers
2019-01-14  3:55                     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1546880163.1926.22.camel@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox