Function: gud-mipsdbx-marker-filter
gud-mipsdbx-marker-filter is a byte-compiled function defined in
gud.el.gz.
Signature
(gud-mipsdbx-marker-filter STRING)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
;; This is just like the gdb one except for the regexps since we need to cope
;; with an optional breakpoint number in [] before the ^Z^Z
(defun gud-mipsdbx-marker-filter (string)
(setq gud-marker-acc (concat gud-marker-acc string))
(let ((output ""))
;; Process all the complete markers in this chunk.
(while (string-match
;; This is like th gdb marker but with an optional
;; leading break point number like `[1] '
"[][ 0-9]*\032\032\\([^:\n]*\\):\\([0-9]*\\):.*\n"
gud-marker-acc)
(setq
;; Extract the frame position from the marker.
gud-last-frame
(cons (match-string 1 gud-marker-acc)
(string-to-number (match-string 2 gud-marker-acc)))
;; Append any text before the marker to the output we're going
;; to return - we don't include the marker in this text.
output (concat output
(substring gud-marker-acc 0 (match-beginning 0)))
;; Set the accumulator to the remaining text.
gud-marker-acc (substring gud-marker-acc (match-end 0))))
;; Does the remaining text look like it might end with the
;; beginning of another marker? If it does, then keep it in
;; gud-marker-acc until we receive the rest of it. Since we
;; know the full marker regexp above failed, it's pretty simple to
;; test for marker starts.
(if (string-match "[][ 0-9]*\032.*\\'" gud-marker-acc)
(progn
;; Everything before the potential marker start can be output.
(setq output (concat output (substring gud-marker-acc
0 (match-beginning 0))))
;; Everything after, we save, to combine with later input.
(setq gud-marker-acc
(substring gud-marker-acc (match-beginning 0))))
(setq output (concat output gud-marker-acc)
gud-marker-acc ""))
output))