1 ;;; Copyright (C) 2010, 2011 Rocky Bernstein <rocky@gnu.org>
2 ;;; Things related to loading and loading the dbgr package.
3 (require 'load-relative)
6 "The Grand Cathedral Debugger rewrite"
11 ;; FIXME: extend require-relative for "autoload".
12 (defun dbgr-load-features()
13 (require-relative-list
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"
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
36 (declare (indent 1) (debug t))
37 `(compare-strings ,prefix 0 (length ,prefix)
38 ,string 0 (length ,prefix))
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)
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
52 (dolist (feature features result)
54 (dbgr-feature-starts-with feature "dbgr-"))
55 (setq result (cons feature result)))
57 (dbgr-feature-starts-with feature "pydbgr"))
58 (setq result (cons feature result)))
60 ;; No trailing '-' to get a plain "trepan".
61 (dbgr-feature-starts-with feature "trepan"))
62 (setq result (cons feature result)))
64 ;; No trailing '-' to get a plain "trepanx".
65 (dbgr-feature-starts-with feature "trepanx"))
66 (setq result (cons feature result)))
72 (defun dbgr-unload-features()
73 "Remove all features loaded from this package. Used in
74 `dbgr-reload-features'. See that."
76 (let ((result (dbgr-loaded-features)))
77 (dolist (feature result result)
78 (unload-feature feature 't)))
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."
86 (dbgr-unload-features)