Config and notes for DAP with GDB-Multiarch

This commit is contained in:
Lucas Vieira 2025-04-24 13:08:19 -03:00
parent 877ca1e5b4
commit e9cc89c51f
3 changed files with 27 additions and 9 deletions

View file

@ -7,18 +7,18 @@
(setq-local flycheck-clang-include-path includes) (setq-local flycheck-clang-include-path includes)
(setq-local flycheck-gcc-include-path includes) (setq-local flycheck-gcc-include-path includes)
(dap-register-debug-template (dap-register-debug-template
"PSX Debug" "Sonic XA Debug"
(list :name "PSX -- Engine debug" (list :name "PSX -- Sonic XA debug"
:type "gdbserver" :type "gdbserver"
:request "attach" :request "attach"
:gdbpath "/usr/bin/gdb-multiarch" :gdbpath "/usr/bin/gdb-multiarch"
:target ":3333" :target ":3333"
:cwd root :cwd root
;;:executable (concat root "build/engine.elf") :executable (concat root "build/sonic.elf")
;;:args (concat "-x " root "tools/gdbinit.txt") :args (concat "-x " root ".gdbinit")
;; :autorun (list "monitor reset shellhalt" :autorun (list "monitor reset shellhalt"
;; "load build/engine.elf" "load build/sonic.elf"
;; "tbreak main") "tbreak main")
)) ))
;; (when neotreebuf ;; (when neotreebuf
;; (with-current-buffer (first neotreebuf) ;; (with-current-buffer (first neotreebuf)

View file

@ -1,5 +1,5 @@
target remote localhost:3333 target remote localhost:3333
monitor reset shellhalt monitor reset shellhalt
file ./build/engine.elf file ./build/sonic.elf
load ./build/engine.elf load ./build/sonic.elf
tbreak main tbreak main

View file

@ -101,6 +101,24 @@ even load the ELF file with proper debug symbols.
Have fun. Have fun.
** A note on gdb-multiarch and Arch Linux
For some reason, =gdb-multiarch= right now cannot be installed from AUR. So
you'll probably have to generate the package from a PKGBUILD by cloning the repo
and building it:
#+begin_src bash
git clone --depth=1 https://aur.archlinux.org/gdb-multiarch.git/
cd gdb-multiarch
makepkg -si
#+end_src
Notice that you MIGHT Have to tweak download links and the =pkgver= variable as
well! If you install the =gdb= package, take a look at the version of the
package =gdb-common= which is also installed with it. (If you have other
problems you can just pass =--skippgpcheck= to =makepkg=, but be wary of what
you're doing)
* Running on real hardware * Running on real hardware
#+html: <center> #+html: <center>