unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: emacs-devel@gnu.org
Subject: Re: Debugging printing to stderr prior glyph row values ....
Date: Thu, 23 May 2019 17:43:14 +0300	[thread overview]
Message-ID: <83y32x5j0d.fsf@gnu.org> (raw)
In-Reply-To: <m2woihzu2e.wl%esq@lawlist.com> (message from Keith David Bershatsky on Wed, 22 May 2019 21:14:01 -0700)

> Date: Wed, 22 May 2019 21:14:01 -0700
> From: Keith David Bershatsky <esq@lawlist.com>
> 
> (gdb) print previous_row__last_glyph
> $9 = (struct glyph *) 0x11f7fffb0
> 
> (gdb) print previous_row__last_glyph->charpos
> Cannot access memory at address 0x11f7fffd0

You didn't tell enough about the situation.  E.g., what kind of window
is that -- a window that shows a buffer, or something else?  How many
rows are in that window?  What is the full content or ROW and ROW-1?

One potential problem I see is that this doesn't test the 'used'
member:

  struct glyph *previous_row__last_glyph
    = (vpos == 0)
        ? NULL
      : (!(row - 1)->enabled_p)
        ? NULL
      : (row - 1)->glyphs[TEXT_AREA] + (row - 1)->used[TEXT_AREA] - 1;

The 'used' member should be positive, or else subtracting 1 is not
allowed.



  reply	other threads:[~2019-05-23 14:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23  4:14 Debugging printing to stderr prior glyph row values Keith David Bershatsky
2019-05-23 14:43 ` Eli Zaretskii [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-23 17:23 Keith David Bershatsky
2019-05-23 18:38 ` Eli Zaretskii
2019-05-23 22:01 Keith David Bershatsky
2019-05-24  0:03 Keith David Bershatsky
2019-05-24  6:45 ` Eli Zaretskii
2019-05-24 14:56 Keith David Bershatsky

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y32x5j0d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=esq@lawlist.com \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).