[Top][All Lists]

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

Re: Assertion failure in set_iterator_to_next

From: Eli Zaretskii
Subject: Re: Assertion failure in set_iterator_to_next
Date: Mon, 12 Apr 2010 00:12:08 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Sun, 11 Apr 2010 16:04:05 -0400
> >       /* Get the next character, maybe multibyte.  */
> >       p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
> >       if (it->multibyte_p && !ASCII_BYTE_P (*p))
> >         it-> c = STRING_CHAR_AND_LENGTH (p, it->len);     <<<<<<<<<
> >       else
> >         it-> c = *p, it->len = 1;                         <<<<<<<<<
> Oh, thank you very much.  I searched for this spot and couldn't find it
> (I grepped with a pattern like "->len =", which only caught the second
> line which couldn't explain why I was getting it->len==3.
> That should help me move forward.
> > Since you are saying this is an ASCII buffer, are charpos and bytepos
> > at least identical?
> Yes, they're identical before the assignment to IT_CHARPOS and
> IT_BYTEPOS, but since it->len==3 a discrepancy of 2 appears which then
> triggers the subsequent xassert.

If this is an all-ASCII buffer, you should be able to say

  (gdb) watch it->len if it->len > 1

and see all the possible suspects.  I would suggest to invoke
"M-x redraw-display" after setting this watchpoint, because that
performs a full redisplay and will iterate over all the characters in
the buffer, its overlays, etc.

You may also find the following commands handy for tracking this

  (gdb) pit

  (gdb) pgrowx it->glyph_row

The first will show you the current state of the iterator (struct it),
the latter will show the glyphs that have been assembled so far in the
line that is being produced, together with the source (buffer, string,
etc.) from which every glyph comes.  Just remember that using `pit' at
arbitrary places may catch it out of sync, like it->c and it->len that
do not match IT_CHARPOS(*it).

You can also display previously produced glyph rows like this:

  (gdb) pgrowx it->glyph_row - 1
  (gdb) pgrowx it->glyph_row - 2

etc., you get the point.  Finally,

  (gdb) pgrowx MATRIX_ROW(it->w->desired_matrix,N)

will display the Nth glyph row of the glyph matrix being constructed,
which will normally be the Nth screen line (zero-based) on the updated
display of the window it->w.

reply via email to

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