(funcall (intern (concat "dbgr-define-" name "-commands")))
(if (intern (concat name "-backtrack-mode"))
(progn
- (dbgr-define-gdb-like-commands) ;; FIXME: unless already defined
(dbgr-backtrack-mode 't)
(run-mode-hooks (intern (concat name "-backtrack-mode-hook"))))
(progn
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
+;;; Copyright (C) 2010, 2011 Rocky Bernstein <rocky@gnu.org>
(require 'load-relative)
(require-relative-list '("send") "dbgr-")
(require-relative-list '("buffer/command") "dbgr-buffer-")
(declare-function dbgr-terminate &optional cmdbuf)
-;; Note dbgr-define-command docstrings may appear in menu help, but only
-;; the first line will appears. So be careful about where to put line
-;; breaks in the docstrings below.
-(defun dbgr-define-gdb-like-commands ()
+(defun dbgr-cmd-remap(arg cmd-name default-cmd-template key
+ &optional no-record? frame-switch? dbgr-prompts?)
+ "Run debugger command CMD-NAME using DEFAULT-CMD-TEMPLATE
+if none has been set in the command hash."
+ (let ((buffer (current-buffer))
+ (cmdbuf (dbgr-get-cmdbuf))
+ (cmd-hash)
+ (cmd)
+ )
+ (with-current-buffer-safe cmdbuf
+ (dbgr-cmdbuf-info-in-srcbuf?= dbgr-cmdbuf-info
+ (not (dbgr-cmdbuf? buffer)))
+ (setq cmd-hash (dbgr-cmdbuf-info-cmd-hash dbgr-cmdbuf-info))
+ (unless (and cmd-hash (setq cmd (gethash cmd-name cmd-hash)))
+ (setq cmd default-cmd-template))
+ )
+ (dbgr-command cmd arg no-record? frame-switch? dbgr-prompts?)
+ )
+ ;; FIXME: this is a one-time thing. Put in caller.
+ (local-set-key (format "\C-c%s" key)
+ (intern (format "dbgr-cmd-%s" cmd-name)))
+ )
- "Define a bunch of gdb-command that we expect most debuggers to have"
- (dbgr-define-command
- 'break "break %X:%l" "\C-b"
- "Set a breakpoint at the current line")
+(defun dbgr-cmd-break(arg)
+ "Set a breakpoint at the current line"
+ (interactive "p")
+ (dbgr-cmd-remap arg "break" "break %X:l" "b")
+ )
- (dbgr-define-command
- 'step "step %p" "s"
- "Step one source line.
+(defun dbgr-cmd-step(&optional arg)
+ "Step one source line.
With a numeric argument, step that many times.
This command is often referred to as 'step into' as opposed to
The definition of 'step' is debugger specific so, see the
debugger documentation for a more complete definition of what is
-getting stepped.")
+getting stepped."
+ (interactive "p")
+ (dbgr-cmd-remap arg "step" "step %p" "s")
+)
- (dbgr-define-command
- 'next "next %p" "n"
- "Step one source line at current call level.
+(defun dbgr-cmd-next(&optional arg)
+ "Step one source line at current call level.
With a numeric argument, step that many times. This command is
often referred to as 'step through' as opposed to 'step into' or
The definition of 'step' is debugger specific so, see the
debugger documentation for a more complete definition of what is
-getting stepped.")
+getting stepped."
+ (interactive "p")
+ (dbgr-cmd-remap arg "next" "next %p" "n")
+)
- (dbgr-define-command
- 'finish "finish" "F"
- "Run until the completion of the current stack frame.
+(defun dbgr-cmd-finish(&optional arg)
+ "Run until the completion of the current stack frame.
This command is often referred to as 'step out' as opposed to
'step over' or 'step into'.
-")
-
- (dbgr-define-command
- 'newer-frame "down %p" "<"
-"Move the current frame to a newer (more recent) frame.
-
-With a numeric argument move that many levels forward." t t)
-
- (dbgr-define-command
- 'older-frame "up %p" ">"
-"Move the current frame to an older (less recent) frame.
-
-With a numeric argument move that many levels back." t t)
-
- (dbgr-define-command
- 'frame "frame %p" "f"
-"Change the current frame number to the value of the numeric argument.
-
-If no argument specified use 0 or the most recent frame." t t)
+"
+ (interactive "p")
+ (dbgr-cmd-remap arg "finish" "finish" "F")
+)
- (dbgr-define-command
- 'continue "continue" "c"
- "Continue execution.")
+(defun dbgr-cmd-newer-frame(&optional arg)
+ "Move the current frame to a newer (more recent) frame.
+With a numeric argument move that many levels forward."
+ (interactive "p")
+ (dbgr-cmd-remap arg "down" "down %p" "<" t t)
+)
- (dbgr-define-command
- 'restart "run" "R"
- "Restart execution."
- 't nil 't)
+(defun dbgr-cmd-older-frame(&optional arg)
+ "Move the current frame to an older (less recent) frame.
+With a numeric argument move that many levels back."
+ (interactive "p")
+ (dbgr-cmd-remap arg "up" "up %p" ">" t t)
+)
- (dbgr-define-command
- 'restart "shell" "S"
- "Run an interactive shell using the current environment."
- 't nil 't)
+(defun dbgr-cmd-frame(&optional arg)
+ "Change the current frame number to the value of the numeric argument.
+If no argument specified use 0 or the most recent frame."
+ (dbgr-cmd-remap arg "frame" "frame %p" "f" t t)
+)
- (defun dbgr-cmd-quit (arg)
- "Gently terminate execution of the debugged program."
+(defun dbgr-cmd-continue(&optional arg)
+ "Continue execution."
(interactive "p")
- (let ((buffer (current-buffer))
- (cmdbuf (dbgr-get-cmdbuf))
- (cmd-hash)
- (cmd)
- )
- (with-current-buffer-safe cmdbuf
- (dbgr-cmdbuf-info-in-srcbuf?= dbgr-cmdbuf-info
- (not (dbgr-cmdbuf? buffer)))
- (setq cmd-hash (dbgr-cmdbuf-info-cmd-hash dbgr-cmdbuf-info))
- (unless (and cmd-hash (setq cmd (gethash "quit" cmd-hash)))
- (setq cmd "quit"))
- )
- (dbgr-command cmd arg 't)
- (if cmdbuf (dbgr-terminate cmdbuf))
- )
- )
+ (dbgr-cmd-remap arg "continue" "continue" "c")
+)
- (local-set-key "\C-cq" 'dbgr-cmd-quit)
+(defun dbgr-cmd-restart(&optional arg)
+ "Restart execution."
+ (interactive "p")
+ (dbgr-cmd-remap arg "restart" "run" "R" 't nil 't)
)
+(defun dbgr-cmd-shell(&optional arg)
+ "Restart execution."
+ (dbgr-cmd-remap arg "shell" "shell" "S")
+)
-(defun dbgr-cmd-break(arg)
- "Set a breakpoint at the current line"
+(defun dbgr-cmd-quit (&optional arg)
+ "Gently terminate execution of the debugged program."
(interactive "p")
(let ((buffer (current-buffer))
(cmdbuf (dbgr-get-cmdbuf))
(dbgr-cmdbuf-info-in-srcbuf?= dbgr-cmdbuf-info
(not (dbgr-cmdbuf? buffer)))
(setq cmd-hash (dbgr-cmdbuf-info-cmd-hash dbgr-cmdbuf-info))
- (unless (and cmd-hash (setq cmd (gethash "break" cmd-hash)))
- (setq cmd "break %X:%l"))
+ (unless (and cmd-hash (setq cmd (gethash "quit" cmd-hash)))
+ (setq cmd "quit"))
)
(dbgr-command cmd arg 't)
+ (if cmdbuf (dbgr-terminate cmdbuf))
)
)
+(local-set-key "\C-cq" 'dbgr-cmd-quit)
+
(provide-me "dbgr-")
(setq dbgr-overlay-arrow3 nil))
(defun dbgr-recenter-arrow1()
- "If the current buffer conntains dbgr-overlay-arrow1 go to that position"
+ "If the current buffer contains dbgr-overlay-arrow1 go to that position"
(interactive "")
(if (and dbgr-overlay-arrow1
(eq (marker-buffer dbgr-overlay-arrow1) (current-buffer)))
)
(defun dbgr-recenter-arrow()
- "If the current buffer conntains dbgr-overlay-arrows 1, 2 or 3
- recenter that"
+ "If the current buffer contains dbgr-overlay-arrows 1, 2 or 3
+ recenter window to show that"
(interactive "")
(if (and dbgr-overlay-arrow1
(eq (marker-buffer dbgr-overlay-arrow1) (current-buffer)))
;; We want the doc strings from gdb-like commands for our help
;; menus.
(require-relative-list '("cmds") "dbgr-")
-(dbgr-define-gdb-like-commands)
;; Note: We want the key binding to show in the menu. However, our
;; situation is a little bit complex:
:help (documentation 'dbgr-cmd-restart)
))
+ (define-key menu-map [recenter]
+ (dbgr-menu-item menu-map "recenter" 'dbgr-recenter-arrow
+ :enable '(dbgr-get-process)
+ :help (documentation 'dbgr-recenter-arrow)
+ ))
+
(define-key menu-map [menu-bar debugger line2] '(menu-item "--"))
;; ;; --------------------
(dbgr-cmdbuf-info-frame-switch?= dbgr-cmdbuf-info nil)
))))
-(defmacro dbgr-define-command (func cmd &optional key doc no-record?
- frame-switch? dbgr-prompts?)
- "Define symbol name dbgr-cmd-FUNC to be a command sending
-string CMD to dbgr-command. If KEY is not nil, the command is
-bound to that. DOC gives the document string for the command.
-NO-RECORD?, FRAME-SWITCH? and DBGR-PROMPTS? are optional
-parameters that are passed to `dbgr-command'. See that for their
-meanings."
- (declare (indent 1) (debug t))
-;; Here is a sample expansion of the below for
-;; dbgr-define-command('foo", "bar", "f", "This documents dbgr-cmd-foo.")
-;;
-;; (defun dbgr-cmd-foo (arg &optional save-history?)
-;; "This documents the dbgr-cmd-foo."
-;; (interactive "p")
-;; (let ((buffer (current-buffer))
-;; (cmdbuf (dbgr-get-cmdbuf))
-;; (cmd-hash)
-;; (cmd))
-;; (with-current-buffer-safe cmdbuf
-;; (dbgr-cmdbuf-info-in-srcbuf?= dbgr-cmdbuf-info
-;; (not (dbgr-cmdbuf? buffer))))
-;; (dbgr-command "bar" arg no-record? frame-switch?))
-;; )
-;; (local-set-key "\C-cf" 'dbgr-cmd-foo)
- `(progn
- (fset (intern (concat "dbgr-cmd-" (symbol-name ,func)))
- (lambda(arg &optional no-record? frame-switch? dbgr-prompts?)
- ,doc
- (interactive "p")
- (let ((buffer (current-buffer))
- (cmdbuf (dbgr-get-cmdbuf))
- (cmd-hash)
- (cmd))
- (with-current-buffer-safe cmdbuf
- (dbgr-cmdbuf-info-in-srcbuf?= dbgr-cmdbuf-info
- (not (dbgr-cmdbuf? buffer)))
- (setq cmd-hash (dbgr-cmdbuf-info-cmd-hash dbgr-cmdbuf-info))
- (unless (and cmd-hash (setq cmd (gethash ,cmd cmd-hash)))
- (setq cmd ,cmd ))
- )
- (dbgr-command cmd arg ,no-record? ,frame-switch?
- ,dbgr-prompts?))))
- ,(if key `(local-set-key ,(concat "\C-c" key)
- (intern (concat "dbgr-cmd-" (symbol-name ,func)))))
- ;; ,(if key `(global-set-key (vconcat dbgr-key-prefix ,key) ',func))
- ))
-
(provide-me "dbgr-")
(funcall (intern (concat "dbgr-define-" name "-commands")))
(if (intern (concat name "-track-mode"))
(progn
- (dbgr-define-gdb-like-commands) ;; FIXME: unless already defined
(dbgr-track-mode 't)
(run-mode-hooks (intern (concat name "-track-mode-hook"))))
(progn
+++ /dev/null
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-terminate &optional arg)
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-bashdb-commands ()
- "(Re)define a bunch of bashdb commands"
- (dbgr-define-gdb-like-commands)
- )
-
-(defvar dbgr-bashdb-command-hash (make-hash-table :test 'equal)
- "Hash key is command name like 'quit' and the value is
- the bashdb command to use, like 'quit!'")
-
-(setf (gethash "quit" dbgr-bashdb-command-hash) "quit!")
-(setf (gethash "bashdb" dbgr-command-hash dbgr-bashdb-command-hash))
-
-(provide-me "dbgr-bashdb-")
(setf (gethash "bashdb" dbgr-pat-hash) dbgr-bashdb-pat-hash)
+(defvar dbgr-bashdb-command-hash (make-hash-table :test 'equal)
+ "Hash key is command name like 'quit' and the value is
+ the bashdb command to use, like 'quit!'")
+
+(setf (gethash "quit" dbgr-bashdb-command-hash) "quit!")
+(setf (gethash "bashdb" dbgr-command-hash dbgr-bashdb-command-hash))
+
(provide-me "dbgr-bashdb-")
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-bashdb-")
+(require-relative-list '("core" "init") "dbgr-bashdb-")
(dbgr-track-mode-vars "bashdb")
(dbgr-posix-shell-populate-command-keys bashdb-track-mode-map)
"dbgr-")
(require-relative-list '("core" "init") "dbgr-gdb-")
-(defalias 'dbgr-define-dbgr-gdb-commands 'dbgr-define-gdb-like-commands)
(dbgr-track-mode-vars "dbgr-gdb")
(declare-function dbgr-track-mode(bool))
+++ /dev/null
-;;; Copyright (C) 2010, 2011 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-terminate &optional arg)
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-kshdb-commands ()
- "(Re)define a bunch of kshdb commands"
- (dbgr-define-gdb-like-commands)
- )
-
-(defvar dbgr-kshdb-command-hash (make-hash-table :test 'equal)
- "Hash key is command name like 'quit' and the value is
- the trepan command to use, like 'quit!'")
-
-(setf (gethash "quit" dbgr-kshdb-command-hash) "quit!")
-(setf (gethash "kshdb" dbgr-command-hash dbgr-kshdb-command-hash))
-
-;; Break can only handle line number right now.
-(setf (gethash "break" dbgr-kshdb-command-hash) "break %l")
-
-(provide-me "dbgr-kshdb-")
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-kshdb-")
+(require-relative-list '("core" "init") "dbgr-kshdb-")
(dbgr-track-mode-vars "kshdb")
(dbgr-posix-shell-populate-command-keys kshdb-track-mode-map)
/*~
/Makefile
/Makefile.in
+/elc-stamp
/elc-temp
+++ /dev/null
-;;; Copyright (C) 2011 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send" "../../common/track") "dbgr-")
-
-(declare-function dbgr-terminate &optional arg)
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-perldb-commands ()
- "(Re)define a bunch of trepan commands"
- (dbgr-define-gdb-like-commands)
-)
-
-(provide-me "dbgr-perldb-")
For example for the following input
(map 'list 'symbol-name
- '(perl -W -C /tmp perldb --emacs ./gcd.rb a b))
+ '(perl -W -C /tmp -d ./gcd.rb a b))
we might return:
- ((perl -W -C) (./gcd.rb a b))
+ ((perl -W -C -d) (./gcd.rb a b))
NOTE: the above should have each item listed in quotes.
"
(interp-regexp
(if (member system-type (list 'windows-nt 'cygwin 'msdos))
"^perl\\(?:5[0-9.]*\\)\\(.exe\\)?$"
- "^perl\\(?:5[0-9.]*\\)$"))
+ "^perl\\(?:5[0-9.]*\\)?$"))
;; Things returned
(script-name nil)
(setf (gethash "break" dbgr-perldb-command-hash) "b %l")
(setf (gethash "continue" dbgr-perldb-command-hash) "c")
(setf (gethash "quit" dbgr-perldb-command-hash) "q")
+(setf (gethash "restart" dbgr-perldb-command-hash) "R")
(setf (gethash "run" dbgr-perldb-command-hash) "R")
(setf (gethash "step" dbgr-perldb-command-hash) "s")
+(setf (gethash "next" dbgr-perldb-command-hash) "n")
(setf (gethash "perldb" dbgr-command-hash) dbgr-perldb-command-hash)
(setf (gethash "perldb" dbgr-pat-hash) dbgr-perldb-pat-hash)
(cmd-str (or opt-command-line (dbgr-perldb-query-cmdline "perldb")))
(cmd-args (split-string-and-unquote cmd-str))
(parsed-args (dbgr-perldb-parse-cmd-args cmd-args))
- (script-args (cdr cmd-args))
+ (script-args (cadr parsed-args))
(script-name (car script-args))
(cmd-buf))
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-perldb-")
+(require-relative-list '("core" "init") "dbgr-perldb-")
(dbgr-track-mode-vars "dbgr-perldb")
+++ /dev/null
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-pydbgr-commands ()
- "(Re)define a bunch of pydbgr commands have."
- (dbgr-define-gdb-like-commands)
- )
-
-(provide-me "dbgr-pydbgr-")
-
-
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-pydbgr-")
+(require-relative-list '("core" "init") "dbgr-pydbgr-")
(dbgr-track-mode-vars "pydbgr")
+++ /dev/null
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-rdebug-commands ()
- "(Re)define a bunch of rdebug commands have"
- (dbgr-define-gdb-like-commands)
- ;; (dbgr-define-command
- ;; 'break "break %l" "\C-b"
- ;; "Set a breakpoint at the current line" t nil)
- )
-
-(provide-me "dbgr-rdebug-")
-
-
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-rdebug-")
+(require-relative-list '("core" "init") "dbgr-rdebug-")
(require-relative-list '("../../lang/ruby") "dbgr-lang-")
(dbgr-track-mode-vars "rdebug")
+++ /dev/null
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-terminate &optional arg)
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-remake-commands ()
- "(Re)define a bunch of remake commands"
- (dbgr-define-gdb-like-commands)
-)
-
-(provide-me "dbgr-remake-")
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-remake-")
+(require-relative-list '("core" "init") "dbgr-remake-")
(dbgr-track-mode-vars "remake")
"../../common/backtrack-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-trepan-")
+(require-relative-list '("core" "init") "dbgr-trepan-")
(require-relative-list '("../../lang/ruby") "dbgr-lang-")
(dbgr-backtrack-mode-vars "trepan")
+++ /dev/null
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-terminate &optional arg)
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-trepan-commands ()
- "(Re)define a bunch of trepan commands have"
- ;; trepan doesn't allow for the more general file:line breakpoint yet.
- (dbgr-define-gdb-like-commands)
-)
-
-(provide-me "dbgr-trepan-")
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-trepan-")
+(require-relative-list '("core" "init") "dbgr-trepan-")
(require-relative-list '("../../lang/ruby") "dbgr-lang-")
(dbgr-track-mode-vars "trepan")
+++ /dev/null
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-define-gdb-like-commands())
-
-(defun dbgr-define-trepanx-commands ()
- "(Re)define a bunch of trepanx commands have"
- (dbgr-define-gdb-like-commands)
- )
-
-(provide-me "dbgr-trepanx-")
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-trepanx-")
+(require-relative-list '("core" "init") "dbgr-trepanx-")
(require-relative-list '("../../lang/ruby") "dbgr-lang-")
(dbgr-track-mode-vars "trepanx")
+++ /dev/null
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
-(require 'load-relative)
-(require-relative-list
- '("../../common/send") "dbgr-")
-
-(declare-function dbgr-terminate &optional arg)
-(declare-function dbgr-define-gdb-like-commands())
-
-(defvar dbgr-zshdb-command-hash (make-hash-table :test 'equal)
- "Hash key is command name like 'quit' and the value is
- the trepan command to use, like 'quit!'")
-
-(setf (gethash "quit" dbgr-zshdb-command-hash) "quit!")
-(setf (gethash "zshdb" dbgr-command-hash dbgr-zshdb-command-hash))
-
-(local-set-key "\C-cq" 'dbgr-cmd-quit)
-
-(provide-me "dbgr-zshdb-")
"../../common/track-mode"
)
"dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-zshdb-")
+(require-relative-list '("core" "init") "dbgr-zshdb-")
(dbgr-track-mode-vars "zshdb")
(dbgr-posix-shell-populate-command-keys zshdb-track-mode-map)
(defconst dbgr-shell-frame-line-regexp
"[ \t\n]+at line \\([0-9]+\\)\\(?:\n\\|$\\)")
-(dbgr-define-command
- 'shell "shell" "s"
- "Go into the shell with the current environment"
- )
-
(defun dbgr-posix-shell-populate-command-keys (&optional map)
"Bind the debugger function key layout used by many debuggers.
--- /dev/null
+(require 'test-unit)
+(load-file "../dbgr/debugger/perldb/perldb.el")
+
+(test-unit-clear-contexts)
+
+(context "perldb"
+ (tag perldb)
+
+ (specify "dbgr-perldb-parse-cmd-args"
+ (assert-equal '(("perl" "-W" "-d") ("gcd.rb" "a" "b"))
+ (dbgr-perldb-parse-cmd-args
+ '("perl" "-W" "-d" "gcd.rb" "a" "b")))
+ (assert-equal '(("perl5.10.1" "-C" "/tmp" "-d") ("gcd.rb"))
+ (dbgr-perldb-parse-cmd-args
+ '("perl5.10.1" "-C" "/tmp" "-d" "gcd.rb")))
+ )
+ )
+
+(test-unit "perldb")
+
(setq line-number 7)
(setq debugger-output (format "-> (%s:%d)\n(trepan):\n"
filename line-number))
- (setq loc (dbgr-track-loc debugger-output nil))
-
- (specify "loc extracted"
- (assert-equal t (dbgr-loc-p loc)))
- (specify "loc-remaining"
- (assert-equal "\n(trepan):\n"
- (dbgr-track-loc-remaining debugger-output)))
- (specify "loc filename extracted"
- (assert-equal filename (dbgr-loc-filename loc)))
- (specify "loc line-number extracted"
- (assert-equal line-number (dbgr-loc-line-number loc)))
-
- (setq bp-num 2)
- (setq debugger-bp-output (format "Breakpoint %d set at line %d\n\tin file %s,\n"
- bp-num line-number filename))
- (setq loc (dbgr-track-bp-loc debugger-bp-output nil))
-
- (specify "bp-loc extracted"
- (assert-t (dbgr-loc-p loc))
- (assert-equal bp-num (dbgr-loc-num loc)))
-
- (specify "dbgr-track-divert-prompt"
- (dbgr-cmdbuf-info-divert-output?= dbgr-cmdbuf-info 't)
- (setq dbgr-track-divert-string "")
- (setq text
- "--> #0 TOP Object#<top /usr/local/bin/irb> in file /usr/local/bin/irb at line 9\n(trepan): ")
- (setq dbgr-last-output-start (point-max))
- (dbgr-track-divert-prompt text (current-buffer) (point-max))
- (assert-equal "--> #0 TOP Object#<top /usr/local/bin/irb> in file /usr/local/bin/irb at line 9\n"
- dbgr-track-divert-string)
- (assert-equal nil (dbgr-sget 'cmdbuf-info 'divert-output?))
- )
+ (lexical-let ((loc (dbgr-track-loc debugger-output nil)))
+ (specify "loc extracted"
+ (assert-t (dbgr-loc-p loc)))
+ (specify "loc-remaining"
+ (assert-equal "\n(trepan):\n"
+ (dbgr-track-loc-remaining debugger-output)))
+ (specify "loc filename extracted"
+ (assert-equal filename (dbgr-loc-filename loc)))
+ (specify "loc line-number extracted"
+ (assert-equal line-number (dbgr-loc-line-number loc)))
+ )
+ ;; (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))
+ ;; (setq bp-num 2)
+
+ ;; (specify "bp-loc extracted"
+ ;; (message "output: %s" debugger-bp-output)
+ ;; (message "bp-loc: %s" bp-loc)
+ ;; (message "bp-num: %d" bp-num)
+ ;; (assert-t (dbgr-loc-p bp-loc))
+ ;; (assert-equal bp-num (dbgr-loc-num bp-loc)))
+
+ ;; (specify "dbgr-track-divert-prompt"
+ ;; (dbgr-cmdbuf-info-divert-output?= dbgr-cmdbuf-info 't)
+ ;; (setq dbgr-track-divert-string "")
+ ;; (setq text
+ ;; "--> #0 TOP Object#<top /usr/local/bin/irb> in file /usr/local/bin/irb at line 9\n(trepan): ")
+ ;; (setq dbgr-last-output-start (point-max))
+ ;; (dbgr-track-divert-prompt text (current-buffer) (point-max))
+ ;; (assert-equal "--> #0 TOP Object#<top /usr/local/bin/irb> in file /usr/local/bin/irb at line 9\n"
+ ;; dbgr-track-divert-string)
+ ;; (assert-equal nil (dbgr-sget 'cmdbuf-info 'divert-output?))
+ ;; )
(specify "invalid cmdbuf"
(makunbound 'dbgr-cmdbuf-info)