]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/NEWS
gdb/tui: add a tui debugging flag
authorAndrew Burgess <aburgess@redhat.com>
Wed, 26 Jan 2022 18:52:56 +0000 (18:52 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Sun, 3 Apr 2022 14:31:46 +0000 (15:31 +0100)
commit7421ccda7640f53d4096a51402ae28daa6c816c0
tree63c616e5ba4027f2c70953e569954f7b26cdd5b8
parent160444ec7fd7c6df81826b8e06aa32a2ac1df856
gdb/tui: add a tui debugging flag

This commit adds 'set debug tui on|off' and 'show debug tui'.  This
commit adds the control variable, and the printing macros in
tui/tui.h.  I've then added some uses of these in tui.c and
tui-layout.c.

To help produce more useful debug output in tui-layout.c, I've added
some helper member functions in the class tui_layout_split, and also
moved the size_info struct out of tui_layout_split::apply into the
tui_layout_split class.

If tui debug is not turned on, then there should be no user visible
changes after this commit.

One thing to note is that, due to the way that the tui terminal is
often cleared, the only way I've found this useful is when I do:

  (gdb) tui enable
  (gdb) set logging file /path/to/file
  (gdb) set logging debugredirect on
  (gdb) set logging enable on

Additionally, gdb has some quirks when it comes to setting up logging
redirect and switching interpreters.  Thus, the above only really
works if the logging is enabled after the tui is enabled, and disabled
again before the tui is disabled.

Enabling logging and switching interpreters can cause undefined
results, including crashes.  This is an existing bug in gdb[1], and
has nothing directly to do with tui debug, but it is worth mentioning
here I think.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=28948
gdb/NEWS
gdb/doc/gdb.texinfo
gdb/tui/tui-layout.c
gdb/tui/tui-layout.h
gdb/tui/tui.c
gdb/tui/tui.h