From 8ef6b775e596d9207f8103bd5f2aa98a7e5ecd28 Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Fri, 1 Mar 2024 00:00:06 +0100 Subject: [PATCH] Move `dape-on-stopped-hooks' back to it's original place There is nothing in the manual that says that a thread needs to be stopped so let's just use the last adapter for reading and writing memory. If that is the case we should revert the hook call point as it makes more sense at the end of stopped event. --- dape.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dape.el b/dape.el index 8acf3de9..fc6e198d 100644 --- a/dape.el +++ b/dape.el @@ -1730,7 +1730,6 @@ Sets `dape--thread-id' from BODY and invokes ui refresh with (dape--update-threads conn (plist-get body :threadId) (plist-get body :allThreadsStopped)) - (run-hooks 'dape-on-stopped-hooks) (dape--update conn)) (if-let (((equal "exception" (plist-get body :reason))) (texts @@ -1740,7 +1739,8 @@ Sets `dape--thread-id' from BODY and invokes ui refresh with (let ((str (mapconcat 'identity texts ":\n\t"))) (setf (dape--exception-description conn) str) (dape--repl-message str 'dape-repl-error-face)) - (setf (dape--exception-description conn) nil))) + (setf (dape--exception-description conn) nil)) + (run-hooks 'dape-on-stopped-hooks)) (cl-defmethod dape-handle-event (conn (_event (eql continued)) body) "Handle adapter CONN continued events. @@ -2319,7 +2319,7 @@ Using BUFFER and STR." (defun dape--memory-revert (&optional _ignore-auto _noconfirm _preserve-modes) "Revert buffer function for `dape-memory-mode'." - (let* ((conn (dape--live-connection 'stopped)) + (let* ((conn (dape--live-connection 'last)) (write-capable-p (dape--capable-p conn :supportsWriteMemoryRequest))) (unless (dape--capable-p conn :supportsReadMemoryRequest) (user-error "Adapter not capable of reading memory.")) @@ -2379,7 +2379,7 @@ Using BUFFER and STR." (defun dape--memory-write () "Write buffer contents to stopped connection." - (let ((conn (dape--live-connection 'stopped)) + (let ((conn (dape--live-connection 'last)) (buffer (current-buffer)) (start (point-min)) (end (point-max))