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"
14 ;; -------------------------------------------------------------------
15 ;; User definable variables
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."
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)
30 (defun realgud-gub-fn (&optional opt-command-line no-reset)
31 "See `realgud-gub' for details"
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))
41 (realgud:run-process gub-program script-filename cmd-args
42 'gub-track-mode no-reset)
47 (defun realgud-gub (&optional opt-command-line no-reset)
48 "Invoke the Go SSA debugger, gub and start the Emacs user interface.
50 String COMMAND-LINE specifies how to run gub.
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."
61 (realgud-gub-fn opt-command-line no-reset)
64 (defalias 'gub 'realgud-gub)
66 (provide-me "realgud-")