]> code.delx.au - gnu-emacs-elpa/blob - dbgr.el
Add stock Python debugger.
[gnu-emacs-elpa] / dbgr.el
1 ;;; Copyright (C) 2010, 2011 Rocky Bernstein <rocky@gnu.org>
2 ;;; Things related to loading and loading the dbgr package.
3 (require 'load-relative)
4
5 (defgroup dbgr nil
6 "The Grand Cathedral Debugger rewrite"
7 :group 'processes
8 :group 'tools
9 :version "23.1")
10
11 ;; FIXME: extend require-relative for "autoload".
12 (defun dbgr-load-features()
13 (require-relative-list
14 '(
15 "./dbgr/common/track-mode"
16 "./dbgr/debugger/bashdb/bashdb"
17 "./dbgr/debugger/gdb/gdb"
18 "./dbgr/debugger/kshdb/kshdb"
19 "./dbgr/debugger/pdb/pdb"
20 "./dbgr/debugger/pydbgr/pydbgr"
21 "./dbgr/debugger/perldb/perldb"
22 "./dbgr/debugger/rdebug/rdebug"
23 "./dbgr/debugger/remake/remake"
24 "./dbgr/debugger/trepan/trepan"
25 "./dbgr/debugger/trepan.pl/trepanpl"
26 "./dbgr/debugger/trepanx/trepanx"
27 "./dbgr/debugger/trepan8/trepan8"
28 "./dbgr/debugger/zshdb/zshdb"
29 ) "dbgr-")
30 )
31
32 ;; Really should be part of GNU Emacs. But until then...
33 (defmacro dbgr-string-starts-with(string prefix)
34 "compare-strings on STRING anchored from the beginning and up
35 to length(PREFIX)"
36 (declare (indent 1) (debug t))
37 `(compare-strings ,prefix 0 (length ,prefix)
38 ,string 0 (length ,prefix))
39 )
40
41 (defun dbgr-feature-starts-with(feature prefix)
42 "dbgr-strings-starts-with on stringified FEATURE and PREFIX."
43 (declare (indent 1) (debug t))
44 (dbgr-string-starts-with (symbol-name feature) prefix)
45 )
46
47 (defun dbgr-loaded-features()
48 "Return a list of loaded debugger features. These are the
49 features that start with 'dbgr-' and also include standalone debugger features
50 like 'pydbgr'."
51 (let ((result nil))
52 (dolist (feature features result)
53 (cond ((eq 't
54 (dbgr-feature-starts-with feature "dbgr-"))
55 (setq result (cons feature result)))
56 ((eq 't
57 (dbgr-feature-starts-with feature "pydbgr"))
58 (setq result (cons feature result)))
59 ((eq 't
60 ;; No trailing '-' to get a plain "trepan".
61 (dbgr-feature-starts-with feature "trepan"))
62 (setq result (cons feature result)))
63 ((eq 't
64 ;; No trailing '-' to get a plain "trepanx".
65 (dbgr-feature-starts-with feature "trepanx"))
66 (setq result (cons feature result)))
67 ('t nil))
68 )
69 )
70 )
71
72 (defun dbgr-unload-features()
73 "Remove all features loaded from this package. Used in
74 `dbgr-reload-features'. See that."
75 (interactive "")
76 (let ((result (dbgr-loaded-features)))
77 (dolist (feature result result)
78 (unload-feature feature 't)))
79 )
80
81 (defun dbgr-reload-features()
82 "Reload all features loaded from this package. Useful if have
83 changed some code or want to reload another version, say a newer
84 development version and you already have this package loaded."
85 (interactive "")
86 (dbgr-unload-features)
87 (dbgr-load-features)
88 )
89
90 ;; Load everything.
91 (dbgr-load-features)
92
93 (provide-me)