Skip to content

Commit

Permalink
Add bash-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
svaante committed Sep 11, 2024
1 parent 4096d71 commit cc83e6e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ Install with ~opam install earlybird~.
2. Place breakpoints inside of =_build/default/*=

See [[https://github.com/hackwaly/ocamlearlybird][ocamlearlybird]] for more information.

** Bash - bash-debug
1. Install =node=
2. Download latest =vsix= [[https://github.com/rogalmic/vscode-bash-debug/releases][release]] of DAP adapter =bash-debug-<version>.vsix=
3. Unpack ~mkdir -p ~/.emacs.d/debug-adapters && unzip bash-debug-<version>.vsix -d ~/.emacs.d/debug-adapters/bash-debug~

See [[https://github.com/rogalmic/vscode-bash-debug][bash-debug]] for more information.

** Other untested adapters
If you find a working configuration for any other debug adapter please submit a PR.

Expand Down
27 changes: 27 additions & 0 deletions dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,33 @@
(unless (plist-get config 'command)
(user-error "Missing `command' property")))
:request "launch")
,(let* ((extension-directory
(expand-file-name
(file-name-concat dape-adapter-dir "bash-debug" "extension")))
(bashdb-dir (file-name-concat extension-directory "bashdb_dir")))
`(bash-debug
modes (sh-mode bash-ts-mode)
ensure (lambda (config)
(dape-ensure-command config)
(let ((dap-debug-server-path
(car (plist-get config 'command-args))))
(unless (file-exists-p dap-debug-server-path)
(user-error "File %S does not exist" dap-debug-server-path))))
command "node"
command-args (,(file-name-concat extension-directory "out" "bashDebug.js"))
fn (lambda (config)
(thread-first config
(plist-put :pathBashdbLib ,bashdb-dir)
(plist-put :pathBashdb (file-name-concat ,bashdb-dir "bashdb"))
(plist-put :env `(:BASHDB_HOME ,,bashdb-dir . ,(plist-get config :env)))))
:type "bashdb"
:cwd dape-cwd
:program dape-buffer-default
:args []
:pathBash "bash"
:pathCat "cat"
:pathMkfifo "mkfifo"
:pathPkill "pkill"))
,@(let ((codelldb
`(ensure dape-ensure-command
command-cwd dape-command-cwd
Expand Down

0 comments on commit cc83e6e

Please sign in to comment.