-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32e75c5
commit 7875f0c
Showing
11 changed files
with
163 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#+TITLE: debug layer | ||
|
||
[[file:img/debug.png]] | ||
|
||
* Table of Contents :TOC_4_gh:noexport: | ||
- [[#description][Description]] | ||
- [[#features][Features:]] | ||
- [[#install][Install]] | ||
- [[#enable-additional-debuggers][enable additional debuggers]] | ||
- [[#key-bindings][Key bindings]] | ||
- [[#leader][Leader]] | ||
- [[#shortkey-mode][shortkey-mode]] | ||
|
||
* Description | ||
This layer adds interactive debuggers for mulitple languages using [[https://github.com/realgud/realgud][realgud]]. | ||
|
||
** Features: | ||
- modern rewrite of the Emacs GUD debugger family | ||
- visual interface including breakpoint and line indicators | ||
- advanced features like stack frame navigation and mouse support | ||
- extensible framework for [[https://github.com/realgud/realgud/wiki/How-to-add-a-new-debugger][adding]] your own external debuggers | ||
|
||
* Install | ||
To use this configuration layer, add it to your =~/.spacemacs=. You will need to | ||
add =debug= to the existing =dotspacemacs-configuration-layers= list in this | ||
file. | ||
|
||
** enable additional debuggers | ||
Language specific debuggers are added by the respective layers. If you want to | ||
add additional debuggers, add them to the =debug-use-debuggers= variable. | ||
Make sure that your debugger is compatible by checking [[https://github.com/realgud/realgud/wiki/Debuggers-Supported][here]]. | ||
|
||
#+BEGIN_SRC emacs-lisp | ||
(setq-default dotspacemacs-configuration-layers | ||
'((debug :variables debug-use-debuggers '("remake")))) | ||
#+END_SRC | ||
|
||
* Key bindings | ||
|
||
** Leader | ||
|
||
| Key Binding | Description | | ||
|-------------+-----------------| | ||
| ~SPC m d d~ | open cmd buffer | | ||
|
||
** shortkey-mode | ||
|
||
| Key Binding | Description | | ||
|-------------+----------------------| | ||
| ~s~ | step over | | ||
| ~i~ | step into | | ||
| ~o~ | step out | | ||
| ~c~ | continue | | ||
| ~J~ | jump to current line | | ||
| ~e~ | eval variable | | ||
| ~r~ | restart | | ||
| ~q~ | quit debug | | ||
| ~S~ | goto cmd buffer | | ||
| ~bb~ | set break | | ||
| ~bc~ | clear break | | ||
| ~bd~ | delete break | | ||
| ~bs~ | disable break | | ||
| ~be~ | enable break | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
;;; config.el --- Debug Layer Configuration File for Spacemacs | ||
;; | ||
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors | ||
;; | ||
;; Author: troy.j.hinckley <[email protected]> | ||
;; URL: https://github.com/syl20bnr/spacemacs | ||
;; | ||
;; This file is not part of GNU Emacs. | ||
;; | ||
;;; License: GPLv3 | ||
|
||
(defvar debug-use-debuggers '() | ||
"realgud debuggers to be autoloaded. | ||
This variable must be populated before debug layers is loaded.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
;;; funcs.el --- Debug layer function file for Spacemacs. | ||
;; | ||
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors | ||
;; | ||
;; Author: troy.j.hinckley <[email protected]> | ||
;; URL: https://github.com/syl20bnr/spacemacs | ||
;; | ||
;; This file is not part of GNU Emacs. | ||
;; | ||
;;; License: GPLv3 | ||
|
||
(defun debug-short-key-state (modeon) | ||
"Set evil-evilified-state explicitly." | ||
(if modeon | ||
(evil-evilified-state) | ||
(evil-normal-state))) | ||
|
||
(defun debug-generate-symbol (debugger) | ||
"create realgud interactive function name from debugger" | ||
(intern (concat "realgud:" debugger))) | ||
|
||
(defun spacemacs|add-realgud-debugger (mode debugger) | ||
"add a deubbger to major mode. | ||
Note that this function MUST be called BEFORE init-realgud. | ||
Therefore you should add it to a pre-init-realgud definition" | ||
(add-to-list 'debug-use-debuggers debugger) | ||
(spacemacs/set-leader-keys-for-major-mode mode | ||
"dd" (debug-generate-symbol debugger))) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
;;; packages.el --- Debug Layer packages file for Spacemacs. | ||
;; | ||
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors | ||
;; | ||
;; Author: troy.j.hinckley <[email protected]> | ||
;; URL: https://github.com/syl20bnr/spacemacs | ||
;; | ||
;; This file is not part of GNU Emacs. | ||
;; | ||
;;; License: GPLv3 | ||
|
||
(defconst debug-packages | ||
'(realgud)) | ||
|
||
(defun debug/init-realgud() | ||
(eval | ||
`(use-package realgud | ||
|
||
:commands | ||
,(mapcar 'debug-generate-symbol | ||
debug-use-debuggers) | ||
|
||
:init | ||
(advice-add 'realgud-short-key-mode-setup | ||
:before #'debug-short-key-state) | ||
(evilified-state-evilify-map realgud:shortkey-mode-map | ||
:eval-after-load realgud | ||
:mode realgud-short-key-mode | ||
:bindings | ||
"s" 'realgud:cmd-next | ||
"i" 'realgud:cmd-step | ||
"o" 'realgud:cmd-finish | ||
"c" 'realgud:cmd-continue | ||
"J" 'realgud:cmd-jump | ||
|
||
"bb" 'realgud:cmd-break | ||
"bc" 'realgud:cmd-clear | ||
"bd" 'realgud:cmd-delete | ||
"bs" 'realgud:cmd-disable | ||
"be" 'realgud:cmd-enable | ||
|
||
"e" 'realgud:cmd-eval-dwim | ||
"r" 'realgud:cmd-restart | ||
"q" 'realgud:cmd-quit | ||
"S" 'realgud-window-cmd-undisturb-src)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters