branch: master
commit a0af8eb0c874f92644a249cd48e698c362e77e89
Author: rocky <[email protected]>
Commit: rocky <[email protected]>
Add trepan2-delayed and trepan3k-delayed
---
realgud/debugger/trepan2/trepan2.el | 27 +++++++++++++++++++++++++--
realgud/debugger/trepan3k/trepan3k.el | 27 +++++++++++++++++++++++++--
2 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/realgud/debugger/trepan2/trepan2.el
b/realgud/debugger/trepan2/trepan2.el
index 84bfd47..73415cd 100644
--- a/realgud/debugger/trepan2/trepan2.el
+++ b/realgud/debugger/trepan2/trepan2.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010-2012, 2014-2016 Free Software Foundation, Inc
+;; Copyright (C) 2010-2012, 2014-2017 Free Software Foundation, Inc
;; Author: Rocky Bernstein <[email protected]>
@@ -69,7 +69,30 @@ fringe and marginal icons.
opt-cmd-line no-reset)
)
-
(defalias 'trepan2 'realgud:trepan2)
+;;;###autoload
+(defun realgud:trepan2-delayed ()
+ "This is like `trepan2', but assumes inside the program to be debugged, you
+have a call to the debugger somewhere, e.g. 'from trepan.api import debug;
debug()'.
+Therefore we invoke python rather than the debugger initially.
+"
+ (interactive)
+ (let* ((initial-debugger "python")
+ (actual-debugger "trepan2")
+ (cmd-str (trepan2-query-cmdline initial-debugger))
+ (cmd-args (split-string-and-unquote cmd-str))
+ ;; XXX: python gets registered as the interpreter rather than
+ ;; a debugger, and the debugger position (nth 1) is missing:
+ ;; the script-args takes its place.
+ (parsed-args (trepan2-parse-cmd-args cmd-args))
+ (script-args (nth 1 parsed-args))
+ (script-name (car script-args))
+ (parsed-cmd-args
+ (cl-remove-if 'nil (realgud:flatten parsed-args))))
+ (realgud:run-process actual-debugger script-name parsed-cmd-args
+ 'realgud:trepan2-minibuffer-history)))
+
+(defalias 'trepan2-delayed 'realgud:trepan2-delayed)
+
(provide-me "realgud-")
diff --git a/realgud/debugger/trepan3k/trepan3k.el
b/realgud/debugger/trepan3k/trepan3k.el
index a91f486..6d861f3 100644
--- a/realgud/debugger/trepan3k/trepan3k.el
+++ b/realgud/debugger/trepan3k/trepan3k.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010-2014, 2016 Free Software Foundation, Inc
+;; Copyright (C) 2010-2014, 2016-2017 Free Software Foundation, Inc
;; Author: Rocky Bernstein <[email protected]>
@@ -67,7 +67,30 @@ fringe and marginal icons.
opt-cmd-line no-reset)
)
-
(defalias 'trepan3k 'realgud:trepan3k)
+;;;###autoload
+(defun realgud:trepan3k-delayed ()
+ "This is like `trepan3k', but assumes inside the program to be debugged, you
+have a call to the debugger somewhere, e.g. 'from trepan.api import debug;
debug()'.
+Therefore we invoke python rather than the debugger initially.
+"
+ (interactive)
+ (let* ((initial-debugger "python")
+ (actual-debugger "trepan3k")
+ (cmd-str (trepan2-query-cmdline initial-debugger))
+ (cmd-args (split-string-and-unquote cmd-str))
+ ;; XXX: python gets registered as the interpreter rather than
+ ;; a debugger, and the debugger position (nth 1) is missing:
+ ;; the script-args takes its place.
+ (parsed-args (trepan3k-parse-cmd-args cmd-args))
+ (script-args (nth 1 parsed-args))
+ (script-name (car script-args))
+ (parsed-cmd-args
+ (cl-remove-if 'nil (realgud:flatten parsed-args))))
+ (realgud:run-process actual-debugger script-name parsed-cmd-args
+ 'realgud:trepan3k-minibuffer-history)))
+
+(defalias 'trepan3k-delayed 'realgud:trepan3k-delayed)
+
(provide-me "realgud-")