Function: gud-gdbmi-marker-filter

gud-gdbmi-marker-filter is a byte-compiled function defined in gdb-mi.el.gz.

Signature

(gud-gdbmi-marker-filter STRING)

Documentation

Filter GDB/MI output.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
(defun gud-gdbmi-marker-filter (string)
  "Filter GDB/MI output."

  ;; Record transactions if logging is enabled.
  (when gdb-enable-debug
    (push (cons 'recv string) gdb-debug-log)
    (when gdb-debug-log-max
      (setq gdb-debug-log (ntake gdb-debug-log-max gdb-debug-log))))

  ;; Recall the left over gud-marker-acc from last time.
  (setq gud-marker-acc (concat gud-marker-acc string))

  ;; Start accumulating output for the GUD buffer.
  (setq gdb-filter-output "")

  (let ((acc-length (length gud-marker-acc)))
    (catch 'gdbmi-incomplete-stream
      (while (and (< gdbmi-bnf-offset acc-length)
		  (funcall gdbmi-bnf-state)))))

  (when (/= gdbmi-bnf-offset 0)
    (setq gud-marker-acc (substring gud-marker-acc gdbmi-bnf-offset))
    (setq gdbmi-bnf-offset 0))

  (when (and gdbmi-debug-mode (> (length gud-marker-acc) 0))
    (message "gud-gdbmi-marker-filter, unparsed string: %s" gud-marker-acc))

  gdb-filter-output)