all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jon Dufresne <jon.dufresne@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Need help debugging Emacs: emacsclient will not draw its contents sometimes
Date: Wed, 9 Sep 2015 15:29:18 -0700	[thread overview]
Message-ID: <CADhq2b55RZ-X-uNn=49C_9Eb1MQ=+L=YRTUPgzOzToVwZmVZ-g@mail.gmail.com> (raw)
In-Reply-To: <8337yo7mdo.fsf@gnu.org>

On Tue, Sep 8, 2015 at 12:16 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> So now the question is why you don't see the display.  Please step
> through command_loop_1 until it calls read_key_sequence, step into
> that, then step until it calls read_char, and step through read_char
> until it calls redisplay_internal.  Once you are inside
> redisplay_internal, step through it and show which lines are being
> executed.

Thanks. I'm no expert on gdb, but I believe I have followed your
suggestion. Below is the output from gdb by stepping through
redisplay_internal from beginning to end. Let me know what you think.
Any insight as to why the contents are not drawn?

(gdb) n
redisplay_internal () at ../../src/xdisp.c:13482
13482    {
(gdb) n
13507      if (FRAME_INITIAL_P (SELECTED_FRAME ())
(gdb) n
2430      if (! VECTORLIKEP (a))
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
13507      if (FRAME_INITIAL_P (SELECTED_FRAME ())
(gdb) n
13508          || !NILP (Vinhibit_redisplay))
(gdb) n
13483      struct window *w = XWINDOW (selected_window);
(gdb) n
13517      if (!fr->glyphs_initialized_p)
(gdb) n
13521      if (popup_activated ())
(gdb) n
13526      if (redisplaying_p)
(gdb) n
2894      return specpdl_ptr - specpdl;
(gdb) n
13532      record_unwind_protect_void (unwind_redisplay);
(gdb) n
2894      return specpdl_ptr - specpdl;
(gdb) n
13532      record_unwind_protect_void (unwind_redisplay);
(gdb) n
13534      specbind (Qinhibit_free_realized_faces, Qnil);
(gdb) n
13533      redisplaying_p = 1;
(gdb) n
13534      specbind (Qinhibit_free_realized_faces, Qnil);
(gdb) n
13537      record_in_backtrace (Qredisplay_internal, &Qnil, 0);
(gdb) n
13539      FOR_EACH_FRAME (tail, frame)
(gdb) n
13540        XFRAME (frame)->already_hscrolled_p = 0;
(gdb) n
13539      FOR_EACH_FRAME (tail, frame)
(gdb) n
13540        XFRAME (frame)->already_hscrolled_p = 0;
(gdb) n
13539      FOR_EACH_FRAME (tail, frame)
(gdb) n
13540        XFRAME (frame)->already_hscrolled_p = 0;
(gdb) n
13539      FOR_EACH_FRAME (tail, frame)
(gdb) n
11650          init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
(gdb) n
14044          STOP_POLLING;
(gdb) n
11650          init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
(gdb) n
13555      if (face_change_count)
(gdb) n
13547      last_escape_glyph_frame = NULL;
(gdb) n
13548      last_escape_glyph_face_id = (1 << FACE_ID_BITS);
(gdb) n
13549      last_glyphless_glyph_frame = NULL;
(gdb) n
13550      last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
(gdb) n
13555      if (face_change_count)
(gdb) n
13558      if ((FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))
(gdb) n
13576      FOR_EACH_FRAME (tail, frame)
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
13580          if (FRAME_VISIBLE_P (f))
(gdb) n
13582          ++number_of_visible_frames;
(gdb) n
13584          if (f->fonts_changed)
(gdb) n
13591          if (f != sf && f->cursor_type_changed)
(gdb) n
13594          clear_desired_matrices (f);
(gdb) n
13576      FOR_EACH_FRAME (tail, frame)
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
13580          if (FRAME_VISIBLE_P (f))
(gdb) n
13582          ++number_of_visible_frames;
(gdb) n
13584          if (f->fonts_changed)
(gdb) n
13591          if (f != sf && f->cursor_type_changed)
(gdb) n
13594          clear_desired_matrices (f);
(gdb) n
13576      FOR_EACH_FRAME (tail, frame)
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
13580          if (FRAME_VISIBLE_P (f))
(gdb) n
13582          ++number_of_visible_frames;
(gdb) n
13584          if (f->fonts_changed)
(gdb) n
13591          if (f != sf && f->cursor_type_changed)
(gdb) n
13594          clear_desired_matrices (f);
(gdb) n
13576      FOR_EACH_FRAME (tail, frame)
(gdb) n
13598      do_pending_window_change (1);
(gdb) n
13602      if (WINDOWP (selected_window) && (w = XWINDOW
(selected_window)) != sw)
(gdb) n
2430      if (! VECTORLIKEP (a))
(gdb) n
13602      if (WINDOWP (selected_window) && (w = XWINDOW
(selected_window)) != sw)
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
11236      if (frame_garbaged)
(gdb) n
13609      if (NILP (Vmemory_full))
(gdb) n
11689      bool all_windows = windows_or_buffers_changed || update_mode_lines;
(gdb) n
11690      bool some_windows = REDISPLAY_SOME_P ();
(gdb) n
11695      tooltip_frame = tip_frame;
(gdb) n
11700      if (FUNCTIONP (Vpre_redisplay_function))
(gdb) n
11695      tooltip_frame = tip_frame;
(gdb) n
703    LISP_MACRO_DEFUN (XTYPE, enum Lisp_Type, (Lisp_Object a), (a))
(gdb) n
4569      if (SYMBOLP (object) && !NILP (Ffboundp (object)))
(gdb) n
2430      if (! VECTORLIKEP (a))
(gdb) n
2422      return ((a->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK))
(gdb) n
4585      if (SUBRP (object))
(gdb) n
4587      else if (COMPILEDP (object))
(gdb) n
11702          Lisp_Object windows = all_windows ? Qt : Qnil;
(gdb) n
11718          safe__call1 (true, Vpre_redisplay_function, windows);
(gdb) n
11725      if (all_windows)
(gdb) n
11817          struct frame *sf = SELECTED_FRAME ();
(gdb) n
2430      if (! VECTORLIKEP (a))
(gdb) n
11817          struct frame *sf = SELECTED_FRAME ();
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
11817          struct frame *sf = SELECTED_FRAME ();
(gdb) n
11846      if (inhibit_menubar_update)
(gdb) n
11977      if (do_update)
(gdb) n
13612      reconsider_clip_changes (w);
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
13615      match_p = XBUFFER (w->contents) == current_buffer;
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
13615      match_p = XBUFFER (w->contents) == current_buffer;
(gdb) n
13616      if (match_p)
(gdb) n
13619          if ((SAVE_MODIFF < MODIFF) != w->last_had_star)
(gdb) n
13622          if (mode_line_update_needed (w))
(gdb) n
13628          if (current_buffer->clip_changed)
(gdb) n
13637      if ((!NILP (echo_area_buffer[0]) &&
!display_last_displayed_message_p)
(gdb) n
13645          int window_height_changed_p = echo_area_display (0);
(gdb) n
13648        update_miniwindow_p = true;
(gdb) n
13656          if (!display_last_displayed_message_p)
(gdb) n
13648        update_miniwindow_p = true;
(gdb) n
13656          if (!display_last_displayed_message_p)
(gdb) n
13657        message_cleared_p = 0;
(gdb) n
13659          if (window_height_changed_p)
(gdb) n
13650          must_finish = 1;
(gdb) n
13683      if (windows_or_buffers_changed && !update_mode_lines)
(gdb) n
13692      if (overlay_arrows_changed_p ())
(gdb) n
13697      consider_all_windows_p = (update_mode_lines
(gdb) n
13698                    || windows_or_buffers_changed);
(gdb) n
13704      AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed);
(gdb) n
2394      return VECTORLIKEP (x) && ! (ASIZE (x) & PSEUDOVECTOR_FLAG);
(gdb) n
1368      return XVECTOR (array)->header.size;
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
2394      return VECTORLIKEP (x) && ! (ASIZE (x) & PSEUDOVECTOR_FLAG);
(gdb) n
13704      AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed);
(gdb) n
13705      AINC (Vredisplay__mode_lines_cause, update_mode_lines);
(gdb) n
2394      return VECTORLIKEP (x) && ! (ASIZE (x) & PSEUDOVECTOR_FLAG);
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
1368      return XVECTOR (array)->header.size;
(gdb) n
13705      AINC (Vredisplay__mode_lines_cause, update_mode_lines);
(gdb) n
13711      tlbufpos = this_line_start_pos;
(gdb) n
13714          && CHARPOS (tlbufpos) > 0
(gdb) n
13715          && !w->update_mode_line
(gdb) n
13716          && !current_buffer->clip_changed
(gdb) n
13717          && !current_buffer->prevent_redisplay_optimizations_p
(gdb) n
13718          && FRAME_VISIBLE_P (XFRAME (w->frame))
(gdb) n
13719          && !FRAME_OBSCURED_P (XFRAME (w->frame))
(gdb) n
13720          && !XFRAME (w->frame)->cursor_type_changed
(gdb) n
13723          && match_p
(gdb) n
13724          && !w->force_start
(gdb) n
13725          && !w->optional_new_start
(gdb) n
13727          && PT >= CHARPOS (tlbufpos)
(gdb) n
13728          && PT <= Z - CHARPOS (tlendpos)
(gdb) n
13712      tlendpos = this_line_end_pos;
(gdb) n
13728          && PT <= Z - CHARPOS (tlendpos)
(gdb) n
13712      tlendpos = this_line_end_pos;
(gdb) n
13166      if (window_outdated (w))
(gdb) n
13711      tlbufpos = this_line_start_pos;
(gdb) n
13712      tlendpos = this_line_end_pos;
(gdb) n
13166      if (window_outdated (w))
(gdb) n
13734          if (CHARPOS (tlbufpos) > BEGV
(gdb) n
13735          && FETCH_BYTE (BYTEPOS (tlbufpos) - 1) != '\n'
(gdb) n
13740          else if (window_outdated (w) || MINI_WINDOW_P (w))
(gdb) n
13842          else if (/* Cursor position hasn't changed.  */
(gdb) n
13848               && 0 <= w->cursor.vpos
(gdb) n
13849               && w->cursor.vpos < WINDOW_TOTAL_LINES (w))
(gdb) n
13851          if (!must_finish)
(gdb) n
14036          if (sf->fonts_changed)
(gdb) n
14042          if (interrupt_input)
(gdb) n
14043        unrequest_sigio ();
(gdb) n
14044          STOP_POLLING;
(gdb) n
14046          if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf))
(gdb) n
14048          if (hscroll_windows (selected_window))
(gdb) n
13078      int hscrolled_p = hscroll_window_tree (window);
(gdb) n
13079      if (hscrolled_p)
(gdb) n
14051          XWINDOW (selected_window)->must_be_updated_p = true;
(gdb) n
14052          pending = update_frame (sf, 0, 0);
(gdb) n
14051          XWINDOW (selected_window)->must_be_updated_p = true;
(gdb) n
14052          pending = update_frame (sf, 0, 0);
(gdb) n
14061          mini_window = FRAME_MINIBUF_WINDOW (sf);
(gdb) n
14053          sf->cursor_type_changed = 0;
(gdb) n
14052          pending = update_frame (sf, 0, 0);
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
14064          if (mini_frame != sf && FRAME_WINDOW_P (mini_frame))
(gdb) n
14076      if (pending)
(gdb) n
14094          if (!consider_all_windows_p)
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
14098          if (XBUFFER (w->contents)->text->redisplay
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
14098          if (XBUFFER (w->contents)->text->redisplay
(gdb) n
14103          mark_window_display_accurate_1 (w, 1);
(gdb) n
14106          update_overlay_arrows (1);
(gdb) n
14108          if (FRAME_TERMINAL (sf)->frame_up_to_date_hook != 0)
(gdb) n
14109            FRAME_TERMINAL (sf)->frame_up_to_date_hook (sf);
(gdb) n
14112          update_mode_lines = 0;
(gdb) n
14113          windows_or_buffers_changed = 0;
(gdb) n
14120      if (interrupt_input)
(gdb) n
14121        request_sigio ();
(gdb) n
14122      RESUME_POLLING;
(gdb) n
14130      if (!pending)
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14136          if (XFRAME (frame)->visible)
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14136          if (XFRAME (frame)->visible)
(gdb) n
14137            new_count++;
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14137            new_count++;
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14136          if (XFRAME (frame)->visible)
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14136          if (XFRAME (frame)->visible)
(gdb) n
14137            new_count++;
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14137            new_count++;
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14136          if (XFRAME (frame)->visible)
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14136          if (XFRAME (frame)->visible)
(gdb) n
14137            new_count++;
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14137            new_count++;
(gdb) n
14134          FOR_EACH_FRAME (tail, frame)
(gdb) n
14140          if (new_count != number_of_visible_frames)
(gdb) n
14145      do_pending_window_change (1);
(gdb) n
14149      if ((windows_or_buffers_changed && !pending)
(gdb) n
14150          || (WINDOWP (selected_window) && (w = XWINDOW
(selected_window)) != sw))
(gdb) n
2430      if (! VECTORLIKEP (a))
(gdb) n
14150          || (WINDOWP (selected_window) && (w = XWINDOW
(selected_window)) != sw))
(gdb) n
704    LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
(gdb) n
14150          || (WINDOWP (selected_window) && (w = XWINDOW
(selected_window)) != sw))
(gdb) n
14159      if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
(gdb) n
14166      if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
(gdb) n
14177      if (interrupt_input && interrupts_deferred)
(gdb) n
14180      unbind_to (count, Qnil);
(gdb) n
14182    }
(gdb) n
read_char (commandflag=1, map=map@entry=87871094, prev_event=12327986,
used_mouse_menu=used_mouse_menu@entry=0x7fff013f585b,
end_time=end_time@entry=0x0) at ../../src/keyboard.c:2822
2822          if (!detect_input_pending_run_timers (0))
(gdb)



  reply	other threads:[~2015-09-09 22:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08 13:00 Need help debugging Emacs: emacsclient will not draw its contents sometimes Jon Dufresne
2015-09-08 13:28 ` Tassilo Horn
2015-09-08 17:18 ` Eli Zaretskii
2015-09-08 18:58   ` Jon Dufresne
2015-09-08 19:16     ` Eli Zaretskii
2015-09-09 22:29       ` Jon Dufresne [this message]
2015-09-10 15:26         ` Eli Zaretskii
2015-09-10 18:20           ` Jon Dufresne
2015-09-10 18:46             ` Eli Zaretskii
2015-09-10 18:52               ` Jon Dufresne
2015-09-11  7:26                 ` Eli Zaretskii
2015-09-11 16:47                   ` Jon Dufresne
2015-09-14 10:09                     ` Eli Zaretskii
2015-09-23  0:51                       ` Jon Dufresne
2015-09-23  6:45                         ` Eli Zaretskii
2015-09-27 22:21                           ` Mike Kupfer
2015-09-28  6:39                             ` Eli Zaretskii
2016-02-16  1:07                             ` Mike Kupfer
2016-02-16 16:26                               ` Eli Zaretskii
2016-02-16 16:38                                 ` Kaushal Modi
2016-02-16 16:44                                   ` Eli Zaretskii
2016-02-16 17:06                                     ` Kaushal Modi
2016-02-17  2:05                                 ` Mike Kupfer
2016-02-17 20:02                                   ` Eli Zaretskii
2016-02-18  5:01                                     ` Mike Kupfer
2016-02-20 11:24                                       ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to='CADhq2b55RZ-X-uNn=49C_9Eb1MQ=+L=YRTUPgzOzToVwZmVZ-g@mail.gmail.com' \
    --to=jon.dufresne@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.