]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/gub/gub.el
2933d5276de8ef34d90c6559b0c23a886d21e837
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / gub / gub.el
1 ;;; Copyright (C) 2013-2015 Rocky Bernstein <rocky@gnu.org>
2 ;; `gub' Main interface to Go gub via Emacs
3 (require 'load-relative)
4 (require-relative-list '("../../common/helper") "realgud-")
5 (require-relative-list '("../../common/track") "realgud-")
6 (require-relative-list '("core" "track-mode") "realgud:gub-")
7 ;; This is needed, or at least the docstring part of it is needed to
8 ;; get the customization menu to work in Emacs 24.
9 (defgroup realgud:gub nil
10 "The realgud interface to the Go SSA interpreter debugger, gub"
11 :group 'realgud
12 :version "23.4")
13
14 ;; -------------------------------------------------------------------
15 ;; User definable variables
16 ;;
17
18 (defcustom realgud:gub-command-name
19 "tortoise -run -gub= -interp=SS --"
20 "File name for executing the Go SSA interpreter/debugger, gub, and command options.
21 This should be an executable on your path, or an absolute file name."
22 :type 'string
23 :group 'realgud:gub)
24
25 (declare-function gub-query-cmdline 'realgud-gub-core)
26 (declare-function gub-parse-cmd-args 'realgud-gub-core)
27 (declare-function realgud:run-process 'realgud-core)
28
29
30 (defun realgud-gub-fn (&optional opt-command-line no-reset)
31 "See `realgud-gub' for details"
32
33 (let* ((cmd-str (or opt-command-line (gub-query-cmdline "gub")))
34 (cmd-args (split-string-and-unquote cmd-str))
35 (parsed-args (gub-parse-cmd-args cmd-args))
36 (gub-program (car parsed-args))
37 (gub-args (cadr parsed-args))
38 (go-prog-and-args (caddr parsed-args))
39 (script-filename (car go-prog-and-args))
40 (cmd-buf))
41 (realgud:run-process gub-program script-filename cmd-args
42 'gub-track-mode no-reset)
43 )
44 )
45
46 ;;;###autoload
47 (defun realgud-gub (&optional opt-command-line no-reset)
48 "Invoke the Go SSA debugger, gub and start the Emacs user interface.
49
50 String COMMAND-LINE specifies how to run gub.
51
52 Normally command buffers are reused when the same debugger is
53 reinvoked inside a command buffer with a similar command. If we
54 discover that the buffer has prior command-buffer information and
55 NO-RESET is nil, then that information which may point into other
56 buffers and source buffers which may contain marks and fringe or
57 marginal icons is reset."
58
59
60 (interactive)
61 (realgud-gub-fn opt-command-line no-reset)
62 )
63
64 (defalias 'gub 'realgud-gub)
65
66 (provide-me "realgud-")
67 ;;; gub.el ends here