]> code.delx.au - gnu-emacs-elpa/commitdiff
Breakpoint text for trepan and trepanx have changed. Other small changes.
authorrocky <rocky@gnu.org>
Tue, 5 Apr 2011 18:28:31 +0000 (14:28 -0400)
committerrocky <rocky@gnu.org>
Tue, 5 Apr 2011 18:28:31 +0000 (14:28 -0400)
dbgr/common/cmds.el
dbgr/common/key.el
dbgr/common/shortkey.el
dbgr/debugger/gdb/init.el
dbgr/debugger/kshdb/init.el
dbgr/debugger/pydbgr/init.el
dbgr/debugger/rdebug/init.el
dbgr/debugger/trepan/init.el
dbgr/debugger/trepanx/init.el
test/test-regexp-trepan.el
test/test-regexp-trepanx.el

index 633207e51a617b2974616b75bc811a656b00dc9b..e4c5fc37fc7a88e1decece641ef4a693d276f406 100644 (file)
@@ -65,7 +65,7 @@ With a numeric argument move that many levels back." t t)
 If no argument specified use 0 or the most recent frame." t t)
 
   (dbgr-define-command 
-      'continue "continue %p" "c" 
+      'continue "continue" "c" 
       "Continue execution.")
 
   (dbgr-define-command 
@@ -73,31 +73,10 @@ If no argument specified use 0 or the most recent frame." t t)
       "Restart execution."
       't nil 't)
 
