author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 23 Nov 2017 22:45:57 +0000 | |
changeset 49 | 2ec7f7ed9242 |
parent 44 | 41cc5a7840fe |
child 53 | 738e2f6626bf |
permissions | -rw-r--r-- |
49
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
1 |
" |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
2 |
jv:vdb - Visual / VM Debugger |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
3 |
Copyright (C) 2015-now Jan Vrany |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
4 |
|
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
5 |
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License' |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
6 |
|
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
7 |
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/ |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
8 |
" |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
"{ Package: 'jv:vdb' }" |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
11 |
"{ NameSpace: Smalltalk }" |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
12 |
|
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
VDBModelPresenter subclass:#VDBThreadGroupPresenter |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
instanceVariableNames:'threadGroup' |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
classVariableNames:'' |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
16 |
poolDictionaries:'' |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
17 |
category:'VDB-Presentation' |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
|
49
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
20 |
!VDBThreadGroupPresenter class methodsFor:'documentation'! |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
21 |
|
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
22 |
copyright |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
23 |
" |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
24 |
jv:vdb - Visual / VM Debugger |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
25 |
Copyright (C) 2015-now Jan Vrany |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
26 |
|
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
27 |
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License' |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
28 |
|
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
29 |
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/ |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
30 |
" |
2ec7f7ed9242
License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
44
diff
changeset
|
31 |
! ! |
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
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 |
!VDBThreadGroupPresenter methodsFor:'accessing'! |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
34 |
|
24 | 35 |
icon |
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
|
36 |
threadGroup isRunning ifTrue:[ ^ VDBIconLibrary threadGroupRunning16x16 ]. |
00f6de198c7f
Minor fixes in the UI - redraw stack list when execution state changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
37 |
threadGroup isStopped ifTrue:[ ^ VDBIconLibrary threadGroupStopped16x16 ]. |
34
cda31dfd5386
Minor tweaks in stack view
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
38 |
threadGroup isDead ifTrue:[ ^ VDBIconLibrary threadGroupTerminated16x16 ]. |
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
|
39 |
^ nil |
24 | 40 |
|
41 |
"Created: / 22-09-2014 / 22:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
34
cda31dfd5386
Minor tweaks in stack view
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
31
diff
changeset
|
42 |
"Modified: / 30-09-2014 / 00:55:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
24 | 43 |
! |
44 |
||
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
|
45 |
label |
44 | 46 |
| executableOrThreadGrouppId pidOrEmpty state | |
47 |
||
48 |
threadGroup executable notNil ifTrue:[ |
|
49 |
executableOrThreadGrouppId := threadGroup executable contractTo: 30 |
|
50 |
] ifFalse:[ |
|
51 |
executableOrThreadGrouppId := 'thread group ', threadGroup id. |
|
52 |
]. |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
53 |
|
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
54 |
(threadGroup type = 'process' and:[ threadGroup pid notNil ]) ifTrue:[ |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
55 |
pidOrEmpty := 'pid ', threadGroup pid printString , ', '. |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
56 |
]. |
44 | 57 |
threadGroup isStopped ifTrue:[ |
58 |
state := 'stopped' |
|
59 |
] ifFalse:[ |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
60 |
threadGroup isRunning ifTrue:[ |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
61 |
state := 'running' |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
62 |
] ifFalse:[ |
44 | 63 |
threadGroup isFinished ifTrue:[ |
64 |
state := 'finished' |
|
65 |
] ifFalse:[ |
|
66 |
threadGroup isTerminated ifTrue:[ |
|
67 |
state := 'terminated' |
|
68 |
] ifFalse:[ |
|
69 |
state := 'not run' |
|
70 |
]]]]. |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
71 |
|
44 | 72 |
^ '%1 [%2%3]' bindWith: executableOrThreadGrouppId |
73 |
with: pidOrEmpty ? '' |
|
74 |
with: state |
|
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
|
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
|
76 |
"Created: / 22-09-2014 / 00:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 77 |
"Modified: / 07-06-2017 / 07:47:48 / 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
|
78 |
! |
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
|
79 |
|
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
|
80 |
threadGroup |
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
|
81 |
^ threadGroup |
22
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
82 |
! ! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
83 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
84 |
!VDBThreadGroupPresenter methodsFor:'initialization'! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
85 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
86 |
setThreadGroup: aGDBThreadGroup |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
87 |
threadGroup := aGDBThreadGroup |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
88 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
89 |
"Created: / 21-09-2014 / 23:38:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
90 |
! ! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
91 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
92 |
!VDBThreadGroupPresenter methodsFor:'protocol-accessing'! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
93 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
94 |
fetchChildren |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
95 |
"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
|
96 |
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
|
97 |
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
|
98 |
*** 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
|
99 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
100 |
^ threadGroup threads collect:[ :t | VDBThreadPresenter new setThread: t; parent: self ] |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
101 |
|
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
102 |
"Created: / 21-09-2014 / 23:41:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
! ! |
6684f4d82301
Temporary commit: reworking VDBStackApplication to support multiple threads and inferiors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
104 |
|
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
|
105 |
!VDBThreadGroupPresenter 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
|
106 |
|
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
|
107 |
isThreadGroupPresenter |
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
|
108 |
^ 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
|
109 |
|
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
|
110 |
"Created: / 21-09-2014 / 23:54:23 / 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
|
111 |
! ! |
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
|
112 |
|
38
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
113 |
!VDBThreadGroupPresenter class methodsFor:'documentation'! |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
114 |
|
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
115 |
version_HG |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
116 |
|
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
117 |
^ '$Changeset: <not expanded> $' |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
118 |
! ! |
9b861cb882c8
Show al thread groupd, even terminated ones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
34
diff
changeset
|
119 |