From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jon Dufresne Newsgroups: gmane.emacs.devel Subject: Re: Need help debugging Emacs: emacsclient will not draw its contents sometimes Date: Wed, 9 Sep 2015 15:29:18 -0700 Message-ID: References: <83fv2o7rtp.fsf@gnu.org> <8337yo7mdo.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1441837778 32633 80.91.229.3 (9 Sep 2015 22:29:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2015 22:29:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 10 00:29:37 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZZnru-000425-G4 for ged-emacs-devel@m.gmane.org; Thu, 10 Sep 2015 00:29:30 +0200 Original-Received: from localhost ([::1]:45977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZnrt-0008PN-Tc for ged-emacs-devel@m.gmane.org; Wed, 09 Sep 2015 18:29:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZnrp-0008PF-B2 for emacs-devel@gnu.org; Wed, 09 Sep 2015 18:29:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZnrn-0005v4-BS for emacs-devel@gnu.org; Wed, 09 Sep 2015 18:29:25 -0400 Original-Received: from mail-qg0-x22f.google.com ([2607:f8b0:400d:c04::22f]:35446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZnrj-0005uY-Iv; Wed, 09 Sep 2015 18:29:19 -0400 Original-Received: by qgt47 with SMTP id 47so21177192qgt.2; Wed, 09 Sep 2015 15:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=skVpY9r5QRetYwiKWyoOuQX5MElKEd4g5HWiXF0xEO0=; b=VTC5IE7QcdJEYiX6lVH+T7McOX4ZxE8pCK2t6C5fVdl0FOUD1uJOPHyy6OjhjB4MfY iewvXE/gtkEvc92bWdTCuaXwcCgVqhxF61jIuLCW0zQYf50yFzn1wNQjh6SoqbMKIcLQ UcMj6ouMhIhsPh8f3spGUdSVeSQI9gh8TPkhQvMifhZjxTfjnyNbAyXcN63HmO7OSFi6 bG7Tw8DziEsFcHXO951JWbZtwGPOrms1Ktb/mAHHenSW5G48IfkcpcitDAje3+uI8WZ1 0fZ14LVxCs9zScEIXl8SOYQM3avKHRanObXBJctmEBYUarUqIHEwD6r9olQnznfAijsU V1mQ== X-Received: by 10.140.231.208 with SMTP id b199mr52102846qhc.87.1441837758774; Wed, 09 Sep 2015 15:29:18 -0700 (PDT) Original-Received: by 10.55.100.135 with HTTP; Wed, 9 Sep 2015 15:29:18 -0700 (PDT) In-Reply-To: <8337yo7mdo.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189780 Archived-At: On Tue, Sep 8, 2015 at 12:16 PM, Eli Zaretskii 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)