Function: gud-sdb-marker-filter
gud-sdb-marker-filter is a byte-compiled function defined in
gud.el.gz.
Signature
(gud-sdb-marker-filter STRING)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
(defun gud-sdb-marker-filter (string)
(setq gud-marker-acc
(if gud-marker-acc (concat gud-marker-acc string) string))
(let (start)
;; Process all complete markers in this chunk
(while
(cond
;; System V Release 3.2 uses this format
((string-match "\\(^\\|\n\\)\\*?\\(0x\\w* in \\)?\\([^:\n]*\\):\\([0-9]*\\):.*\n"
gud-marker-acc start)
(setq gud-last-frame
(cons (match-string 3 gud-marker-acc)
(string-to-number (match-string 4 gud-marker-acc)))))
;; System V Release 4.0 quite often clumps two lines together
((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):"
gud-marker-acc start)
(setq gud-sdb-lastfile (match-string 2 gud-marker-acc))
(setq gud-last-frame
(cons gud-sdb-lastfile
(string-to-number (match-string 3 gud-marker-acc)))))
;; System V Release 4.0
((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n"
gud-marker-acc start)
(setq gud-sdb-lastfile (match-string 2 gud-marker-acc)))
((and gud-sdb-lastfile (string-match "^\\([0-9]+\\):"
gud-marker-acc start))
(setq gud-last-frame
(cons gud-sdb-lastfile
(string-to-number (match-string 1 gud-marker-acc)))))
(t
(setq gud-sdb-lastfile nil)))
(setq start (match-end 0)))
;; Search for the last incomplete line in this chunk
(while (string-match "\n" gud-marker-acc start)
(setq start (match-end 0)))
;; If we have an incomplete line, store it in gud-marker-acc.
(setq gud-marker-acc (substring gud-marker-acc (or start 0))))
string)