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

Re: GDB ui word wrapping broken/interferes with 'set style' ?


On Sat, 2019-01-12 at 10:03 -0700, Tom Tromey wrote:
> > > > > > "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
> 
> Philippe> I changed the width to 40, and then there were a few lines and spaces before the  #0 
> Philippe> (I am not completely sure how to reproduce the below.  You might need to quit or C-c
> Philippe> a previous paged command.  So maybe this is the same problem as the next one
> Philippe> (maybe some data that stays in a buffer after a quit or C-c).
> 
> I think I've figured this out and I pushed a new patch to my WIP branch
> to address it.  Could you try it out?  I still haven't written the test
> case but hopefully this weekend.

I have tested the last version.

Just two minor things found with the pager prompt:


Using (this patched) gdb to debug itself:
(top-gdb) show height
Number of lines gdb thinks are in a page is 24.
(top-gdb) show width
Number of characters gdb thinks are in a line is 80.
(top-gdb) 

Put a breakpoint in the style function:
(top-gdb) break style

In the inferior gdb, do
(gdb) info breakpoints

When the style breakpoint is encountered, do
(top-gdb) bt full

The 4th page prompt is not at the first column:
...
#9  0x000055b36e50b6f1 in execute_command (p=<optimized out>, 
    p@entry=0x55b36f6d4230 "info breakp", from_tty=1)
    at ../../gdb/gdb/top.c:630
        without_whitespace = {static npos = 18446744073709551615, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No
data fields>}, <No data fields>}, _M_p = 0x7ffd285ad140 ""}, 
          _M_string_length = 0, {
            --Type <RET> for more, q to quit, c to continue without paging--



For the same test, GDB 8.2 gives:
#9  0x000055b36e50b6f1 in execute_command (p=<optimized out>, 
    p@entry=0x55b36f6d4230 "info breakp", from_tty=1)
    at ../../gdb/gdb/top.c:630
        without_whitespace = {static npos = 18446744073709551615, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No
data fields>}, <No data fields>}, _M_p = 0x7ffd285ad140 ""}, 
--Type <RET> for more, q to quit, c to continue without paging--


Note that this behaviour is not very easy to produce.  You might be
more (un-)lucky by using e.g.
   set height 3
and then do bt full,
so as to have more page prompts.




The second thing:
-----------------

(top-gdb) set height 3
(top-gdb) info var some
All variables matching regular expression "some":

--Type <RET> for more, q to quit, c to continue without paging--
File ./complete.c:
344:	rl_compignore_func_t *rl_ignore_some_completions_function;
--Type <RET> for more, q to quit, c to continue without paging--

Non-debugging symbols:
--Type <RET> for more, q to quit, c to continue without paging--
--Type <RET> for more, q to quit, c to continue without paging--
0x000055b36e7bbc20  iterate_over_some_symtabs(char const*, char const*, compunit_symtab*,
compunit_symtab*, gdb::function_view<bool (symtab*)>)::__PRETTY_FUNCTION__
(top-gdb) 

As you can see, we have 2 successive pager prompts, but no
info in between.
GDB 8.2 does not show such behaviour.

Thanks

Philippe


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