author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 12 Jul 2017 16:28:50 +0200 | |
changeset 45 | cd9f46746fd1 |
parent 38 | 9b861cb882c8 |
child 49 | 2ec7f7ed9242 |
permissions | -rw-r--r-- |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'jv:vdb' }" |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
4 |
|
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
VDBModelPresenter subclass:#VDBThreadPresenter |
45 | 6 |
instanceVariableNames:'thread name' |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
classVariableNames:'' |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
poolDictionaries:'' |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
category:'VDB-Presentation' |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
12 |
|
23
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
13 |
!VDBThreadPresenter methodsFor:'accessing'! |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
|
24 | 15 |
icon |
16 |
thread isRunning ifTrue:[ ^ VDBIconLibrary threadRunning16x16 ]. |
|
17 |
thread isStopped ifTrue:[ ^ VDBIconLibrary threadStopped16x16 ]. |
|
18 |
thread isTerminated ifTrue:[ ^ VDBIconLibrary threadTerminated16x16 ]. |
|
19 |
||
20 |
^ nil |
|
21 |
||
22 |
"Created: / 22-09-2014 / 22:00:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
23 |
! |
|
24 |
||
23
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
25 |
label |
45 | 26 |
name isNil ifTrue:[ |
27 |
thread isRunning ifFalse:[ |
|
28 |
name := thread name. |
|
29 |
] |
|
30 |
]. |
|
31 |
^ '%1 [%2]' bindWith: (name notNil ifTrue:[name] ifFalse:['thread ' , thread id printString]) with: thread status |
|
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
32 |
|
23
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
33 |
"Created: / 22-09-2014 / 00:14:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
45 | 34 |
"Modified: / 12-07-2017 / 14:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
35 |
! |
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
36 |
|
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
37 |
thread |
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
38 |
^ thread |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
39 |
! ! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
40 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
41 |
!VDBThreadPresenter methodsFor:'initialization'! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
42 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
43 |
setThread: aGDBThread |
45 | 44 |
thread := aGDBThread. |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
45 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
46 |
"Created: / 21-09-2014 / 23:39:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
45 | 47 |
"Modified: / 12-07-2017 / 14:21:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
48 |
! ! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
49 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
50 |
!VDBThreadPresenter methodsFor:'protocol-accessing'! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
51 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
52 |
fetchChildren |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
"should compute the list of children via the model. |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
Be aware, that the somewhat stupid 'optimization' of how the model is fetched may lead to |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
a O(n*log n) or even O(n^2) behavior here. |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
*** to optimize: redefine by subClass" |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
|
23
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
58 |
thread isDead ifTrue:[ ^ #() ]. |
31
00f6de198c7f
Minor fixes in the UI - redraw stack list when execution state changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
59 |
thread isRunning ifTrue:[ ^ #() ]. |
23
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
60 |
^ thread stack collect:[ :f | VDBFramePresenter new setFrame: f; parent: self ] |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
"Created: / 21-09-2014 / 23:42:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
31
00f6de198c7f
Minor fixes in the UI - redraw stack list when execution state changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
63 |
"Modified: / 30-09-2014 / 00:04:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
64 |
! ! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
65 |
|
23
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
66 |
!VDBThreadPresenter methodsFor:'testing'! |
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
67 |
|
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
68 |
isThreadPresenter |
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
69 |
^ true |
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
70 |
|
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
71 |
"Created: / 21-09-2014 / 23:54:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
72 |
! ! |
ed5f4b55cee5
Added toolbar and icons. Show all thread groups and threads in stack view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
73 |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
74 |
!VDBThreadPresenter class methodsFor:'documentation'! |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
75 |
|
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
76 |
version_HG |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
77 |
|
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
78 |
^ '$Changeset: <not expanded> $' |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
79 |
! ! |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
80 |