From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: Debugging printing to stderr prior glyph row values .... Date: Thu, 23 May 2019 15:01:09 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="1292"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 24 00:01:21 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTvm5-0000BL-2e for ged-emacs-devel@m.gmane.org; Fri, 24 May 2019 00:01:21 +0200 Original-Received: from localhost ([127.0.0.1]:43846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTvm3-0004j0-Qm for ged-emacs-devel@m.gmane.org; Thu, 23 May 2019 18:01:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTvlw-0004iu-NE for emacs-devel@gnu.org; Thu, 23 May 2019 18:01:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTvlv-0005hB-DO for emacs-devel@gnu.org; Thu, 23 May 2019 18:01:12 -0400 Original-Received: from gateway21.websitewelcome.com ([192.185.45.155]:46103) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTvlv-0005gH-17 for emacs-devel@gnu.org; Thu, 23 May 2019 18:01:11 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 2F8C9400C915D for ; Thu, 23 May 2019 17:01:10 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id TvlthlqTUiQerTvluhNONE; Thu, 23 May 2019 17:01:10 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc :To:From:Message-ID:Date:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Bt1csFGBkLnSPEk+Ldii7RtJd81Id5G2663Mkvto+Q8=; b=Xps5bFNnan3hFCQg2Qc+HkFElx mPgsP5JvcjMVO9z/rL3on7bVhaVeJ5AHB7WrsNitZRELkhnBZ6mB9uNnT+hm8tGEBVIXcShlL2Q3/ zMYZl1xf3bLj6REfryrpvPG24h6T5fTwDhDAxJyI+T7F4etgNtC1g1JKyziqJUTsPm8PaRY8I9f52 WVy1kxOZC3f30arHVUFpaFpynlHHH2pALM/qNcfR/ylac19/u+YMLpRI0aRz1JV9Jym/oa6rE+cOr r6Irkp0P3qbbATCTzA3v/9n/KYoyKlNddUKuiB87sQiyp3M3P+3q+1jhnpbu3F8MTBIPX/uw8xs30 WQVNFSfw==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50287 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hTvlt-002xIR-Ek; Thu, 23 May 2019 17:01:09 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hTvlt-002xIR-Ek X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50287 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.45.155 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236951 Archived-At: Thank you for mentioning the 4th case; i.e., when a row ends at ZV, but d= oes have glyphs. Testing for a differential between the start/end row by= tepos, coupled with the row->ends_at_zv_p flag being true, appears to be = sufficient for that particular case. The multiple fake cursors feature places fake cursors at particular buffe= r positions from BEGV to ZV. The crosshairs feature takes it one step fu= rther and draws fake cursors extending beyond ZV until the vertical ruler= stops at the top of the mode-line. As to the multiple fake cursors feat= ure, there is a need to distinguish between a row containing _only_ ZV an= d subsequent rows so that fake cursors are not drawn there. The test for row->ends_at_zv_p would be useful for a row containing _only= _ ZV (last point in the buffer) if it were the only row with that flag en= abled. As far as I can tell, a row with _only_ ZV (last point in the buf= fer) is identical to rows that follow it because their ends_at_zv_p flag = is true also. I have not yet been able to figure out a way to programmat= ically distinguish between 2, 3 and 4 in the following example: 1. Every good boy deserves fudge.=C2=B6 2. ZV<=3D=3D 3. [one or more ' ' space glyphs] 4. [one or more ' ' space glyphs] 5. Mode-Line When the crashing sporadically occurred yesterday, I tried during a coupl= e of crash sessions to call "pgrowx row - 1" and "pgrowx (row - 1)" from = gdb, but gdb appeared to produce the output for ROW instead of ROW - 1. = I have now added the following definition in the code so that I can call = "pgrowx previous_row" from gdb. struct glyph_row *previous_row =3D row - 1; I spent several minutes this afternoon trying to make Emacs crash doing t= hings similar to yesterday, but have not yet had any luck getting Emacs t= o crash ... I will keep trying ... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [05-23-2019 11:38:25] <23 May 2019 21:38:25 +0300> > From: Eli Zaretskii > To: Keith David Bershatsky > CC: emacs-devel@gnu.org > Subject: Re: Debugging printing to stderr prior glyph row values .... >=20 > > Date: Thu, 23 May 2019 10:23:03 -0700 > > From: Keith David Bershatsky > > Cc: emacs-devel@gnu.org > > > > I will add a test for the `used` row member to ensure that it is posi= tive. The crashing reported in the initial post only happens somtimes, s= o I'll need to do some further testing. >=20 > Did you look at the problematic row with the GDB command "pgrowx"? > It's important to understand what kind of glyphs are in that row and > how many of them do you have there. >=20 > > I am looking to programmatically distinguish between the following th= ree types of consecutive rows: (1) the penultimate row _not_ ending in Z= V that immediately precedes a row with _only_ ZV; (2) the last row that c= ontains _only_ ZV; and, (3) rows that follow a row with _only_ ZV. >=20 > There's a 4th case: when a row ends at ZV, but does have glyphs. This > happens, for example, when visiting a file that doesn't end in a > newline. >=20 > > A better method of determining row_at_zv_p (without consulting ROW - = 1) would be appreciated, if such a test exists. >=20 > I don't understand why you don't just look at the ends_at_zv_p flag, > that's what it's for.