UX: avoid round trip to GDB until thread node is expanded
authorJan Vrany <jan.vrany@labware.com>
Thu, 10 Dec 2020 20:28:06 +0000
changeset 208 719dfb28b819
parent 207 27e7fa4229b3
child 209 c368a74adb70
UX: avoid round trip to GDB until thread node is expanded ...by assuming a thread has always a child. This is not strictly true, but speeds up the UI significantly for multi-threaded applications since usually user is debugging one, two threads and this avoids fetching stack for all threads unless absolutely necessary.
VDBThreadPresenter.st
--- a/VDBThreadPresenter.st	Thu Dec 10 20:14:03 2020 +0000
+++ b/VDBThreadPresenter.st	Thu Dec 10 20:28:06 2020 +0000
@@ -147,6 +147,19 @@
     "Modified: / 30-09-2014 / 00:04:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!VDBThreadPresenter methodsFor:'protocol-queries'!
+
+hasChildren
+
+    "/ Here we assume a thread has at least one frame.
+    "/ This is NOT true is certain corner cases, however,
+    "/ unconditionally answering `true` here avoids round-trip
+    "/ to GDB until thread node is actually "expanded".
+    ^ true
+
+    "Created: / 10-12-2020 / 00:05:41 / Jan Vrany <jan.vrany@labware.com>"
+    "Modified (comment): / 10-12-2020 / 20:17:56 / Jan Vrany <jan.vrany@labware.com>"
+! !
 
 !VDBThreadPresenter methodsFor:'testing'!