(dbgr-track-divert-prompt text cmdbuf to))
;; FIXME: instead of these fixed filters,
;; put into a list and iterate over that.
+ (dbgr-track-termination? text)
(setq text-sans-loc (or (dbgr-track-loc-remaining text) text))
(setq frame-num (dbgr-track-selected-frame text) text)
(setq bp-loc (dbgr-track-bp-loc text-sans-loc cmd-mark cmdbuf))
nil))
nil)
)
+
+
+(defun dbgr-track-termination?(text)
+ "Return 't and call dbgr-terminate-cmdbuf we we have a termination message"
+ (if (dbgr-cmdbuf?)
+ (let ((termination-re (dbgr-cmdbuf-pat "termination"))
+ )
+ (if (and termination-re (string-match termination-re text))
+ (progn
+ (dbgr-terminate (current-buffer))
+ 't)
+ nil)
+ )
+ )
+ )
(defun dbgr-track-divert-prompt(text cmdbuf to)
"Return a cons node of the part before the prompt-regexp and the part
:line-group 5)
)
+;; Regular expression that for a termination message.
+(setf (gethash "termination" dbgr-bashdb-pat-hash)
+ "^bashdb: That's all, folks...\n")
+
(setf (gethash "font-lock-keywords" dbgr-bashdb-pat-hash)
'(
;; The frame number and first type name, if present.
:line-group 5)
)
+;; Regular expression that for a termination message.
+(setf (gethash "termination" dbgr-kshdb-pat-hash)
+ "^kshdb: That's all, folks...\n")
+
(setf (gethash "font-lock-keywords" dbgr-kshdb-pat-hash)
'(
;; The frame number and first type name, if present.
:regexp "^Breakpoint \\([0-9]+\\) on target .* cleared\n"
:num 1))
-(defconst dbgr-remake-frame-start-regexp
- "\\(?:^\\|\n\\)")
-
(defconst dbgr-remake-selected-frame-arrow "=>"
"String that describes which frame is selected in a debugger
backtrace listing.")
;; #1 Makefile at /tmp/Makefile:230
(setf (gethash "lang-backtrace" dbgr-remake-pat-hash)
(make-dbgr-loc-pat
- :regexp (concat dbgr-remake-frame-start-regexp
+ :regexp (concat "^"
dbgr-remake-frame-num-regexp
"\\(.*\\)"
dbgr-remake-frame-file-regexp
;; #1 Makefile at /tmp/Makefile:230
(setf (gethash "debugger-backtrace" dbgr-remake-pat-hash)
(make-dbgr-loc-pat
- :regexp (concat dbgr-remake-frame-start-regexp
+ :regexp (concat "^"
dbgr-remake-frame-arrow
dbgr-remake-frame-num-regexp
"\\(.*\\)"
(setf (gethash "selected-frame-indicator" dbgr-remake-pat-hash)
dbgr-remake-selected-frame-arrow)
+;; Regular expression that for a termination message.
+(setf (gethash "termination" dbgr-remake-pat-hash)
+ "^remake: That's all, folks...\n")
+
(setf (gethash "font-lock-keywords" dbgr-remake-pat-hash)
'(
;; ;; File name and line number
(defconst dbgr-trepan-frame-file-regexp
"[ \t\n]+in file \\([^ \n]+\\)")
+(defconst dbgr-trepan-debugger-name "trepan" "Name of debugger")
+
;; Top frame number
(setf (gethash "top-frame-num" dbgr-trepan-pat-hash) 0)
:line-group 7)
)
-;; Regular expression that describes which frame is selected in
-;; a debugger backtrace listing.
-(setf (gethash "selected-frame-indicator" dbgr-trepan-pat-hash)
- dbgr-trepan-selected-frame-indicator)
+;; Regular expression that for a termination message.
+(setf (gethash "termination" dbgr-trepan-pat-hash)
+ "^trepan: That's all, folks...\n")
(setf (gethash "font-lock-keywords" dbgr-trepan-pat-hash)
'(
;; ;; (0 trepan-frames-current-frame-face append))
;; ))
-(setf (gethash "trepan" dbgr-pat-hash) dbgr-trepan-pat-hash)
+(setf (gethash dbgr-trepan-debugger-name dbgr-pat-hash) dbgr-trepan-pat-hash)
(defvar dbgr-trepan-command-hash (make-hash-table :test 'equal)
"Hash key is command name like 'quit' and the value is
(setf (gethash "quit" dbgr-trepan-command-hash) "quit!")
(setf (gethash "shell" dbgr-trepan-command-hash) "irb")
-(setf (gethash "trepan" dbgr-command-hash) dbgr-trepan-command-hash)
+(setf (gethash dbgr-trepan-debugger-name
+ dbgr-command-hash) dbgr-trepan-command-hash)
(provide-me "dbgr-trepan-")
:line-group 7)
)
+;; Regular expression that for a termination message.
+(setf (gethash "termination" dbgr-trepanx-pat-hash)
+ "^trepanx: That's all, folks...\n")
+
(setf (gethash "font-lock-keywords" dbgr-trepanx-pat-hash)
'(
;; File name and line number. E.g. at /test/gcd.rb:6
:line-group 5)
)
+;; Regular expression that for a termination message.
+(setf (gethash "termination" dbgr-zshdb-pat-hash)
+ "^zshdb: That's all, folks...\n")
+
(setf (gethash "font-lock-keywords" dbgr-zshdb-pat-hash)
'(
;; The frame number and first type name, if present.
(require 'test-unit)
(load-file "../dbgr/common/track.el")
+(load-file "../dbgr/common/core.el")
(load-file "../dbgr/debugger/trepan/init.el")
(test-unit-clear-contexts)
)
+ (specify "dbgr-track-termination?"
+ (setq debugger-output "-- (/usr/local/bin/irb:9 @2)
+require 'irb'
+")
+ (assert-nil (dbgr-track-termination? debugger-output))
+ (setq debugger-output "Really quit? (N/y) y
+trepan: That's all, folks...
+")
+ (assert-t (dbgr-track-termination? debugger-output))
+ )
+
;; (setq debugger-bp-output (format "Breakpoint %d set at line %d\n\tin file %s.\n"
;; bp-num line-number filename))
;; (setq bp-loc (dbgr-track-bp-loc debugger-bp-output nil))