From 3c1ddb20008638d0dc318ad9d420b89dbc447b79 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 25 Oct 2024 18:48:58 +0200 Subject: [PATCH] chore: debug config via dape --- .dir-locals.el | 27 +++++++++++++++++++++++++++ gdb.script | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 .dir-locals.el create mode 100644 gdb.script diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..bcd55d5 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,27 @@ +((nil . ((dape-configs . ((gdb ensure + (lambda + (config) + (dape-ensure-command config) + (let* + ((default-directory + (or + (dape-config-get config 'command-cwd) + default-directory)) + (output + (shell-command-to-string "arm-none-eabi-gdb --version")) + (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 + (c-mode c-ts-mode c++-mode c++-ts-mode) + command-cwd dape-command-cwd command "arm-none-eabi-gdb" command-args + ("--interpreter=dap" "--x=gdb.script" "bin/blink.elf") + defer-launch-attach t :request "launch" :program "bin/blink.elf" :args + [] + :stopAtBeginningOfMainSubprogram nil)))))) diff --git a/gdb.script b/gdb.script new file mode 100644 index 0000000..dd7c0ea --- /dev/null +++ b/gdb.script @@ -0,0 +1,2 @@ +tar ext :3333 +load \ No newline at end of file -- 2.48.1