GDBStoppedEvent.st
changeset 135 6efae6456f14
parent 95 f417138e9c48
child 211 d493b4969b59
--- a/GDBStoppedEvent.st	Fri Aug 31 08:04:05 2018 +0100
+++ b/GDBStoppedEvent.st	Sat Sep 01 00:16:15 2018 +0100
@@ -21,7 +21,7 @@
 "{ NameSpace: Smalltalk }"
 
 GDBExecutionEvent subclass:#GDBStoppedEvent
-	instanceVariableNames:'stopped_threads'
+	instanceVariableNames:'frame reason stopped_threads'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'GDB-Core-Events'
@@ -56,14 +56,31 @@
     ^ (super description)
         define:#'thread-id' as:Integer;
         define:#'stopped-threads' as:String;
+        define:#'frame' as: GDBFrame;
+        define:#'reason' as: String;
         yourself
 
     "Created: / 08-09-2014 / 22:13:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 22-09-2014 / 23:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-08-2018 / 14:15:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !GDBStoppedEvent methodsFor:'accessing'!
 
+frame
+    ^ frame
+!
+
+reason
+    "Return stop reason as reported by the GDB.
+
+     See GDBStopReasons for list of common reasons. Note, that
+     that list os not exhaustive."
+
+    ^ reason
+
+    "Modified (comment): / 31-08-2018 / 23:20:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 stoppedThread
     thread_id isNil ifTrue:[ ^ nil ].
     ^ threads detect:[:thread | thread id = thread_id ]
@@ -91,6 +108,23 @@
 	^  'stopped'
 ! !
 
+!GDBStoppedEvent methodsFor:'initialization'!
+
+reason: aString
+    GDBStopReasons classVarNames do:[:name | 
+        | value |
+
+        value := GDBStopReasons classVarNamed: name.
+        aString = value ifTrue:[ 
+            reason := value.
+            ^ self.
+        ].
+    ].
+    reason := aString
+
+    "Created: / 31-08-2018 / 23:23:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !GDBStoppedEvent class methodsFor:'documentation'!
 
 version_HG