author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 05 Jun 2017 17:56:05 +0100 | |
changeset 80 | b063ee120d71 |
parent 79 | 303c4edc75ad |
child 82 | 7ee72b7a498f |
permissions | -rw-r--r-- |
0 | 1 |
"{ Package: 'jv:libgdbs' }" |
2 |
||
53 | 3 |
"{ NameSpace: Smalltalk }" |
4 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
5 |
Object subclass:#GDBDebugger |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
6 |
instanceVariableNames:'connection commandSequenceNumber inferiorStateSequenceNumber |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
7 |
inferiors selectedInferior selectedThread selectedFrame' |
0 | 8 |
classVariableNames:'' |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
9 |
poolDictionaries:'GDBCommandStatus' |
0 | 10 |
category:'GDB-Core' |
11 |
! |
|
12 |
||
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
13 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
14 |
!GDBDebugger class methodsFor:'instance creation'! |
0 | 15 |
|
16 |
new |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
17 |
^ self newWithProcess: GDBUnixProcess new |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
18 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
19 |
"Modified: / 20-06-2014 / 21:44:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
20 |
! |
0 | 21 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
22 |
newWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
23 |
^ self basicNew initializeWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
24 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
25 |
"Created: / 20-06-2014 / 21:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 26 |
! ! |
27 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
28 |
!GDBDebugger methodsFor:'accessing'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
29 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
30 |
announcer |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
31 |
^ connection eventAnnouncer. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
32 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
33 |
"Created: / 02-06-2014 / 23:06:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
34 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
35 |
|
80
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
36 |
attach: aStringOrInteger |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
37 |
"Attach to a running process. |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
38 |
API equivalent to CLI command: |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
39 |
|
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
40 |
(gdb) attach <aStringOrInteger> |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
41 |
" |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
42 |
self send:(GDBMI_target_attach arguments:{ aStringOrInteger asString }) andWait: true. |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
43 |
|
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
44 |
"Created: / 05-06-2017 / 17:08:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
45 |
! |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
46 |
|
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
47 |
consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
48 |
^ connection consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
49 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
50 |
"Created: / 31-05-2017 / 23:20:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
51 |
"Modified: / 02-06-2017 / 23:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
52 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
53 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
54 |
consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
55 |
^ connection consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
56 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
57 |
"Created: / 31-05-2017 / 23:20:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
58 |
"Modified: / 02-06-2017 / 23:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
59 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
60 |
|
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
61 |
executable: aStringOrFilename |
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
62 |
"Sets the executable to debug. |
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
63 |
API equivalent to CLI command: |
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
64 |
|
80
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
65 |
(gdb) exec-file <aStringOrFilename> |
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
66 |
" |
80
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
67 |
self executable: aStringOrFilename arguments: nil |
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
68 |
|
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
69 |
"Created: / 28-02-2015 / 00:19:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
80
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
70 |
"Modified: / 05-06-2017 / 17:06:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
71 |
! |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
72 |
|
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
73 |
executable: aStringOrFilename arguments: anArray"of String" |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
74 |
"Sets the executable to debug and argument to pass to it. |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
75 |
API equivalent to CLI command: |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
76 |
|
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
77 |
(gdb) exec-file <aStringOrFilename> |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
78 |
(gdb) set args <anArray> |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
79 |
" |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
80 |
|
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
81 |
self send:(GDBMI_file_exec_and_symbols arguments:{ aStringOrFilename asString }) andWait: true. |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
82 |
anArray notEmptyOrNil ifTrue:[ |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
83 |
self send: (GDBMI_exec_arguments arguments: anArray) andWait: true. |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
84 |
]. |
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
85 |
|
b063ee120d71
Added API to attach to a running process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
86 |
"Created: / 05-06-2017 / 17:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
87 |
! |
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
88 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
89 |
inferiorForId: id |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
90 |
^ inferiors ? #() detect:[:e | e id = id ] ifNone:[ |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
91 |
self error: ('No inferior (thread group) with id ''%1'' found!!' bindWith: id) |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
92 |
]. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
93 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
94 |
"Created: / 07-09-2014 / 21:22:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
95 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
96 |
|
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
97 |
inferiorStderr |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
98 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
99 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
100 |
"Created: / 09-06-2014 / 10:01:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11
474fbb650afe
PTY support refactored to use GDBPTY object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10
diff
changeset
|
101 |
"Modified: / 09-06-2014 / 18:26:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
102 |
! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
103 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
104 |
inferiorStdin |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
105 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
106 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
107 |
"Created: / 09-06-2014 / 10:00:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11
474fbb650afe
PTY support refactored to use GDBPTY object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10
diff
changeset
|
108 |
"Modified: / 09-06-2014 / 18:27:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
109 |
! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
110 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
111 |
inferiorStdout |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
112 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
113 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
114 |
"Created: / 09-06-2014 / 10:01:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11
474fbb650afe
PTY support refactored to use GDBPTY object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10
diff
changeset
|
115 |
"Modified: / 09-06-2014 / 18:27:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
116 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
117 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
118 |
inferiors |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
119 |
^ inferiors |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
120 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
121 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
122 |
selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
123 |
selectedInferior isNil ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
124 |
inferiors size == 1 ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
125 |
^ inferiors anElement. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
126 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
127 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
128 |
^ selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
129 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
130 |
"Created: / 07-09-2014 / 23:02:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
131 |
! ! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
132 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
133 |
!GDBDebugger methodsFor:'accessing-private'! |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
134 |
|
19 | 135 |
currentInferiorStateSequnceNumber |
136 |
^ inferiorStateSequenceNumber |
|
137 |
||
138 |
"Created: / 19-06-2014 / 22:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
139 |
! |
|
140 |
||
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
141 |
nextCommandSequnceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
142 |
commandSequenceNumber := commandSequenceNumber + 1. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
143 |
commandSequenceNumber == SmallInteger maxVal ifTrue:[ |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
144 |
commandSequenceNumber := 0. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
145 |
]. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
146 |
^ commandSequenceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
147 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
148 |
"Created: / 02-06-2014 / 23:48:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
149 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
150 |
|
19 | 151 |
nextInferiorStateSequnceNumber |
152 |
inferiorStateSequenceNumber := inferiorStateSequenceNumber + 1. |
|
153 |
inferiorStateSequenceNumber == SmallInteger maxVal ifTrue:[ |
|
154 |
inferiorStateSequenceNumber := 0. |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
155 |
]. |
19 | 156 |
^ inferiorStateSequenceNumber |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
157 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
158 |
"Created: / 02-06-2014 / 23:48:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
159 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
160 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
161 |
!GDBDebugger methodsFor:'commands'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
162 |
|
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
163 |
send: command |
64 | 164 |
"Execute given `command` and wait until it finishes and return its result. |
165 |
`command` may be either a GDBCommand or string, in which case it will |
|
166 |
be parsed into a GDBCommand. |
|
167 |
" |
|
168 |
^ self send:command andWait:true. |
|
8
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
169 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
170 |
"Created: / 03-06-2014 / 00:10:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 171 |
"Modified (comment): / 08-03-2015 / 05:50:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
172 |
! |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
173 |
|
64 | 174 |
send:command andWait:wait |
175 |
"Sends given `command` to GDB. If `wait` is true, wait for |
|
176 |
command to finish and return the command result. |
|
177 |
Otherwise, return nil immediately. |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
178 |
|
64 | 179 |
`command` may be either a GDBCommand or string, in which case it will |
180 |
be parsed into a GDBCommand. |
|
181 |
" |
|
182 |
||
183 |
| cmd token blocker handler1 handler2 result | |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
184 |
|
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
185 |
cmd := command. |
64 | 186 |
cmd isString ifTrue:[ |
187 |
cmd := GDBCLICommand new value:cmd. |
|
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
188 |
]. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
189 |
token := self nextCommandSequnceNumber. |
64 | 190 |
cmd token:token. |
191 |
^ wait ifTrue:[ |
|
192 |
self assert:Processor activeProcess ~~ connection eventDispatchProcess |
|
193 |
message:'Cannot send commands from within event dispatching process. Would deadlock'. |
|
194 |
handler1 := [:ev | |
|
195 |
ev token == token ifTrue:[ |
|
196 |
connection eventAnnouncer unsubscribe:handler1. |
|
197 |
result := ev result. |
|
198 |
connection eventAnnouncerInternal when:GDBEventSetProcessingFinished |
|
199 |
do:handler2. |
|
200 |
] |
|
201 |
]. |
|
202 |
handler2 := [:ev | |
|
203 |
connection eventAnnouncerInternal unsubscribe:handler2. |
|
204 |
blocker signal. |
|
205 |
]. |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
206 |
blocker := Semaphore new. |
64 | 207 |
connection eventAnnouncer when:GDBCommandResultEvent do:handler1. |
208 |
connection pushEvent:(GDBCommandEvent new command:cmd). |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
209 |
blocker wait. |
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
38
diff
changeset
|
210 |
result. |
64 | 211 |
] |
212 |
ifFalse:[ |
|
213 |
connection pushEvent:(GDBCommandEvent new command:cmd). |
|
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
38
diff
changeset
|
214 |
nil. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
215 |
] |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
216 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
217 |
"Created: / 02-06-2014 / 23:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 218 |
"Modified: / 08-03-2015 / 05:51:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
219 |
! |
|
220 |
||
221 |
send:command andWaitFor:eventHandlers |
|
222 |
"Sends given `command` to GDB and then wait for events mathing |
|
223 |
`eventHandlers`. |
|
224 |
||
225 |
Params: |
|
226 |
`command` may be either a GDBCommand or string, in which case it will |
|
227 |
be parsed into a GDBCommand. |
|
228 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
229 |
of event classes or blocks. |
|
230 |
- If nil then do not wait for anything (use nil for async send) |
|
231 |
- If event class, then wait for an event of that class. Note, that |
|
232 |
subclasses are handled too. |
|
233 |
- If block, then wait for an event for which the block returns true. |
|
234 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
235 |
||
236 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
237 |
||
238 |
^ self send: command andWaitFor: eventHandlers withTimeoutMs: nil |
|
239 |
||
240 |
"Created: / 08-03-2015 / 06:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
241 |
! |
|
242 |
||
243 |
send:command andWaitFor:eventHandlers withTimeoutMs:timeout |
|
244 |
"Sends given `command` to GDB and then wait for events mathing |
|
245 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
246 |
in specified time. |
|
247 |
||
248 |
Params: |
|
249 |
`command` may be either a GDBCommand or string, in which case it will |
|
250 |
be parsed into a GDBCommand. |
|
251 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
252 |
of event classes or blocks. |
|
253 |
- If nil then do not wait for anything (use nil for async send) |
|
254 |
- If event class, then wait for an event of that class. Note, that |
|
255 |
subclasses are handled too. |
|
256 |
- If block, then wait for an event for which the block returns true. |
|
257 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
258 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
259 |
then wait for indefinitly |
|
260 |
||
261 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
262 |
||
263 |
| commandObject | |
|
264 |
||
265 |
command isString ifTrue:[ |
|
266 |
commandObject := (GDBMIParser on:command) parseCommand. |
|
267 |
commandObject token:self nextCommandSequnceNumber. |
|
268 |
] ifFalse:[ |
|
269 |
commandObject := command. |
|
270 |
commandObject token isNil ifTrue:[ |
|
271 |
commandObject token:self nextCommandSequnceNumber. |
|
272 |
]. |
|
273 |
]. |
|
274 |
^ self |
|
275 |
do:[ connection pushEvent:(GDBCommandEvent new command: commandObject) ] |
|
276 |
andWaitFor: eventHandlers |
|
277 |
withTimeoutMs: timeout |
|
278 |
||
279 |
"Created: / 07-03-2015 / 11:38:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
280 |
"Modified: / 08-03-2015 / 07:31:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
281 |
! ! |
|
282 |
||
283 |
!GDBDebugger methodsFor:'commands-convenience'! |
|
284 |
||
285 |
do: block andWaitFor:eventHandlers |
|
286 |
"Evaluates a given block and then wait for events. |
|
287 |
`eventHandlers`. |
|
288 |
Params: |
|
289 |
`block` block to evaluate |
|
290 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
291 |
of event classes or blocks. |
|
292 |
- If nil then do not wait for anything (use nil for async send) |
|
293 |
- If event class, then wait for an event of that class. Note, that |
|
294 |
subclasses are handled too. |
|
295 |
- If block, then wait for an event for which the block returns true. |
|
296 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
297 |
Returns: a matching event or events (in case a collection of handlers has been passed)" |
|
298 |
||
299 |
^ self do: block andWaitFor: eventHandlers withTimeoutMs: nil |
|
300 |
||
301 |
"Created: / 08-03-2015 / 07:30:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
302 |
! |
|
303 |
||
304 |
do: block andWaitFor:eventHandlers withTimeoutMs:timeout |
|
305 |
"Evaluates a given block and then wait for events. |
|
306 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
307 |
in specified time. |
|
308 |
||
309 |
Params: |
|
310 |
`block` block to evaluate |
|
311 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
312 |
of event classes or blocks. |
|
313 |
- If nil then do not wait for anything (use nil for async send) |
|
314 |
- If event class, then wait for an event of that class. Note, that |
|
315 |
subclasses are handled too. |
|
316 |
- If block, then wait for an event for which the block returns true. |
|
317 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
318 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
319 |
then wait for indefinitly |
|
320 |
||
321 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
322 |
||
323 |
| handlersArray handlerFinal eventsArray blocker | |
|
324 |
||
325 |
eventHandlers isNil ifTrue:[ |
|
326 |
"/ Asynchronous send... |
|
327 |
self assert:timeout isNil. |
|
328 |
block value. |
|
329 |
^ nil |
|
330 |
]. |
|
331 |
"/ Synchronous send... |
|
332 |
self assert:Processor activeProcess ~~ connection eventDispatchProcess |
|
333 |
message:'Cannot send commands from within event dispatching process. Would deadlock'. |
|
334 |
eventHandlers isCollection |
|
335 |
ifTrue:[ handlersArray := eventHandlers ] |
|
336 |
ifFalse:[ handlersArray := Array with:eventHandlers ]. |
|
337 |
eventsArray := Array new:handlersArray size. |
|
338 |
1 to:handlersArray size do:[:i | |
|
339 |
| handler | |
|
340 |
||
341 |
handler := handlersArray at:i. |
|
342 |
handlersArray at:i |
|
343 |
put:[:event | |
|
344 |
| matches | |
|
345 |
||
346 |
matches := handler isBlock ifTrue:[ handler value:event ] ifFalse:[ event isKindOf:handler ]. |
|
347 |
(matches and:[ i == 1 or:[ (eventsArray at:i - 1) notNil ] ]) ifTrue:[ |
|
348 |
eventsArray at:i put:event. |
|
349 |
self announcer unsubscribe:(handlersArray at:i). |
|
350 |
i == handlersArray size ifTrue:[ |
|
351 |
connection eventAnnouncerInternal when: GDBEventSetProcessingFinished do: handlerFinal. |
|
352 |
]. |
|
353 |
]. |
|
354 |
]. |
|
355 |
self announcer when:GDBEvent do:(handlersArray at:i). |
|
356 |
]. |
|
357 |
handlerFinal := [ :event | connection eventAnnouncerInternal unsubscribe: handlerFinal. blocker signal ]. |
|
358 |
blocker := Semaphore new. |
|
359 |
block value. |
|
360 |
[ |
|
361 |
(blocker waitWithTimeoutMs:timeout) isNil ifTrue:[ |
|
362 |
eventsArray := nil. |
|
363 |
]. |
|
364 |
] ensure:[ |
|
365 |
handlersArray do:[:handler | |
|
366 |
handler notNil ifTrue:[ |
|
367 |
self announcer unsubscribe:handler |
|
368 |
] |
|
369 |
]. |
|
370 |
]. |
|
371 |
eventsArray isNil ifTrue:[ |
|
372 |
(TimeoutError newException) |
|
373 |
parameter:timeout; |
|
374 |
raise. |
|
375 |
]. |
|
376 |
^ eventHandlers isCollection ifTrue:[ eventsArray ] ifFalse:[ eventsArray first ] |
|
377 |
||
378 |
"Created: / 08-03-2015 / 07:28:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
379 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
380 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
381 |
!GDBDebugger methodsFor:'event handling'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
382 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
383 |
onCommandEvent:aGDBCommandEvent |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
384 |
connection send:aGDBCommandEvent command. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
385 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
386 |
"Created: / 02-06-2014 / 23:38:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
387 |
"Modified: / 20-06-2014 / 22:09:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
388 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
389 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
390 |
onExitEvent:aGDBExitEvent |
8
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
391 |
self release. |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
392 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
393 |
"Created: / 03-06-2014 / 00:36:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9
5cc8797f6523
Make simple example with -gdb-exit command working
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
8
diff
changeset
|
394 |
"Modified: / 04-06-2014 / 09:28:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
395 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
396 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
397 |
onRunningEvent: aGDBRunningEvent |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
398 |
| threads threadId | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
399 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
400 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
401 |
threadId := aGDBRunningEvent threadId. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
402 |
threadId = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
403 |
threadId := threadId asInteger. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
404 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
405 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
406 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
407 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
408 |
(threadId isString or:[thread id = threadId]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
409 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
410 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
411 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
412 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
413 |
aGDBRunningEvent setThreads: threads |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
414 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
415 |
"Created: / 07-09-2014 / 23:34:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
416 |
"Modified: / 18-03-2015 / 13:57:31 / 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
|
417 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
418 |
|
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
419 |
onStoppedEvent: aGDBStoppedEvent |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
420 |
| threads threadIds | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
421 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
422 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
423 |
threadIds := aGDBStoppedEvent stoppedThreadIds. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
424 |
threadIds = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
425 |
threadIds := threadIds collect:[:e | e asInteger ]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
426 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
427 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
428 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
429 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
430 |
(threadIds isString or:[threadIds includes: thread id]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
431 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
432 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
433 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
434 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
435 |
aGDBStoppedEvent setThreads: threads |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
436 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
437 |
"Created: / 07-09-2014 / 23:34:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
438 |
"Modified: / 18-03-2015 / 13:57:23 / 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
|
439 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
440 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
441 |
onThreadCreatedEvent:aGDBThreadCreatedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
442 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
443 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
444 |
inferior := self inferiorForId:aGDBThreadCreatedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
445 |
inferior onThreadCreatedEvent:aGDBThreadCreatedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
446 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
447 |
"Created: / 07-09-2014 / 21:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
448 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
449 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
450 |
onThreadExitedEvent:aGDBThreadExitedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
451 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
452 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
453 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
454 |
inferior := self inferiorForId:aGDBThreadExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
455 |
inferior onThreadExitedEvent:aGDBThreadExitedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
456 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
457 |
"Created: / 07-09-2014 / 21:20:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
458 |
"Modified: / 18-03-2015 / 13:57:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
459 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
460 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
461 |
onThreadGroupAddedEvent:aGDBThreadGroupAddedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
462 |
| inferior | |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
463 |
|
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
464 |
inferiors isNil ifTrue:[ |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
465 |
inferiors := List new. |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
466 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
467 |
inferior := GDBThreadGroup newWithDebugger:self |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
468 |
id:aGDBThreadGroupAddedEvent threadGroupId. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
469 |
inferiors add:inferior. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
470 |
aGDBThreadGroupAddedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
471 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
472 |
"Modified: / 07-09-2014 / 21:18:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
473 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
474 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
475 |
onThreadGroupExitedEvent:aGDBThreadGroupExitedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
476 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
477 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
478 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
479 |
inferior := self inferiorForId:aGDBThreadGroupExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
480 |
inferior setExitCode:aGDBThreadGroupExitedEvent exitCode. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
481 |
aGDBThreadGroupExitedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
482 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
483 |
"Created: / 06-09-2014 / 02:37:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
484 |
"Modified: / 18-03-2015 / 13:57:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
485 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
486 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
487 |
onThreadGroupStartedEvent:aGDBThreadGroupStartedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
488 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
489 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
490 |
inferior := self inferiorForId:aGDBThreadGroupStartedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
491 |
inferior setPid:aGDBThreadGroupStartedEvent pid. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
492 |
aGDBThreadGroupStartedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
493 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
494 |
"Created: / 06-09-2014 / 02:37: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
|
495 |
"Modified: / 07-09-2014 / 21:23:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
496 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
497 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
498 |
!GDBDebugger methodsFor:'finalization'! |
0 | 499 |
|
500 |
finalize |
|
501 |
self release. |
|
502 |
||
503 |
"Created: / 26-05-2014 / 21:23:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
504 |
! ! |
|
505 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
506 |
!GDBDebugger methodsFor:'initialize & release'! |
0 | 507 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
508 |
initializeWithProcess: aGDBProcess |
1 | 509 |
self registerForFinalization. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
510 |
connection := GDBConnection newWithProcess: aGDBProcess. |
0 | 511 |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
512 |
commandSequenceNumber := 0. |
19 | 513 |
inferiorStateSequenceNumber := 0. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
514 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
515 |
self subscribe. |
8
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
516 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
517 |
connection eventPumpStart. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
518 |
connection eventDispatchStart. |
25
58e042a191a9
More work on GDB session recorder.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
519 |
Delay waitForMilliseconds:100. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
520 |
|
12
568a2971c977
Generated classes for MI commands.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11
diff
changeset
|
521 |
"/ self send: (GDBMICommand inferiorTtySet: driver inferiorPTY name). |
48
330aa6df3dfb
Set target-async option to allow asynchronous communication with GDB.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
46
diff
changeset
|
522 |
self send: (GDBMI_inferior_tty_set arguments: { connection inferiorPTY name }). |
330aa6df3dfb
Set target-async option to allow asynchronous communication with GDB.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
46
diff
changeset
|
523 |
self send: (GDBMI_gdb_set arguments: #('target-async' 'on')). |
11
474fbb650afe
PTY support refactored to use GDBPTY object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10
diff
changeset
|
524 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
525 |
"Created: / 20-06-2014 / 21:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48
330aa6df3dfb
Set target-async option to allow asynchronous communication with GDB.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
46
diff
changeset
|
526 |
"Modified: / 29-09-2014 / 23:30:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 527 |
! |
528 |
||
529 |
release |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
530 |
connection notNil ifTrue:[ |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
531 |
self unsubscribe. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
532 |
connection release. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
533 |
connection := nil. |
0 | 534 |
]. |
535 |
||
536 |
"Created: / 26-05-2014 / 21:24:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
537 |
"Modified: / 20-06-2014 / 22:08:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
538 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
539 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
540 |
subscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
541 |
connection eventAnnouncerInternal |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
542 |
when: GDBCommandEvent send: #onCommandEvent: to: self; |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
543 |
when: GDBExitEvent send: #onExitEvent: to: self; |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
544 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
545 |
when: GDBThreadGroupAddedEvent send: #onThreadGroupAddedEvent: to: self; |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
546 |
when: GDBThreadGroupStartedEvent send: #onThreadGroupStartedEvent: to: self; |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
547 |
when: GDBThreadGroupExitedEvent send: #onThreadGroupExitedEvent: to: self; |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
548 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
549 |
when: GDBThreadCreatedEvent send: #onThreadCreatedEvent: to: self; |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
550 |
when: GDBThreadExitedEvent send: #onThreadExitedEvent: to: self; |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
551 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
552 |
when: GDBRunningEvent send: #onRunningEvent: to: self; |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
553 |
when: GDBStoppedEvent send: #onStoppedEvent: to: self. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
554 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
555 |
"Created: / 20-06-2014 / 22:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
556 |
"Modified: / 01-06-2017 / 21:18:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
557 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
558 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
559 |
unsubscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
560 |
connection eventAnnouncerInternal unsubscribe: self |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
561 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
562 |
"Created: / 20-06-2014 / 22:07:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
563 |
! ! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
564 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
565 |
!GDBDebugger methodsFor:'testing'! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
566 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
567 |
isConnected |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
568 |
^ connection notNil |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
569 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
570 |
"Created: / 20-06-2014 / 22:12:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 571 |
! ! |
572 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
573 |
!GDBDebugger class methodsFor:'documentation'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
574 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
575 |
version_HG |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
576 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
577 |
^ '$Changeset: <not expanded> $' |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
578 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
579 |