GDBThread.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 07 Sep 2014 22:44:55 +0100
changeset 36 095c4b0b74d3
parent 35 c17ecf90e446
child 37 a85f0c91f164
permissions -rw-r--r--
Added support for threads. Each thread group now knows it's threads.

"{ Package: 'jv:libgdbs' }"

GDBDebuggerObject subclass:#GDBThread
	instanceVariableNames:'id group terminated'
	classVariableNames:''
	poolDictionaries:''
	category:'GDB-Core'
!

!GDBThread class methodsFor:'instance creation'!

newWithDebugger: debugger id: id group: group
    ^ self new
        setDebugger: debugger;
        setId: id;
        setGroup: group;
        yourself.

    "Created: / 07-09-2014 / 21:33:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBThread class methodsFor:'accessing - GDB value descriptors'!

gdbValueDescriptor
    ^ (super gdbValueDescriptor)
        define: #id as: Integer;
        yourself

    "Created: / 06-09-2014 / 02:21:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBThread methodsFor:'accessing'!

id
    ^ id

    "Created: / 07-09-2014 / 22:41:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

terminated
    ^ terminated ? false

    "Modified: / 07-09-2014 / 21:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBThread methodsFor:'initialization'!

setGroup: aGDBThreadGroup
    self assert: group isNil.
    group := aGDBThreadGroup.

    "Created: / 07-09-2014 / 21:32:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

setId: tid
    self assert: id isNil.
    id := tid.

    "Created: / 07-09-2014 / 21:31:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

setTerminated
    terminated := true.

    "Created: / 07-09-2014 / 21:37:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !