165f6873f5dd

Handle invalid register values gracefully
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 24 Nov 2016 13:19:48 +0000
parents 38dbcc76d3d0
children c96b71d08dfd
branches/tags (none)
files src/debugger.lisp

Changes

--- a/src/debugger.lisp	Thu Nov 24 13:14:51 2016 +0000
+++ b/src/debugger.lisp	Thu Nov 24 13:19:48 2016 +0000
@@ -246,16 +246,16 @@
 (define-override (registers-model set-data) (index value role)
   (if (and (registers-index-valid-p index)
            (eql role (q+:qt.edit-role)))
-    (let ((row (q+:row index)))
-      (setf (registers-value chip row)
-            (parse-hex value (registers-max-value row)))
-      (signal! registers-model (data-changed "QModelIndex" "QModelIndex")
-               index index)
+    (let* ((row (q+:row index))
+           (val (parse-hex value (registers-max-value row))))
+      (when val
+        (setf (registers-value chip row) val)
+        (signal! registers-model (data-changed "QModelIndex" "QModelIndex")
+                 index index))
       t)
     nil))
 
 
-
 ;;;; Layout
 (defun registers-refresh (model view address)
   (declare (ignore view address))