]> code.delx.au - gnu-emacs-elpa/commitdiff
Clean up command handling somewhat. We now should handle custom commands via the...
authorrocky <rocky@gnu.org>
Thu, 7 Apr 2011 14:05:12 +0000 (10:05 -0400)
committerrocky <rocky@gnu.org>
Thu, 7 Apr 2011 14:05:12 +0000 (10:05 -0400)
34 files changed:
dbgr/common/backtrack-mode.el
dbgr/common/cmds.el
dbgr/common/fringe.el
dbgr/common/menu.el
dbgr/common/send.el
dbgr/common/track-mode.el
dbgr/debugger/bashdb/cmds.el [deleted file]
dbgr/debugger/bashdb/init.el
dbgr/debugger/bashdb/track-mode.el
dbgr/debugger/gdb/track-mode.el
dbgr/debugger/kshdb/cmds.el [deleted file]
dbgr/debugger/kshdb/track-mode.el
dbgr/debugger/perldb/.gitignore
dbgr/debugger/perldb/cmds.el [deleted file]
dbgr/debugger/perldb/core.el
dbgr/debugger/perldb/init.el
dbgr/debugger/perldb/perldb.el
dbgr/debugger/perldb/track-mode.el
dbgr/debugger/pydbgr/cmds.el [deleted file]
dbgr/debugger/pydbgr/track-mode.el
dbgr/debugger/rdebug/cmds.el [deleted file]
dbgr/debugger/rdebug/track-mode.el
dbgr/debugger/remake/cmds.el [deleted file]
dbgr/debugger/remake/track-mode.el
dbgr/debugger/trepan/backtrack-mode.el
dbgr/debugger/trepan/cmds.el [deleted file]
dbgr/debugger/trepan/track-mode.el
dbgr/debugger/trepanx/cmds.el [deleted file]
dbgr/debugger/trepanx/track-mode.el
dbgr/debugger/zshdb/cmds.el [deleted file]
dbgr/debugger/zshdb/track-mode.el
dbgr/lang/posix-shell.el
test/test-perldb.el [new file with mode: 0644]
test/test-track.el

index 0d5fe50356e465e99ce6c477f6fc3e900d13db57..ead6e0dfcf892fb03bb5b9777ef4f01ca78dfa81 100644 (file)
@@ -80,7 +80,6 @@ the name of the debugger which is used to preface variables."
   (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 
index 926d05977b2a8e0230f6c84d4489de7dc746af4b..bac15a7f104c5d2e68844ba217b395e282df0434 100644 (file)
@@ -1,23 +1,41 @@
-;;; 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
@@ -25,11 +43,13 @@ 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
@@ -37,74 +57,60 @@ 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))
@@ -115,11 +121,14 @@ If no argument specified use 0 or the most recent frame." t t)
       (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-")
index 6640a6ccf2aba2a642fd23b6fdbfd82fd76b426f..644304566ef09c39be0694ce9fc6a33dd298f585 100644 (file)
@@ -132,7 +132,7 @@ session which should also erase those fringe arrows."
   (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)))
@@ -140,8 +140,8 @@ session which should also erase those fringe arrows."
   )
 
 (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)))
index f11a9749475b3972e8a69df46708ddafce111b77..3a09d79dd1ebb475b964dfd2fdf08933ca96258c 100644 (file)
@@ -8,7 +8,6 @@
 ;; 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:
@@ -118,6 +117,12 @@ menu. (The common map typically contains function key bindings.)"
                      :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 "--"))
 
     ;; ;; --------------------
