UX: automatically refresh memory contents when inferior stops
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 30 Jan 2019 11:45:37 +0000
changeset 147 4087090b3581
parent 146 c037aa4ce54f
child 148 7d2d523173af
child 151 bc7626f46210
UX: automatically refresh memory contents when inferior stops ...so memory contents is up-to-date.
VDBMemoryApplication.st
--- a/VDBMemoryApplication.st	Wed Jan 30 11:36:40 2019 +0000
+++ b/VDBMemoryApplication.st	Wed Jan 30 11:45:37 2019 +0000
@@ -351,7 +351,7 @@
 !VDBMemoryApplication methodsFor:'change & update'!
 
 update
-    | address size format ncols nrows ascii |
+    | address size format ncols nrows |
 
     address := self addressHolder value.
     address isEmptyOrNil ifTrue:[ ^ self memory: nil ].
@@ -359,14 +359,13 @@
     format := self formatHolder value format.
     ncols := self numColsHolder value ? 4.
     nrows := self numRowsHolder value ? 10.
-    ascii := false.
 
     debugger 
         send: (GDBMI_data_read_memory arguments: (Array with: address with: format with: size with: nrows with: ncols))
         andWithResultDo:[ :result | self window sensor pushUserEvent: #memory: for: self withArgument: result value ]
 
     "Created: / 26-01-2018 / 12:41:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 05-07-2018 / 14:30:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-01-2019 / 11:42:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 update:aspect with:parameter from:sender
@@ -374,18 +373,40 @@
 
     "stub code automatically generated - please change as required"
 
-    (sender == addressHolder 
-        or:[ sender == sizeIndexHolder
-        or:[ sender == formatHolder
-        or:[ sender == numRowsHolder
-        or:[ sender == numColsHolder ]]]])
-         ifTrue:[
+    sender == addressHolder ifTrue:[ 
+        self update.
+        ^ self.
+    ].
+    (sender == sizeIndexHolder or:[ sender == formatHolder ]) ifTrue:[ 
+        self update.
+        ^ self.
+    ].
+    (sender == numRowsHolder or:[ sender == numColsHolder ]) ifTrue:[
          self update.
          ^ self.
     ].
     super update:aspect with:parameter from:sender
 
-    "Modified: / 05-07-2018 / 14:34:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 29-01-2019 / 10:02:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!VDBMemoryApplication methodsFor:'event handling'!
+
+onStoppedEvent: aGDBStoppedEvent
+    self update
+
+    "Created: / 25-01-2019 / 23:21:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!VDBMemoryApplication methodsFor:'initialization & release'!
+
+subscribe
+    "Register for debugger events. To be overrided by subclasses"
+    
+    debugger announcer 
+        when:GDBStoppedEvent        send:#onStoppedEvent:       to:self.
+
+    "Created: / 25-01-2019 / 23:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBMemoryApplication methodsFor:'menu actions'!