emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging printing to stderr prior glyph row values ....


From: Eli Zaretskii
Subject: Re: Debugging printing to stderr prior glyph row values ....
Date: Thu, 23 May 2019 17:43:14 +0300

> Date: Wed, 22 May 2019 21:14:01 -0700
> From: Keith David Bershatsky <address@hidden>
> 
> (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 via email to

[Prev in Thread] Current Thread [Next in Thread]