Skip to content

Commit

Permalink
Improve error checking in dape-memory-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
svaante committed Feb 29, 2024
1 parent 20e666a commit 8995c9f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -2349,8 +2349,10 @@ Using BUFFER and STR."
(dape-request conn "readMemory"
(list :memoryReference dape--memory-offset
:count dape-read-memory-bytes))
(if error
(message "Failed to read memory %s" error)
(cond
(error (message "Failed to read memory: %s" error))
((not data) (message "No bytes returned from adapter"))
(t
(let ((inhibit-read-only t))
(setq dape--memory-offset address
buffer-undo-list nil)
Expand Down Expand Up @@ -2391,7 +2393,7 @@ Using BUFFER and STR."
(list :memoryReference offset
:data (base64-encode-string (buffer-string) t)))
(if error
(message "Failed to write memory %s" error)
(message "Failed to write memory: %s" error)
(with-current-buffer buffer
(set-buffer-modified-p nil))
(message "Memory written successfully at %s" offset)
Expand Down

0 comments on commit 8995c9f

Please sign in to comment.