1 ;;; Copyright (C) 2011, 2013-2015 Rocky Bernstein <rocky@gnu.org>
2 ;; `bashdb' Main interface to bashdb via Emacs
4 (require 'load-relative)
5 (require-relative-list '("../../common/helper") "realgud-")
6 (require-relative-list '("../../common/run") "realgud:")
7 (require-relative-list '("core" "track-mode") "realgud:bashdb-")
9 ;; This is needed, or at least the docstring part of it is needed to
10 ;; get the customization menu to work in Emacs 24.
11 (defgroup realgud:bashdb nil
12 "The realgud interface to bashdb"
16 ;; -------------------------------------------------------------------
17 ;; User-definable variables
20 (defcustom realgud:bashdb-command-name
23 "File name for executing the bash debugger and command options.
24 This should be an executable on your path, or an absolute file name."
26 :group 'realgud:bashdb)
28 ;; -------------------------------------------------------------------
32 (declare-function bashdb-track-mode 'realgud-bashdb-track-mode)
33 (declare-function bashdb-query-cmdline 'realgud:bashdb-core)
34 (declare-function bashdb-parse-cmd-args 'realgud:bashdb-core)
35 (declare-function realgud:run-debugger 'realgud:run)
38 (defun realgud:bashdb (&optional opt-cmd-line no-reset)
39 "Invoke the bashdb shell debugger and start the Emacs user interface.
41 String OPT-CMD-LINE specifies how to run bash. You will be prompted
42 for a command line is one isn't supplied.
44 OPT-CMD-LINE is treated like a shell string; arguments are
45 tokenized by `split-string-and-unquote'. The tokenized string is
46 parsed by `bashdb-parse-cmd-args' and path elements found by that
47 are expanded using `realgud:expand-file-name-if-exists'.
49 Normally, command buffers are reused when the same debugger is
50 reinvoked inside a command buffer with a similar command. If we
51 discover that the buffer has prior command-buffer information and
52 NO-RESET is nil, then that information which may point into other
53 buffers and source buffers which may contain marks and fringe or
54 marginal icons is reset. See `loc-changes-clear-buffer' to clear
55 fringe and marginal icons.
58 (realgud:run-debugger "bashdb"
60 'bashdb-parse-cmd-args
61 'realgud:bashdb-minibuffer-history
62 opt-cmd-line no-reset)
65 (defalias 'bashdb 'realgud:bashdb)
67 (provide-me "realgud-")