GDBThreadGroup.st
changeset 43 22236b6d1d9a
parent 37 a85f0c91f164
child 45 deb908479a37
equal deleted inserted replaced
42:499dc5d38707 43:22236b6d1d9a
    41 pid
    41 pid
    42     ^ pid
    42     ^ pid
    43 !
    43 !
    44 
    44 
    45 threadWithId: tid
    45 threadWithId: tid
    46     ^ threads ? #() detect:[:e | e id = tid ] ifNone:[
    46     ^ threads ? #() detect:[:e | e isDead not and:[ e id = tid ] ] ifNone:[
    47         self error: ('No thread with id ''%1'' found!!' bindWith: tid)        
    47         self error: ('No thread with id ''%1'' found!!' bindWith: tid)        
    48     ].
    48     ].
    49 
    49 
    50     "Created: / 07-09-2014 / 21:37:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    50     "Created: / 07-09-2014 / 21:37:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    51     "Modified: / 22-09-2014 / 01:23:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    51 !
    52 !
    52 
    53 
    53 threads
    54 threads
    54     threads isNil ifTrue:[ 
    55     threads isNil ifTrue:[ 
    55         threads := List new.
    56         threads := List new.
    81 onThreadExitedEvent:aGDBThreadExitedEvent 
    82 onThreadExitedEvent:aGDBThreadExitedEvent 
    82     | thread |
    83     | thread |
    83 
    84 
    84     thread := self threadWithId:aGDBThreadExitedEvent threadId.
    85     thread := self threadWithId:aGDBThreadExitedEvent threadId.
    85     thread setTerminated.
    86     thread setTerminated.
    86     aGDBThreadExitedEvent setThread:thread
    87     aGDBThreadExitedEvent setThread:thread.
    87 
    88 
    88     "Created: / 07-09-2014 / 21:25:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    89     "Created: / 07-09-2014 / 21:25:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    90     "Modified: / 22-09-2014 / 00:50:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    89 ! !
    91 ! !
    90 
    92 
    91 !GDBThreadGroup methodsFor:'initialization'!
    93 !GDBThreadGroup methodsFor:'initialization'!
    92 
    94 
    93 setExitCode: anInteger
    95 setExitCode: anInteger
    94     exit_code := anInteger.
    96     exit_code := anInteger.
       
    97     threads removeAll
    95 
    98 
    96     "Created: / 06-09-2014 / 02:33:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    99     "Created: / 06-09-2014 / 02:33:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   100     "Modified: / 22-09-2014 / 01:23:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    97 !
   101 !
    98 
   102 
    99 setId: aString
   103 setId: aString
   100     id := aString.
   104     id := aString.
   101 
   105 
   106     pid := anInteger.
   110     pid := anInteger.
   107     exit_code := nil.
   111     exit_code := nil.
   108 
   112 
   109     "Created: / 06-09-2014 / 02:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   113     "Created: / 06-09-2014 / 02:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   110     "Modified: / 07-09-2014 / 12:34:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   114     "Modified: / 07-09-2014 / 12:34:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   115 ! !
       
   116 
       
   117 !GDBThreadGroup methodsFor:'printing & storing'!
       
   118 
       
   119 printOn:aStream
       
   120     "append a printed representation if the receiver to the argument, aStream"
       
   121 
       
   122     aStream nextPutAll:'thread group '.
       
   123     id printOn:aStream.
       
   124     aStream nextPutAll:' pid '.
       
   125     pid printOn:aStream.
       
   126 
       
   127     "Modified: / 22-09-2014 / 01:00:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   111 ! !
   128 ! !
   112 
   129 
   113 !GDBThreadGroup methodsFor:'private'!
   130 !GDBThreadGroup methodsFor:'private'!
   114 
   131 
   115 threadAdd: aGDBThread
   132 threadAdd: aGDBThread