; list ==>
; "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
+;; The idea of the following function was suggested
+;; by Kenichi Handa <handa@gnu.org>.
+;;
+;; FIXME: This is fragile: it relies on the assumption that all the
+;; non-ASCII strings output by GDB, including names of the source
+;; files, values of string variables in the inferior, etc., are all
+;; encoded in the same encoding. It also assumes that the \nnn
+;; sequences are not split between chunks of GDB process output due to
+;; buffering, and arrive together. When/if GDB acquires the ability
+;; to not escape-protect non-ASCII characters in its MI output, this
+;; kludge should be removed.
+(defun gdb-mi-decode (string)
+ "Decode octal escapes in MI output STRING into multibyte text."
+ (let ((coding
+ (with-current-buffer
+ (gdb-get-buffer-create 'gdb-partial-output-buffer)
+ buffer-file-coding-system)))
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert (gdb-mi-quote string))
+ (goto-char (point-min))
+ ;; gdb-mi-quote quotes the octal escapes as well, which
+ ;; interferes with their interpretation by 'read' below. Remove
+ ;; the extra backslashes to countermand that.
+ (while (re-search-forward "\\\\\\(\\\\[2-3][0-7][0-7]\\)" nil t)
+ (replace-match "\\1" nil nil))
+ (goto-char (point-min))
+ (decode-coding-string (read (current-buffer)) coding))))
(defun gud-gdbmi-marker-filter (string)
"Filter GDB/MI output."
/* True means redisplay has to redisplay the miniwindow. */
bool update_miniwindow_p = false;
+ /* True means we need to redraw frames whose 'redisplay' bit is set. */
+ bool consider_some_frames_p = false;
+
TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p));
/* No redisplay if running in batch mode or frame is not yet fully
&& !FRAME_OBSCURED_P (XFRAME (w->frame))
&& !XFRAME (w->frame)->cursor_type_changed
&& !XFRAME (w->frame)->face_change
+ && !XFRAME (w->frame)->redisplay
/* Make sure recorded data applies to current buffer, etc. */
&& this_line_buffer == current_buffer
&& match_p
#endif
/* Build desired matrices, and update the display. If
- consider_all_windows_p, do it for all windows on all frames.
- Otherwise do it for selected_window, only. */
+ consider_all_windows_p, do it for all windows on all frames. If
+ a frame's 'redisplay' flag is set, do it for all windows on each
+ such frame. Otherwise do it for selected_window, only. */
- if (consider_all_windows_p)
+ if (!consider_all_windows_p)
{
FOR_EACH_FRAME (tail, frame)
- XFRAME (frame)->updated_p = false;
+ {
+ if (XFRAME (frame)->redisplay && XFRAME (frame) != sf)
+ {
+ consider_some_frames_p = true;
+ break;
+ }
+ }
+ }
+
+ if (consider_all_windows_p || consider_some_frames_p)
+ {
+ FOR_EACH_FRAME (tail, frame)
+ {
+ if (XFRAME (frame)->redisplay || consider_all_windows_p)
+ XFRAME (frame)->updated_p = false;
+ }
propagate_buffer_redisplay ();
&& !EQ (FRAME_TTY (f)->top_frame, frame))
continue;
+ if (!consider_all_windows_p && !f->redisplay)
+ continue;
+
retry_frame:
if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
{
&& !update_mode_lines
&& !windows_or_buffers_changed
&& !f->cursor_type_changed
+ && !f->redisplay
&& NILP (Vshow_trailing_whitespace)
/* This code is not used for mini-buffer for the sake of the case
of redisplaying to replace an echo area message; since in
/* Don't try to reuse the display if windows have been split
or such. */
|| windows_or_buffers_changed
+ || f->redisplay
|| f->cursor_type_changed)
return false;
GIVE_UP (1);
/* This flag is used to prevent redisplay optimizations. */
- if (windows_or_buffers_changed || f->cursor_type_changed)
+ if (windows_or_buffers_changed || f->cursor_type_changed || f->redisplay)
GIVE_UP (2);
/* This function's optimizations cannot be used if overlays have