minimal working project with instruct step debugging infrastructure in place
This commit is contained in:
@@ -7,33 +7,26 @@
|
||||
(add-to-list
|
||||
'dape-configs
|
||||
`(gdb-dap-openocd
|
||||
,@(alist-get 'gdb-dap dape-configs)
|
||||
fn (lambda (config)
|
||||
(let* ((default-directory (dape--guess-root config))
|
||||
(openocd
|
||||
;; Run openocd with config files from `openocd-files' property
|
||||
(start-process-shell-command
|
||||
"openocd" "*openocd*"
|
||||
(concat "openocd"
|
||||
(mapconcat (lambda (file)
|
||||
(concat " -f " (shell-quote-argument file)))
|
||||
(append (dape-config-get config 'openocd-files) nil)))))
|
||||
probe)
|
||||
;; Wait until port is open
|
||||
(while (and (process-live-p openocd)
|
||||
(not (setq probe (ignore-errors
|
||||
(make-network-process :name "openocd port probe"
|
||||
:service 3333)))))
|
||||
(sleep-for 0.1))
|
||||
;; Close probe connection
|
||||
(when probe
|
||||
(delete-process probe)))
|
||||
config)
|
||||
openocd-files ["openocd.cfg"]
|
||||
:initCommands ["target remote 10.128.5.10:3333"
|
||||
"monitor reset halt"]
|
||||
:exitCommands ["monitor shutdown"]
|
||||
:terminateCommands ["monitor shutdown"]))
|
||||
ensure (lambda (config)
|
||||
(dape-ensure-command config)
|
||||
(let* ((default-directory
|
||||
(or (dape-config-get config 'command-cwd)
|
||||
default-directory))
|
||||
(command (dape-config-get config 'command))
|
||||
(output (shell-command-to-string (format "%s --version" command)))
|
||||
(version (save-match-data
|
||||
(when (string-match "GNU gdb \\(?:(.*) \\)?\\([0-9.]+\\)" output)
|
||||
(string-to-number (match-string 1 output))))))
|
||||
(unless (>= version 14.1)
|
||||
(user-error "Requires gdb version >= 14.1"))))
|
||||
modes ()
|
||||
command-cwd dape-command-cwd
|
||||
command "gdb"
|
||||
command-args ("--interpreter=dap")
|
||||
:request nil
|
||||
:program nil
|
||||
:args []
|
||||
:stopAtBeginningOfMainSubprogram nil))
|
||||
)
|
||||
|
||||
;;; .doomrc ends here
|
||||
|
||||
Reference in New Issue
Block a user