public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/tui: more debug output Date: Fri, 27 Jan 2023 16:25:38 +0000 (GMT) [thread overview] Message-ID: <20230127162538.D47873858C2F@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2d46b103a52e4597ee60aa224ef4e5fb225ba893 commit 2d46b103a52e4597ee60aa224ef4e5fb225ba893 Author: Andrew Burgess <aburgess@redhat.com> Date: Thu Jan 5 14:42:34 2023 +0000 gdb/tui: more debug output Add some additional debug output that I've found really useful while working on the previous set of patches. Unless tui debug is turned on, then there should be no user visible changes with this commit. Diff: --- gdb/tui/tui-winsource.c | 21 +++++++++++++++++++++ gdb/tui/tui.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index b5b6079a909..52a0f7af00f 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -316,6 +316,8 @@ tui_source_window_base::show_source_line (int lineno) void tui_source_window_base::refresh_window () { + TUI_SCOPED_DEBUG_START_END ("window `%s`", name ()); + /* tui_win_info::refresh_window would draw the empty background window to the screen, potentially creating a flicker. */ wnoutrefresh (handle.get ()); @@ -326,6 +328,12 @@ tui_source_window_base::refresh_window () int content_width = m_max_length; int pad_x = m_horizontal_offset - m_pad_offset; + tui_debug_printf ("pad_width = %d, left_margin = %d, view_width = %d", + pad_width, left_margin, view_width); + tui_debug_printf ("content_width = %d, pad_x = %d, m_horizontal_offset = %d", + content_width, pad_x, m_horizontal_offset); + tui_debug_printf ("m_pad_offset = %d", m_pad_offset); + gdb_assert (m_pad_offset >= 0); gdb_assert (m_horizontal_offset + view_width <= std::max (content_width, view_width)); @@ -346,6 +354,8 @@ tui_source_window_base::refresh_window () void tui_source_window_base::show_source_content () { + TUI_SCOPED_DEBUG_START_END ("window `%s`", name ()); + gdb_assert (!m_content.empty ()); /* The pad should be at least as wide as the window, but ideally, as wide @@ -390,6 +400,8 @@ tui_source_window_base::show_source_content () } m_pad_requested_width = required_pad_width; + tui_debug_printf ("requested width %d, allocated width %d", + required_pad_width, getmaxx (m_pad.get ())); } gdb_assert (m_pad != nullptr); @@ -431,6 +443,8 @@ tui_source_window_base::update_tab_width () void tui_source_window_base::rerender () { + TUI_SCOPED_DEBUG_START_END ("window `%s`", name ()); + if (!m_content.empty ()) { struct symtab_and_line cursal @@ -492,6 +506,8 @@ tui_source_window_base::refill () bool tui_source_window_base::validate_scroll_offsets () { + TUI_SCOPED_DEBUG_START_END ("window `%s`", name ()); + int original_pad_offset = m_pad_offset; if (m_horizontal_offset < 0) @@ -501,6 +517,11 @@ tui_source_window_base::validate_scroll_offsets () int pad_width = getmaxx (m_pad.get ()); int view_width = this->view_width (); + tui_debug_printf ("pad_width = %d, view_width = %d, content_width = %d", + pad_width, view_width, content_width); + tui_debug_printf ("original_pad_offset = %d, m_horizontal_offset = %d", + original_pad_offset, m_horizontal_offset); + if (m_horizontal_offset + view_width > content_width) m_horizontal_offset = std::max (content_width - view_width, 0); diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h index a9ecd589a70..ca30e7cc65e 100644 --- a/gdb/tui/tui.h +++ b/gdb/tui/tui.h @@ -36,6 +36,9 @@ extern bool debug_tui; #define TUI_SCOPED_DEBUG_ENTER_EXIT \ scoped_debug_enter_exit (debug_tui, "tui") +#define TUI_SCOPED_DEBUG_START_END(fmt, ...) \ + scoped_debug_start_end (debug_tui, "tui", fmt, ##__VA_ARGS__) + struct ui_file; /* Types of error returns. */
reply other threads:[~2023-01-27 16:25 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230127162538.D47873858C2F@sourceware.org \ --to=aburgess@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).