-  (defun dbgr-cmd-step(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
-'step over' or 'step out'.
-
-The definition of 'step' is debugger specific so, see the
-debugger documentation for a more complete definition of what is
-getting stepped."
-    (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 "step" cmd-hash)))
-         (setq cmd "step %p"))
-       )
-      (dbgr-command cmd arg 't)
-      ))
+  (dbgr-define-command 
+      'restart "shell" "S" 
+      "Run an interactive shell using the current environment."
+      't nil 't)
 
   (defun dbgr-cmd-quit (arg)
     "Gently terminate execution of the debugged program."
index 26b7117c34261b45d47c0eaf859fb9e1273693b9..d518153f16d434d066d23e32367e2dd3c84d3752 100644 (file)
@@ -1,4 +1,4 @@
-;;; Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
+;;; Copyright (C) 2010, 2011 Rocky Bernstein <rocky@gnu.org>
 (require 'load-relative)
 
 (defcustom dbgr-populate-common-fn-keys-function
@@ -87,6 +87,7 @@ Nor does it touch prefix keys; for that see `dbgr-populate-keys-standard'"
     (define-key map "r" 'dbgr-cmd-restart)
     (define-key map "R" 'dbgr-cmd-restart)
     (define-key map "s" 'dbgr-cmd-step)
+    (define-key map "S" 'dbgr-cmd-shell)
     (define-key map [M-down]    'dbgr-track-hist-newer)
     (define-key map [M-kp-2]    'dbgr-track-hist-newer)
     (define-key map [M-up]      'dbgr-track-hist-older)
index 9d8e7b79b9cd0d18e0e83c4a76d30c80b8afa80a..a0e2d1b3e989ff973905d9de2d9cf2658b0b9613 100644 (file)
   (kbd "b") 'dbgr-cmd-break)
 (define-key dbgr-short-key-mode-map
   (kbd "c") 'dbgr-cmd-continue)
+(define-key dbgr-short-key-mode-map
+  (kbd "S") 'dbgr-cmd-shell)
+(define-key dbgr-short-key-mode-map
+  (kbd "R") 'dbgr-cmd-restart)
 (define-key dbgr-short-key-mode-map [insert] 'dbgr-short-key-mode)
 (define-key dbgr-short-key-mode-map [M-insert] 'dbgr-short-key-mode)
 (dbgr-populate-common-keys dbgr-short-key-mode-map)
index fa675969eb43a2307128758d78e2f3c2da8af5ec..76ec45f191822d8c0e0aa0d7ec1282019d4d5a74 100644 (file)
@@ -52,4 +52,3 @@ dbgr-loc-pat struct")
 (setf (gethash "gdb" dbgr-pat-hash) dbgr-gdb-pat-hash)
 
 (provide-me "dbgr-gdb-")
-
index b545f6751d4a9695b1a3e66b6a68fc4a5deee619..ac22d1bec3af68ff72b466a04740486aa6dd32d2 100644 (file)
@@ -98,4 +98,13 @@ dbgr-loc-pat struct")
 
 (setf (gethash "kshdb" dbgr-pat-hash) dbgr-kshdb-pat-hash)
 
+(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))
+
+(setf (gethash "kshdb" dbgr-pat-hash) dbgr-kshdb-pat-hash)
+
 (provide-me "dbgr-kshdb-")
index 356713422d8154d04107e4a9716f68533dbcf467..e02e8b0b0790a8de631e01644c420be440e77bbc 100644 (file)
@@ -89,4 +89,12 @@ dbgr-loc-pat struct")
 
 (setf (gethash "pydbgr" dbgr-pat-hash) dbgr-pydbgr-pat-hash)
 
+(defvar dbgr-pydbgr-command-hash (make-hash-table :test 'equal)
+  "Hash key is command name like 'quit' and the value is 
+  the pydbgr command to use, like 'quit!'")
+
+(setf (gethash "quit" dbgr-pydbgr-command-hash) "quit!")
+(setf (gethash "shell" dbgr-pydbgr-command-hash) "python")
+(setf (gethash "pydbgr" dbgr-command-hash) dbgr-pydbgr-command-hash)
+
 (provide-me "dbgr-pydbgr-")
index c2aa7b61a5eaad57cb70691bda8fcb2199fab2a7..be668fe4070a97c69be26f12ac420b52239087b3 100644 (file)
@@ -116,4 +116,12 @@ dbgr-loc-pat struct")
 
 (setf (gethash "rdebug" dbgr-pat-hash) dbgr-rdebug-pat-hash)
 
+(defvar dbgr-rdebug-command-hash (make-hash-table :test 'equal)
+  "Hash key is command name like 'quit' and the value is 
+  the trepanx command to use, like 'quit!'")
+
+(setf (gethash "quit" dbgr-rdebug-command-hash) "quit!")
+(setf (gethash "shell" dbgr-rdebug-command-hash) "irb")
+(setf (gethash "trepan" dbgr-command-hash) dbgr-rdebug-command-hash)
+
 (provide-me "dbgr-rdebug-")
index 456b54b64e4f1e9b6f05613b18083d8f9f13f0b5..6b70117b43409f8a078a81693b57b45ac5073e94 100644 (file)
@@ -49,7 +49,7 @@ dbgr-loc-pat struct")
 ;;     line 64 in file /src/external-vcs/linecache/trunk/lib/linecache.rb.
 (setf (gethash "brkpt-set" dbgr-trepan-pat-hash)
       (make-dbgr-loc-pat
-       :regexp "^Breakpoint \\([0-9]+\\) set at line \\([0-9]+\\)[ \t\n]+in file \\(.+\\),\n"
+       :regexp "^Breakpoint \\([0-9]+\\) set at .*[\n\t ]+line \\([0-9]+\\)[ \t\n]+in file \\(.+\\)."
        :num 1
        :file-group 3
        :line-group 2))
@@ -163,6 +163,7 @@ dbgr-loc-pat struct")
   the trepan command to use, like 'quit!'")
 
 (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)
 
 (provide-me "dbgr-trepan-")
index 7690e42633177aef32487dd59936784d85d062bd..66fe395bf042a0ecd62e4f94ed77dac962ff2d13 100644 (file)
@@ -47,7 +47,7 @@ dbgr-loc-pat struct")
 ;; Set breakpoint 1: /tmp/fact.rb:1 (@0)
 (setf (gethash "brkpt-set" dbgr-trepanx-pat-hash)
       (make-dbgr-loc-pat
-       :regexp "^Breakpoint \\([0-9]+\\): \\(.+\\):\\([0-9]+\\) (@[0-9]+)\n"
+       :regexp "^Set breakpoint \\([0-9]+\\): .+ at \\(.+\\):\\([0-9]+\\) (@[0-9]+)"
        :num 1
        :file-group 2
        :line-group 3))
@@ -121,4 +121,14 @@ dbgr-loc-pat struct")
        ;;  (0 trepan-frames-current-frame-face append))
        ))
 
+(setf (gethash "trepanx" dbgr-pat-hash) dbgr-trepanx-pat-hash)
+
+(defvar dbgr-trepanx-command-hash (make-hash-table :test 'equal)
+  "Hash key is command name like 'quit' and the value is 
+  the trepanx command to use, like 'quit!'")
+
+(setf (gethash "quit" dbgr-trepanx-command-hash) "quit!")
+(setf (gethash "shell" dbgr-trepanx-command-hash) "irb")
+(setf (gethash "trepan" dbgr-command-hash) dbgr-trepanx-command-hash)
+
 (provide-me "dbgr-trepanx-")
index 390a5b61b1c9b4c1f1642e607d169fa8f457f655..e78911e0a6b0f46adc7c3b961dc06e986dd74fa7 100644 (file)
@@ -91,9 +91,9 @@
                                  )
                    )
           
-          (lexical-let ((text "Breakpoint 1 set at line 9
-       in file /usr/local/bin/irb,
-       VM offset 2 of instruction sequence <top (required)>."))
+          (lexical-let ((text "Breakpoint 1 set at VM offset 2 of instruction sequence \"<top /usr/local/bin/irb>\",
+       line 9 in file /usr/local/bin/irb.
+"))
             (specify "basic breakpoint location"
                      (assert-t (numberp (loc-match text bps-pat))))
             (specify "extract breakpoint file name"
index fe85c4533e6b8036ade93c2ecb8ddfc971d9d6fc..1243ad0b850ac85ad7551264f2ef9dcfadebd015 100644 (file)
 ;;        setq however will workaround this.
 (setq text " \e[0;31m                       Object#boom at tmp/boom.rb:2\e[0m")
 
-(context "traceback location matching"
-        (tag regexp-trepanx)
-        (specify "basic traceback location"
-                 (assert-t (numberp (tb-loc-match text))))
-        (specify "extract traceback file name"
-                 (assert-equal 0 (tb-loc-match text))
-                 (assert-equal "tmp/boom.rb"
-                               (match-string (dbgr-loc-pat-file-group tb)
-                                             text))
-                 (setq text 
-                       "            { } in main.__script__ at /tmp/blam.rb:5")
-                 (assert-equal 0 (tb-loc-match text))
-                 (assert-equal "/tmp/blam.rb"
-                               (match-string (dbgr-loc-pat-file-group tb)
-                                             text))
-        (specify "extract traceback line number"
-                 (assert-equal "5"
-                               (match-string (dbgr-loc-pat-line-group tb)
-                                             text)))
-        
-       ;;  (specify "prompt"
-       ;;        (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
-       ;;                                      "(trepanx): "))
      ;;        (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
      ;;                                      "((trepanx)): "))
      ;;        (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
      ;;                                      "((trepanx@55)): "))
      ;;        (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
      ;;                                        "((trepanx@main)): "))
      ;;          )
-          
-       ;;    (lexical-let ((text "Breakpoint 1 set at line 9
-       ;; in file /usr/local/bin/irb,
-       ;; VM offset 2 of instruction sequence <top (required)>."))
-       ;;      (specify "basic breakpoint location"
-       ;;            (assert-t (numberp (bp-loc-match text))))
-       ;;      (specify "extract breakpoint file name"
-       ;;            (assert-equal "/usr/local/bin/irb"
-       ;;                          (match-string (dbgr-loc-pat-file-group bps)
-       ;;                                        text)))
-       ;;      (specify "extract breakpoint line number"
-       ;;            (assert-equal "9"
-       ;;                          (match-string (dbgr-loc-pat-line-group bps)
-       ;;                                        text)))
-       ;;      )
-        )
       )
+(context 
+ "traceback location matching"
+ (tag regexp-trepanx)
+ (specify "basic traceback location"
+         (assert-t (numberp (tb-loc-match text))))
+ (specify "extract traceback file name"
+         (assert-equal 0 (tb-loc-match text))
+         (assert-equal "tmp/boom.rb"
+                       (match-string (dbgr-loc-pat-file-group tb)
+                                     text))
+         (setq text 
+               "            { } in main.__script__ at /tmp/blam.rb:5")
+         (assert-equal 0 (tb-loc-match text))
+         (assert-equal "/tmp/blam.rb"
+                       (match-string (dbgr-loc-pat-file-group tb)
+                                     text))
+         )
+ (specify "extract traceback line number"
+         (assert-equal "5"
+                       (match-string (dbgr-loc-pat-line-group tb)
+                                     text)))
+ ;;  (specify "prompt"
;;      (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
;;                                    "(trepanx): "))
;;      (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
;;                                    "((trepanx)): "))
;;      (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
;;                                    "((trepanx@55)): "))
;;      (assert-equal 0 (string-match (dbgr-loc-pat-regexp prompt)
+ ;;                                      "((trepanx@main)): "))
+ ;;        )
+ (lexical-let 
+     ((text "Set breakpoint 1: __script__() at /bin/irb:2 (@0)"))
+   (specify "basic breakpoint location"
+           (assert-t (numberp (bp-loc-match text))))
+   (specify "extract breakpoint file name"
+           (assert-equal "/bin/irb"
+                         (match-string (dbgr-loc-pat-file-group bps)
+                                       text)))
+   (specify "extract breakpoint line number"
+           (assert-equal "2"
+                         (match-string (dbgr-loc-pat-line-group bps)
+                                       text)))
+   )
+ )
 
 (test-unit "regexp-trepanx")