branch: master
commit 4f5c91fb1db9e1ef4d56ff561b353a4a191a19f7
Author: Clément Pit--Claudel <[email protected]>
Commit: Clément Pit--Claudel <[email protected]>
Add basic support for jumping
---
README.md | 3 ++-
realgud/common/cmds.el | 7 +++++++
realgud/common/shortkey.el | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b9f2fd0..e2e9cbc 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,7 @@ Here is a quick rundown of the most useful commands. “🐁”
indicates mouse
| Command | Action
|
| --------------------------------------------- |
--------------------------------------------- |
| <kbd>n</kbd>, <kbd>F10</kbd> | Next (aka “step over”,
“step through”) |
- | <kbd>s</kbd>, <kbd>SPC</kbd>, <kbd>F11</kbd> | Step (aka “step into”;
`C-u`: repeat) |
+ | <kbd>s</kbd>, <kbd>SPC</kbd>, <kbd>F11</kbd> | Step (aka “step into”)
|
| <kbd>f</kbd>, <kbd>S-F11</kbd> | Finish (aka “step out”,
“return”) |
| <kbd>c</kbd>, <kbd>F5</kbd> | Continue (run to next
break point) |
@@ -90,6 +90,7 @@ RealGUD supports [many external
debuggers](https://github.com/rocky/emacs-dbgr/w
| <kbd>u</kbd>, <kbd>></kbd> | Up stack (move to older stack
frame) |
| <kbd>d</kbd>, <kbd><</kbd> | Down stack (move to younger
stack frame) |
| <kbd>X</kbd> | Clear breakpoint (by line)
|
+| <kbd>j</kbd> | Jump to current line ⚙
|
| <kbd>-</kbd> | Disable breakpoint ⚙
|
| <kbd>+</kbd> | Enable breakpoint ⚙
|
diff --git a/realgud/common/cmds.el b/realgud/common/cmds.el
index 22a10f9..098fc23 100644
--- a/realgud/common/cmds.el
+++ b/realgud/common/cmds.el
@@ -97,6 +97,7 @@ with other motion initiated by debugger messages."
(puthash "eval" "eval %s" hash)
(puthash "finish" "finish" hash)
(puthash "frame" "frame %p" hash)
+ (puthash "jump" "jump %l" hash)
(puthash "kill" "kill" hash)
(puthash "next" "next %p" hash)
(puthash "repeat-last" "\n" hash)
@@ -180,6 +181,12 @@ With prefix argument LINE-NUMBER, prompt for line number."
(realgud:cmd--with-line-override line-number
(realgud:cmd-run-command line-number
"clear")))
+(defun realgud:cmd-jump(&optional line-number)
+ "Jump to current line.
+With prefix argument LINE-NUMBER, prompt for line number."
+ (interactive (realgud:cmd--line-number-from-prefix-arg))
+ (realgud:cmd--with-line-override line-number
+ (realgud:cmd-run-command (line-number-at-pos) "jump")))
(defun realgud:cmd-continue(&optional arg)
"Continue execution.
diff --git a/realgud/common/shortkey.el b/realgud/common/shortkey.el
index 17e3aa5..93b32aa 100644
--- a/realgud/common/shortkey.el
+++ b/realgud/common/shortkey.el
@@ -43,6 +43,7 @@
(define-key map "8" 'realgud:goto-loc-hist-8)
(define-key map "9" 'realgud:goto-loc-hist-9)
(define-key map "b" 'realgud:cmd-break)
+ (define-key map "j" 'realgud:cmd-jump)
(define-key map "c" 'realgud:cmd-continue)
(define-key map "e" 'realgud:cmd-eval-dwim)
(define-key map "U" 'realgud:cmd-until)