index aea84c5bda2632abb599d8f3e39fa862d5bb9e94..0ca157956e0de61e4d23d6a316b80b20ab468f3c 100644 (file)
@@ -196,52 +196,4 @@ debugger prompt.
        (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-")
index 43646a7e2e0fc2282d19e4918f49d0078a51a66f..2da773bfbbcaccfa6db65ad8577bda758ccb2e62 100644 (file)
@@ -125,7 +125,6 @@ the name of the debugger which is used to preface variables."
   (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 
diff --git a/dbgr/debugger/bashdb/cmds.el b/dbgr/debugger/bashdb/cmds.el
deleted file mode 100644 (file)
index 392cefb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-;;; 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-")
index e29969c53e370d28edee214366a3de244c25cc93..092ac5d6d06a4bd328ee7b6bc911f06ea1b905c7 100644 (file)
@@ -97,5 +97,12 @@ dbgr-loc-pat struct")
 
 (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-")
 
index 545accf429423a1865c5f2951ceb329b107626c3..f2232b73d351adb5b651f1073c4faa16739241b1 100644 (file)
@@ -9,7 +9,7 @@
                         "../../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)
index 652ca6bee6a6ccce0ee68e202f936c0c10cdb1ba..16ba882622550f2a0956748ade9c8436add09d13 100644 (file)
@@ -12,7 +12,6 @@
                       "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))
diff --git a/dbgr/debugger/kshdb/cmds.el b/dbgr/debugger/kshdb/cmds.el
deleted file mode 100644 (file)
index bfc2bac..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-;;; 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-")
index dc68ef478d033f029f86fd5942ddabf21b95d142..26b59dfca0f7f629fce80f8cbd3c6f77930c0384 100644 (file)
@@ -9,7 +9,7 @@
                         "../../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)
index fe154c80d980346a78285b6d3036d34e5a895430..53da3d8a4e58cf4d1600d1cdc6a7cf7ad01d7f51 100644 (file)
@@ -2,4 +2,5 @@
 /*~
 /Makefile
 /Makefile.in
+/elc-stamp
 /elc-temp
diff --git a/dbgr/debugger/perldb/cmds.el b/dbgr/debugger/perldb/cmds.el
deleted file mode 100644 (file)
index ce0f3ff..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-;;; 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-")
index 0bdeca1f30583d697cfcd0a499d5a176038bf910..479e92234340ef872659dd7a9d270584384f084e 100644 (file)
@@ -41,10 +41,10 @@ We return the a list containing
 
 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.
 "
@@ -66,7 +66,7 @@ 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)
index 495e90ea2504a81fdef0c278a7e07d92d8d04c16..ab6f1b73bbf847716477cf20b38c49d49ea7905a 100644 (file)
@@ -51,8 +51,10 @@ The values of a hash entry is a dbgr-loc-pat struct")
 (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)
index c516c331abdcbe92ce990bb60439f7fc94e33b5a..b8881a0257a1a07bfcaf8575e375e13010216a41 100644 (file)
@@ -47,7 +47,7 @@ marginal icons is reset."
         (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))
   
index aded6b831bf5cf86a1edef2057ef20c432521335..7b6b7030ab10d74f91cd6223b4f4e7d649689236 100644 (file)
@@ -10,7 +10,7 @@
                         "../../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")
 
diff --git a/dbgr/debugger/pydbgr/cmds.el b/dbgr/debugger/pydbgr/cmds.el
deleted file mode 100644 (file)
index aa06215..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-;;; 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-")
-
-
index 2cd075f17550a1cbdc7e4b1db991490ae65368c7..67e70d058c3ce6e376d94610e0441d14117cdf91 100644 (file)
@@ -11,7 +11,7 @@
                         "../../common/track-mode"
                         ) 
                       "dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-pydbgr-")
+(require-relative-list '("core" "init") "dbgr-pydbgr-")
 
 (dbgr-track-mode-vars "pydbgr")
 
diff --git a/dbgr/debugger/rdebug/cmds.el b/dbgr/debugger/rdebug/cmds.el
deleted file mode 100644 (file)
index 502e01a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-;;; 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-")
-
-
index 0750a27f2751cea87606c98c399d584e396cd158..1a49a67d1e2783c2c8d19225a8c5393e9b97a022 100644 (file)
@@ -10,7 +10,7 @@
                         "../../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")
diff --git a/dbgr/debugger/remake/cmds.el b/dbgr/debugger/remake/cmds.el
deleted file mode 100644 (file)
index 529534a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-;;; 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-")
index 3d65a8643dfba5e421585493b11bbb439b21f3c1..1f490a136669a00359251996cbdafe7d1cf9abdd 100644 (file)
@@ -9,7 +9,7 @@
                         "../../common/track-mode"
                         ) 
                       "dbgr-")
-(require-relative-list '("core" "cmds" "init") "dbgr-remake-")
+(require-relative-list '("core" "init") "dbgr-remake-")
 
 (dbgr-track-mode-vars "remake")
 
index 36e53e3d44faf4e7a096ba99f8fe84967cfa7983..037cb73b3f117747d18848842b943dd6c04a9c09 100644 (file)
@@ -10,7 +10,7 @@
                         "../../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")
diff --git a/dbgr/debugger/trepan/cmds.el b/dbgr/debugger/trepan/cmds.el
deleted file mode 100644 (file)
index def688c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-;;; 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-")
index 7deea60c1ad0bf2715d0ef0976ed48f175a5e449..6828249627d225d647eba4920a2aedf53f57e926 100644 (file)
@@ -10,7 +10,7 @@
                         "../../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")
diff --git a/dbgr/debugger/trepanx/cmds.el b/dbgr/debugger/trepanx/cmds.el
deleted file mode 100644 (file)
index 6e8fbe1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-;;; 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-")
index 5b0229d56c95f7d7be95ac58f4e932d47e9ed13a..d14e414ab33c0f9ae7db686a3809b74d6756706c 100644 (file)
@@ -10,7 +10,7 @@
                         "../../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")
diff --git a/dbgr/debugger/zshdb/cmds.el b/dbgr/debugger/zshdb/cmds.el
deleted file mode 100644 (file)
index 626cd22..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-;;; 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-")
index 05a1b1f9866988f1be3d8eed00db1ff25b88078c..f8e14480f2d7fc615c198874a385bb48a5ee7f58 100644 (file)
@@ -9,7 +9,7 @@
                         "../../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)
index a591f481325ef387845c4d980c3c12e11ba3a91c..e5b94d106046a00b853d5e39a528d71d111a6143 100644 (file)
@@ -32,11 +32,6 @@ traceback) line."  )
 (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.
 
diff --git a/test/test-perldb.el b/test/test-perldb.el
new file mode 100644 (file)
index 0000000..a852472
--- /dev/null
@@ -0,0 +1,20 @@
+(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")
+
index 730c5e699a3d0a6540aa32d6d484ecc5e7692153..beeb1dd67608bf8354381d787b4250bb963356af 100644 (file)
         (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)