author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 30 Oct 2018 20:04:25 +0000 | |
changeset 159 | 5a364902a0fa |
parent 136 | 213e436320fe |
child 214 | 0c56387e5d12 |
permissions | -rw-r--r-- |
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
1 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
2 |
jv:libgdbs - GNU Debugger Interface Library |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
3 |
Copyright (C) 2015-now Jan Vrany |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
4 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
5 |
This library is free software; you can redistribute it and/or |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
6 |
modify it under the terms of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
7 |
License as published by the Free Software Foundation; either |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
8 |
version 2.1 of the License. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
9 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
10 |
This library is distributed in the hope that it will be useful, |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
13 |
Lesser General Public License for more details. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
14 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
15 |
You should have received a copy of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
16 |
License along with this library; if not, write to the Free Software |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
18 |
" |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
"{ Package: 'jv:libgdbs' }" |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
|
53 | 21 |
"{ NameSpace: Smalltalk }" |
22 |
||
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
23 |
GDBDebuggerObject subclass:#GDBThread |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
24 |
instanceVariableNames:'id group status info stack' |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
classVariableNames:'' |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
poolDictionaries:'' |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
category:'GDB-Core' |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
|
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
30 |
!GDBThread class methodsFor:'documentation'! |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
31 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
32 |
copyright |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
33 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
34 |
jv:libgdbs - GNU Debugger Interface Library |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
35 |
Copyright (C) 2015-now Jan Vrany |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
36 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
37 |
This library is free software; you can redistribute it and/or |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
38 |
modify it under the terms of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
39 |
License as published by the Free Software Foundation; either |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
40 |
version 2.1 of the License. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
41 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
42 |
This library is distributed in the hope that it will be useful, |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
43 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
44 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
45 |
Lesser General Public License for more details. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
46 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
47 |
You should have received a copy of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
48 |
License along with this library; if not, write to the Free Software |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
49 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
50 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
51 |
! ! |
70
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
52 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
53 |
!GDBThread class methodsFor:'instance creation'! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
54 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
55 |
newWithDebugger: debugger id: id group: group |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
56 |
^ self new |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
57 |
setDebugger: debugger; |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
58 |
setId: id; |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
59 |
setGroup: group; |
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
60 |
setStatus: GDBThreadStateRunning theOneAndOnlyInstance; |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
61 |
yourself. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
62 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
63 |
"Created: / 07-09-2014 / 21:33:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
64 |
"Modified: / 14-01-2018 / 22:33:26 / jv" |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
65 |
! ! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
66 |
|
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
!GDBThread class methodsFor:'accessing - GDB value descriptors'! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
68 |
|
45
deb908479a37
Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
43
diff
changeset
|
69 |
description |
deb908479a37
Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
43
diff
changeset
|
70 |
^ (super description) |
deb908479a37
Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
43
diff
changeset
|
71 |
define:#id as:Integer; |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
72 |
yourself |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
73 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
74 |
"Created: / 06-09-2014 / 02:21:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
! ! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
76 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
77 |
!GDBThread methodsFor:'accessing'! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
78 |
|
43
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
79 |
group |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
80 |
^ group |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
81 |
! |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
82 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
83 |
id |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
84 |
^ id |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
85 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
86 |
"Created: / 07-09-2014 / 22:41:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
87 |
! |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
88 |
|
70
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
89 |
name |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
90 |
^ self targetId |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
91 |
|
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
92 |
"Created: / 10-03-2015 / 00:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
93 |
! |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
94 |
|
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
95 |
stack |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
96 |
self ensureIsStopped. |
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
39
diff
changeset
|
97 |
stack isNil ifTrue:[ |
103
56bf65352505
Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
98 |
stack := GDBTransientDataHolder debugger: debugger factory:[ :old | |
136
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
99 |
[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
100 |
| result depth new oldFrameIndex oldFrame newFrameIndex newFrame | |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
101 |
|
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
102 |
result := debugger send: (GDBMI_stack_info_depth new arguments: (Array with: '--thread' with: id with: 100)). |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
103 |
depth := result propertyAt: #depth. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
104 |
result := debugger send: (GDBMI_stack_list_frames new arguments: (Array with: '--thread' with: id with: 0 with: depth - 1 )). |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
105 |
new := result propertyAt: #stack. |
103
56bf65352505
Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
106 |
|
136
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
107 |
"/ Now, walk from the bottom of the stack (the least recent frame) and |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
108 |
"/ ipdate `new` array with frames from `old` array to preserve the |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
109 |
"/ identity. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
110 |
newFrameIndex := new size. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
111 |
oldFrameIndex := old size. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
112 |
[ newFrameIndex > 0 and:[ oldFrameIndex > 0 ] ] whileTrue:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
113 |
newFrame := new at: newFrameIndex. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
114 |
oldFrame := old at: oldFrameIndex. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
115 |
"/ If frame addrs matches, both frames really represent the same thing so |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
116 |
"/ just replace the 'new' frame with the 'old'. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
117 |
newFrame addr = oldFrame addr ifTrue:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
118 |
"/ OK, the two frames are really the same thing |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
119 |
oldFrame setLevel: newFrame level. "/ Update level |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
120 |
new at: newFrameIndex put: (old at: oldFrameIndex). |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
121 |
newFrameIndex := newFrameIndex - 1. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
122 |
oldFrameIndex := oldFrameIndex - 1. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
123 |
] ifFalse:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
124 |
"/ No, frame pc differs. This is the first time they differ so |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
125 |
"/ it could be the same frame just on different PC (since PC of |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
126 |
"/ caller did not change). Subsequent frames could also be "same" |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
127 |
"/ if they're inlined into caller - in this case, the PC (#addr) of |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
128 |
"/ the caller frame and inlined callee are the same. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
129 |
"/ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
130 |
"/ So, we update subsequent frames as long as |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
131 |
"/ a) function names are the same AND |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
132 |
"/ b) PC is the same as PC of its caller |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
133 |
"/ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
134 |
"/ Complicated, isn't it? |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
135 |
| oldAddr newAddr | |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
136 |
oldAddr := oldFrame addr. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
137 |
newAddr := newFrame addr. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
138 |
[ newFrameIndex > 0 and:[ oldFrameIndex > 0 ] ] whileTrue:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
139 |
newFrame := new at: newFrameIndex. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
140 |
oldFrame := old at: oldFrameIndex. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
141 |
("a)"oldFrame func = newFrame func and: ["b)"oldFrame addr = oldAddr and:[newFrame addr = newAddr]]) ifTrue:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
142 |
"/ Update the frame... |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
143 |
oldFrame setAddr: newFrame addr. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
144 |
oldFrame setLine: newFrame line. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
145 |
oldFrame setLevel: newFrame level. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
146 |
new at: newFrameIndex put: (old at: oldFrameIndex). |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
147 |
newFrameIndex := newFrameIndex - 1. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
148 |
oldFrameIndex := oldFrameIndex - 1. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
149 |
] ifFalse:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
150 |
"/ Terminate the loop, see the condition above. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
151 |
oldFrameIndex := 0. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
152 |
]. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
153 |
] |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
154 |
]. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
155 |
]. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
156 |
"/ For the remaining really new frames, set the debugger |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
157 |
"/ and the thread. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
158 |
[ newFrameIndex > 0 ] whileTrue:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
159 |
newFrame := new at: newFrameIndex. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
160 |
newFrame setDebugger: debugger. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
161 |
newFrame setThread: self. |
103
56bf65352505
Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
162 |
newFrameIndex := newFrameIndex - 1. |
56bf65352505
Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
163 |
]. |
136
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
164 |
new |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
165 |
] on: GDBError do:[ :ex | |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
166 |
self isRunning ifFalse:[ |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
167 |
ex pass. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
168 |
]. |
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
169 |
old. |
55
437ee6413c74
Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
170 |
]. |
41
fb48207b6104
Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
40
diff
changeset
|
171 |
]. |
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
172 |
]. |
41
fb48207b6104
Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
40
diff
changeset
|
173 |
^ stack value |
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
174 |
|
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
175 |
"Created: / 09-09-2014 / 00:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
136
213e436320fe
Fix `GDBThread >> stack` to return old stack when thread is running
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
130
diff
changeset
|
176 |
"Modified: / 01-09-2018 / 00:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
177 |
! |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
178 |
|
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
179 |
status |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
180 |
status isUnknown ifTrue:[ |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
181 |
status := self info state |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
182 |
]. |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
183 |
^ status |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
184 |
|
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
185 |
"Modified: / 12-07-2017 / 13:36:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
186 |
! |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
187 |
|
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
188 |
targetId |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
189 |
^ self info targetId |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
190 |
|
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
191 |
"Created: / 10-03-2015 / 00:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
192 |
! ! |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
193 |
|
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
194 |
!GDBThread methodsFor:'accessing-private'! |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
195 |
|
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
196 |
info |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
197 |
info isNil ifTrue:[ |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
198 |
info := GDBTransientDataHolder debugger: debugger factory:[ |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
199 |
| result infos | |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
200 |
|
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
201 |
result := debugger send: (GDBMI_thread_info new arguments: (Array with: id)). |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
202 |
infos := result propertyAt: #threads. |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
203 |
self assert: (infos isEmptyOrNil or:[ infos size == 1 and:[ infos first id = id ] ]). |
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
204 |
infos isEmptyOrNil |
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
205 |
ifTrue:[ GDBThreadInfo new setId: id state: GDBThreadStateTerminated theOneAndOnlyInstance ] |
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
206 |
ifFalse:[ infos first ] |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
207 |
]. |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
208 |
]. |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
209 |
^ info value |
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
210 |
|
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
211 |
"Created: / 08-03-2015 / 09:07:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
212 |
"Modified: / 17-11-2017 / 20:21:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
213 |
! ! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
214 |
|
70
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
215 |
!GDBThread methodsFor:'displaying'! |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
216 |
|
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
217 |
displayString |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
218 |
^ '%1 [%2]' bindWith: self name with: self status |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
219 |
|
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
220 |
"Created: / 10-03-2015 / 00:32:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
221 |
! ! |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
222 |
|
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
223 |
!GDBThread methodsFor:'event handling'! |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
224 |
|
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
225 |
onRunningEvent: aGDBRunningEvent |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
226 |
self assert: (aGDBRunningEvent threads includesIdentical: self). |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
227 |
status := GDBThreadStateRunning theOneAndOnlyInstance. |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
228 |
|
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
229 |
"Created: / 12-07-2017 / 13:50:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
230 |
! |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
231 |
|
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
232 |
onStoppedEvent: aGDBStoppedEvent |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
233 |
self assert: (aGDBStoppedEvent threads includesIdentical: self). |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
234 |
status := GDBThreadStateStopped theOneAndOnlyInstance. |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
235 |
|
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
236 |
"Created: / 12-07-2017 / 13:50:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
237 |
! ! |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
238 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
239 |
!GDBThread methodsFor:'initialization'! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
240 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
241 |
setGroup: aGDBThreadGroup |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
242 |
self assert: group isNil. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
243 |
group := aGDBThreadGroup. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
244 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
245 |
"Created: / 07-09-2014 / 21:32:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
246 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
247 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
248 |
setId: tid |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
249 |
self assert: id isNil. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
250 |
id := tid. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
251 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
252 |
"Created: / 07-09-2014 / 21:31:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
253 |
"Modified: / 08-03-2015 / 09:08:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
254 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
255 |
|
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
256 |
setStatus: aGDBThreadState |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
257 |
status := aGDBThreadState |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
258 |
|
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
259 |
"Created: / 12-07-2017 / 13:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
260 |
! |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
261 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
262 |
setTerminated |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
263 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
264 |
"Created: / 07-09-2014 / 21:37:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
265 |
"Modified: / 08-03-2015 / 09:08:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
266 |
! ! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
267 |
|
43
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
268 |
!GDBThread methodsFor:'printing & storing'! |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
269 |
|
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
270 |
printOn:aStream |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
271 |
"append a printed representation if the receiver to the argument, aStream" |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
272 |
|
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
273 |
aStream nextPutAll:'thread '. |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
274 |
id printOn:aStream. |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
275 |
"/ aStream nextPutAll:'in group '. |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
276 |
"/ group id printOn:aStream. |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
277 |
aStream nextPutAll:' ['. |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
278 |
self status printOn:aStream. |
43
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
279 |
aStream nextPutAll:']'. |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
280 |
|
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
281 |
"Modified: / 08-03-2015 / 09:07:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
43
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
282 |
! ! |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
283 |
|
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
284 |
!GDBThread methodsFor:'private'! |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
285 |
|
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
286 |
ensureIsStopped |
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
39
diff
changeset
|
287 |
self isStopped ifFalse:[ |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
288 |
(GDBInvalidObjectError newException) |
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
289 |
parameter:self; |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
290 |
messageText:'Invalid state (thread is running or already dead)'; |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
291 |
raise. |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
292 |
]. |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
293 |
|
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
294 |
"Created: / 09-09-2014 / 00:04:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
39
diff
changeset
|
295 |
"Modified: / 16-09-2014 / 23:51:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
39
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
296 |
! ! |
2b9d2f75906f
Some work on execution stack model
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
297 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
298 |
!GDBThread methodsFor:'testing'! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
299 |
|
43
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
300 |
isDead |
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
301 |
^ self isTerminated |
43
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
302 |
|
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
303 |
"Created: / 22-09-2014 / 00:54:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
304 |
"Modified: / 08-03-2015 / 12:35:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
305 |
"Modified: / 14-01-2018 / 22:34:04 / jv" |
43
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
306 |
! |
22236b6d1d9a
Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
41
diff
changeset
|
307 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
308 |
isRunning |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
309 |
^ self status isRunning |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
310 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
311 |
"Created: / 07-09-2014 / 23:23:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
312 |
"Modified: / 08-03-2015 / 09:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
313 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
314 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
315 |
isStopped |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
316 |
^ self status isStopped |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
317 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
318 |
"Created: / 07-09-2014 / 23:23:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
319 |
"Modified: / 08-03-2015 / 09:08:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
320 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
321 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
322 |
isTerminated |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
323 |
^ self status isTerminated |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
324 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
325 |
"Created: / 07-09-2014 / 23:23:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
c4ac76afe03d
Keep thread information in transient thread-info object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
326 |
"Modified: / 08-03-2015 / 09:08:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
106
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
327 |
! |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
328 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
329 |
isValid |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
330 |
^ group isValid and:[ self isDead not ] |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
331 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
332 |
"Created: / 04-02-2018 / 21:31:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
333 |
! ! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
334 |
|
70
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
335 |
!GDBThread class methodsFor:'documentation'! |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
336 |
|
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
337 |
version_HG |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
338 |
|
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
339 |
^ '$Changeset: <not expanded> $' |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
340 |
! ! |
6d7285bb1703
GDBThread: use native name in thread's displayString
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
341 |