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

Expected behaviour of 'set width XX'


I have a question about the expected behaviour of set width.  I'm
going to use 'set width 10' in the example below, I know 10 probably
isn't a very useful width, but I see the same behaviour for larger
widths.

In the pictures below I'm using "|" to denote the left edge of the
terminal, and "^" to indicate where the cursor is in the line above
(the line with the actual "^" does not exist yet).

So, I start up gdb and I see this:

  |(gdb)
  |      ^

Then I set the desired width,

  |(gdb) set width 10
  |(gdb)
  |      ^

Now I enter 3 "x"s.

  |(gdb) xxx
  |         ^

you'll notice that including the prompt, single space, and xxx I'm now
ready to fill character 10, so, I add 1 more x:

  |(gdb) xxxx
  |^

Notice that the cursor has wrapper back to the first character on the
line.  After this I enter 9 "y"s:

  |yyyyyyyyy
  |         ^

Yeah.... and one more "y":

  |yyyyyyyyyy
  |^

And we're back to the beginning of the line again.

My expectation was that after all the "x"s and "y"s, I would have had
this situation:

  |(gdb) xxxx
  |yyyyyyyyyy
  |
  |^

So a 10 character wide block of text on the left of my N wide
terminal.

So, my question: Is the current gdb behaviour the expected behaviour?
If it is the expected behaviour then how is this useful?

Thanks,
Andrew


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