--- a/GDBThreadGroup.st Tue Mar 09 20:49:55 2021 +0000
+++ b/GDBThreadGroup.st Tue Mar 09 10:15:06 2021 +0000
@@ -3,7 +3,7 @@
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
-Copyright (C) 2020 LabWare
+Copyright (C) 2020-2021 LabWare
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -36,7 +36,7 @@
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
-Copyright (C) 2020 LabWare
+Copyright (C) 2020-2021 LabWare
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -159,10 +159,10 @@
^ pid
!
-threadWithId: tid
- ^ threads ? #() detect:[:e | e isDead not and:[ e id = tid ] ] ifNone:[
- self error: ('No thread with id ''%1'' found!!' bindWith: tid)
- ].
+threadForId: tid
+ ^ threads ? #()
+ detect: [:e | e isDead not and: [ e id = tid ] ]
+ ifNone: [ self error: ('No thread with id ''%1'' found!!' bindWith: tid) ].
"Created: / 07-09-2014 / 21:37:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 22-09-2014 / 01:23:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -203,7 +203,7 @@
onThreadExitedEvent:aGDBThreadExitedEvent
| thread |
- thread := self threadWithId:aGDBThreadExitedEvent threadId.
+ thread := self threadForId: aGDBThreadExitedEvent threadId.
threads remove: thread.
thread setStatus: GDBThreadStateTerminated theOneAndOnlyInstance.
aGDBThreadExitedEvent setThread:thread.
@@ -211,34 +211,6 @@
"Created: / 07-09-2014 / 21:25:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 12-07-2017 / 13:42:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 15-01-2018 / 09:44:09 / jv"
-!
-
-onThreadSelectedEvent: aGDBThreadSelectedEvent
- | thread frame |
-
- thread := self threadWithId:aGDBThreadSelectedEvent threadId.
- frame := aGDBThreadSelectedEvent frame.
-
- aGDBThreadSelectedEvent setThread: thread.
- "/ Be carefull, thread may be running!!
- (false "thread isStopped and:[frame notNil]") ifTrue:[
- "/ This is actually not a good idea. This code is executed
- "/ within event dispatching process so one may not execute
- "/ more commands - which is what `thread stack` does. Sigh.
- aGDBThreadSelectedEvent setFrame: (thread stack at: (frame level + 1))
- ] ifFalse:[
- "/ If it is running, at least fixup it's frame, if there's any (it may not
- "/ if the thread is running at the time of =thread-select event.
- "/ Uff, so many cases...
- frame notNil ifTrue:[
- frame
- setDebugger: debugger;
- setThread: thread.
- ].
- ].
-
- "Created: / 29-07-2018 / 22:21:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 20-11-2019 / 22:09:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBThreadGroup methodsFor:'initialization'!