From patchwork Wed Mar 13 15:44:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 31842 Received: (qmail 46079 invoked by alias); 13 Mar 2019 15:44:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 46071 invoked by uid 89); 13 Mar 2019 15:44:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=video, UD:type X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Mar 2019 15:44:17 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h463D-0001FY-Qt; Wed, 13 Mar 2019 11:44:15 -0400 Received: from [176.228.60.248] (port=1942 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h463D-00043P-AA; Wed, 13 Mar 2019 11:44:15 -0400 Date: Wed, 13 Mar 2019 17:44:12 +0200 Message-Id: <83lg1i3hkj.fsf@gnu.org> From: Eli Zaretskii To: Hannes Domani , Tom Tromey CC: gdb-patches@sourceware.org In-reply-to: <375483967.6114402.1552410513314@mail.yahoo.com> (gdb-patches@sourceware.org) Subject: Re: [RFC 8.3 0/3] Some style fixes References: <20190308210433.32683-1-tromey@adacore.com> <1828778750.3318305.1552141698307@mail.yahoo.com> <87o96g3upj.fsf@tromey.com> <375483967.6114402.1552410513314@mail.yahoo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes > Date: Tue, 12 Mar 2019 17:08:33 +0000 (UTC) > From: "Hannes Domani via gdb-patches" > > In copy_source_line() it checks if (column < first_col), and because of the ++column directly > before, it basically starts with 1 instead of 0. > > Attached is a patch that fixes most of 2) and 3), but I ignored the handling of escaped > characters, because I just don't have them in any of my sources. I can confirm that this patch fixes the problems with horizontal scrolling, with or without TAB characters in the sources. I think we should push it. I also found another regression in the TUI configuration: if you step with, say, "next" through the program, and execution winds up on a line that is longer than the source window-width, then the current line gets redrawn in reverse video, and as result it overwrites the window-frame and a portion of the next source line. This happens because we only update one source line, and we do that in a way that doesn't take the window width and horizontal scrolling offset into account. Here's the patch that fixes this regression: --- gdb/tui/tui-winsource.c~5 2019-03-12 16:51:50.000000000 +0200 +++ gdb/tui/tui-winsource.c 2019-03-13 08:21:02.303443600 +0200 @@ -382,12 +387,30 @@ tui_set_is_exec_point_at (struct tui_lin { changed++; content[i]->which_element.source.is_exec_point = new_state; - tui_show_source_line (win_info, i + 1); } i++; } if (changed) - tui_refresh_win (&win_info->generic); + { + struct gdbarch *gdbarch = win_info->detail.source_info.gdbarch; + struct symtab *s = NULL; + + if (win_info->generic.type == SRC_WIN) + { + struct symtab_and_line cursal + = get_current_source_symtab_and_line (); + + if (cursal.symtab == NULL) + s = find_pc_line_symtab (get_frame_pc (get_selected_frame (NULL))); + else + s = cursal.symtab; + } + tui_update_source_window_as_is (win_info, gdbarch, s, + win_info->generic.content[0] + ->which_element.source.line_or_addr, + FALSE); + tui_refresh_win (&win_info->generic); + } } /* Update the execution windows to show the active breakpoints.