public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug tui/31522] TUI misses highlight after run to main Date: Thu, 28 Mar 2024 10:33:34 +0000 [thread overview] Message-ID: <bug-31522-4717-CG5xYYx993@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-31522-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=31522 --- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> --- I investigated a bit, by setting a breakpoint on tui_source_window::set_contents, and observing what sal.line is used. With commit ee1e9bbb513^, we have (for the "tui enable" command): - sal.line == 6 (set by tui_source_window_base::rerender) - sal.line == 0 (set by tui_update_source_windows_with_addr) - sal.line == 2 (set by tui_source_window::maybe_update) With commit ee1e9bbb513 (as well as with the fix of comment 4), we have: - sal.line == 6 (set by tui_source_window_base::rerender) The desired behaviour of centering on a source line is only present in tui_source_window::maybe_update. Duplicating that functionality in tui_source_window_base::rerender: ... diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 52c0b5b69a4..c140e9053be 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -482,6 +482,10 @@ tui_source_window_base::rerender () struct symtab *s = find_pc_line_symtab (get_frame_pc (frame)); if (this != TUI_SRC_WIN) find_line_pc (s, cursal.line, &cursal.pc); + int start_line = (cursal.line - ((height - box_size ()) / 2)) + 1; + if (start_line <= 0) + start_line = 1; + cursal.line = start_line; update_source_window (gdbarch, cursal); } else ... gives us the desired centering. It passes the TUI tests. -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2024-03-28 10:33 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-21 15:57 [Bug tui/31522] New: " pedro at palves dot net 2024-03-21 16:19 ` [Bug tui/31522] " ssbssa at sourceware dot org 2024-03-21 16:19 ` tromey at sourceware dot org 2024-03-22 16:24 ` tromey at sourceware dot org 2024-03-25 23:18 ` tromey at sourceware dot org 2024-03-25 23:18 ` tromey at sourceware dot org 2024-03-26 0:26 ` tromey at sourceware dot org 2024-03-26 13:15 ` pedro at palves dot net 2024-03-27 1:10 ` tromey at sourceware dot org 2024-03-27 8:33 ` vries at gcc dot gnu.org 2024-03-27 22:35 ` tromey at sourceware dot org 2024-03-28 10:33 ` vries at gcc dot gnu.org [this message] 2024-03-28 11:07 ` pedro at palves dot net 2024-03-28 12:00 ` vries at gcc dot gnu.org 2024-03-28 14:34 ` vries at gcc dot gnu.org 2024-03-28 14:35 ` vries at gcc dot gnu.org 2024-03-28 14:50 ` vries at gcc dot gnu.org 2024-03-28 16:43 ` pedro at palves dot net 2024-03-28 22:26 ` tromey at sourceware dot org 2024-04-02 14:09 ` cvs-commit at gcc dot gnu.org 2024-04-02 14:10 ` vries at gcc dot gnu.org
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=bug-31522-4717-CG5xYYx993@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@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).