diff -r c17ecf90e446 -r 095c4b0b74d3 GDBThreadGroup.st --- a/GDBThreadGroup.st Sun Sep 07 14:42:02 2014 +0100 +++ b/GDBThreadGroup.st Sun Sep 07 22:44:55 2014 +0100 @@ -1,6 +1,6 @@ "{ Package: 'jv:libgdbs' }" -GDBObject subclass:#GDBThreadGroup +GDBDebuggerObject subclass:#GDBThreadGroup instanceVariableNames:'id pid exit_code threads' classVariableNames:'' poolDictionaries:'' @@ -9,10 +9,10 @@ !GDBThreadGroup class methodsFor:'instance creation'! -newWithId: aString - ^ self new setId: aString; yourself +newWithDebugger: debugger id: aString + ^ self new setDebugger: debugger; setId: aString; yourself - "Created: / 06-09-2014 / 02:31:48 / Jan Vrany " + "Created: / 07-09-2014 / 21:18:36 / Jan Vrany " ! ! !GDBThreadGroup class methodsFor:'accessing - GDB value descriptors'! @@ -42,13 +42,46 @@ ^ pid ! +threadWithId: tid + ^ threads ? #() detect:[:e | e id = tid ] ifNone:[ + self error: ('No thread with id ''%1'' found!!' bindWith: tid) + ]. + + "Created: / 07-09-2014 / 21:37:01 / Jan Vrany " +! + threads threads isNil ifTrue:[ threads := List new. + ]. + ^ threads + + "Modified: / 06-09-2014 / 02:23:22 / Jan Vrany " + "Modified (format): / 07-09-2014 / 21:42:28 / Jan Vrany " +! ! + +!GDBThreadGroup methodsFor:'event handling'! + +onThreadCreated:aGDBThreadCreatedEvent + | thread | + threads isNil ifTrue:[ + threads := List new. ]. - ^ threads + thread := GDBThread newWithDebugger: debugger id: aGDBThreadCreatedEvent threadId group: self. + threads add: thread. + aGDBThreadCreatedEvent setThread: thread. + + "Created: / 07-09-2014 / 21:25:08 / Jan Vrany " +! - "Modified: / 06-09-2014 / 02:23:22 / Jan Vrany " +onThreadExited:aGDBThreadExitedEvent + | thread | + + thread := self threadWithId:aGDBThreadExitedEvent threadId. + thread setTerminated. + aGDBThreadExitedEvent setThread: thread + + "Created: / 07-09-2014 / 21:25:24 / Jan Vrany " ! ! !GDBThreadGroup methodsFor:'initialization'!