author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 04 Feb 2018 23:37:35 +0000 | |
changeset 106 | 12c96f17fc53 |
parent 105 | 1d4ca4370d05 |
child 109 | f57ce907abf4 |
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 |
" |
0 | 19 |
"{ Package: 'jv:libgdbs' }" |
20 |
||
53 | 21 |
"{ NameSpace: Smalltalk }" |
22 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
23 |
Object subclass:#GDBDebugger |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
24 |
instanceVariableNames:'connection commandSequenceNumber inferiorStateSequenceNumber |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
25 |
inferiors breakpoints selectedInferior selectedThread |
102
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
26 |
selectedFrame prettyPrintingEnabled frameFiltersEnabled |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
27 |
finalizationRegistry' |
0 | 28 |
classVariableNames:'' |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
29 |
poolDictionaries:'GDBCommandStatus' |
0 | 30 |
category:'GDB-Core' |
31 |
! |
|
32 |
||
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
33 |
!GDBDebugger class methodsFor:'documentation'! |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
34 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
35 |
copyright |
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 |
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
|
38 |
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
|
39 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
40 |
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
|
41 |
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
|
42 |
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
|
43 |
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
|
44 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
45 |
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
|
46 |
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
|
47 |
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
|
48 |
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
|
49 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
50 |
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
|
51 |
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
|
52 |
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
|
53 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
54 |
! ! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
55 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
56 |
!GDBDebugger class methodsFor:'instance creation'! |
0 | 57 |
|
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
58 |
new |
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
59 |
^ self newWithProcess: GDBProcess new |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
60 |
|
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
61 |
"Modified: / 12-12-2017 / 21:15:24 / 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
|
62 |
! |
0 | 63 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
64 |
newWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
65 |
^ self basicNew initializeWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
66 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
67 |
"Created: / 20-06-2014 / 21:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 68 |
! ! |
69 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
70 |
!GDBDebugger methodsFor:'accessing'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
71 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
72 |
announcer |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
73 |
^ connection eventAnnouncer. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
74 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
75 |
"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
|
76 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
77 |
|
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
78 |
breakpoints |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
79 |
breakpoints isNil ifTrue:[ |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
80 |
breakpoints := List new. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
81 |
]. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
82 |
^ breakpoints |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
83 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
84 |
"Created: / 06-07-2017 / 16:06:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
85 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
86 |
|
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
87 |
consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
88 |
^ connection consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
89 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
90 |
"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
|
91 |
"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
|
92 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
93 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
94 |
consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
95 |
^ connection consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
96 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
97 |
"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
|
98 |
"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
|
99 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
100 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
101 |
inferiorForId: id |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
102 |
^ inferiors ? #() detect:[:e | e id = id ] ifNone:[ |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
103 |
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
|
104 |
]. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
105 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
106 |
"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
|
107 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
108 |
|
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
109 |
inferiorStderr |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
110 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
111 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
112 |
"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
|
113 |
"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
|
114 |
! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
115 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
116 |
inferiorStdin |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
117 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
118 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
119 |
"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
|
120 |
"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
|
121 |
! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
122 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
123 |
inferiorStdout |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
124 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
125 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
126 |
"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
|
127 |
"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
|
128 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
129 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
130 |
inferiors |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
131 |
^ inferiors ? #() |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
132 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
133 |
"Modified: / 06-07-2017 / 16:06:00 / 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
|
134 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
135 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
136 |
selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
137 |
selectedInferior isNil ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
138 |
inferiors size == 1 ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
139 |
^ inferiors anElement. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
140 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
141 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
142 |
^ selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
143 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
144 |
"Created: / 07-09-2014 / 23:02:53 / 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:
105
diff
changeset
|
145 |
! |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
146 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
147 |
threadForId: id |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
148 |
inferiors ? #() do:[:tg | |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
149 |
tg threads do:[:t | |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
150 |
t id = id ifTrue:[ ^ t ] |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
151 |
]. |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
152 |
]. |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
153 |
self error: ('No thread with id ''%1'' found!!' bindWith: id) |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
154 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
155 |
"Created: / 04-02-2018 / 21:37: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
|
156 |
! ! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
157 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
158 |
!GDBDebugger methodsFor:'accessing-private'! |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
159 |
|
19 | 160 |
currentInferiorStateSequnceNumber |
161 |
^ inferiorStateSequenceNumber |
|
162 |
||
163 |
"Created: / 19-06-2014 / 22:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
164 |
! |
|
165 |
||
102
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
166 |
finalizationRegistry |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
167 |
^ finalizationRegistry |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
168 |
! |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
169 |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
170 |
nextCommandSequnceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
171 |
commandSequenceNumber := commandSequenceNumber + 1. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
172 |
commandSequenceNumber == SmallInteger maxVal ifTrue:[ |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
173 |
commandSequenceNumber := 0. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
174 |
]. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
175 |
^ commandSequenceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
176 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
177 |
"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
|
178 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
179 |
|
19 | 180 |
nextInferiorStateSequnceNumber |
181 |
inferiorStateSequenceNumber := inferiorStateSequenceNumber + 1. |
|
182 |
inferiorStateSequenceNumber == SmallInteger maxVal ifTrue:[ |
|
183 |
inferiorStateSequenceNumber := 0. |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
184 |
]. |
19 | 185 |
^ inferiorStateSequenceNumber |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
186 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
187 |
"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
|
188 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
189 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
190 |
!GDBDebugger methodsFor:'commands'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
191 |
|
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
192 |
send: command |
64 | 193 |
"Execute given `command` and wait until it finishes and return its result. |
194 |
`command` may be either a GDBCommand or string, in which case it will |
|
195 |
be parsed into a GDBCommand. |
|
196 |
" |
|
197 |
^ 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
|
198 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
199 |
"Created: / 03-06-2014 / 00:10:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 200 |
"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
|
201 |
! |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
202 |
|
64 | 203 |
send:command andWait:wait |
204 |
"Sends given `command` to GDB. If `wait` is true, wait for |
|
205 |
command to finish and return the command result. |
|
206 |
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
|
207 |
|
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
208 |
If `wait` is true and if command results in an error GDBError |
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
209 |
is thrown. |
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
210 |
|
64 | 211 |
`command` may be either a GDBCommand or string, in which case it will |
212 |
be parsed into a GDBCommand. |
|
213 |
" |
|
214 |
||
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
215 |
| blocker result | |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
216 |
|
105
1d4ca4370d05
Report gdb's exist status in `GDBExitEvent` in case `gdb` terminates prematurely
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
217 |
self assert: self isConnected. |
64 | 218 |
^ wait ifTrue:[ |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
219 |
blocker := Semaphore new. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
220 |
self send: command andWithResultDo: [ :r | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
221 |
result := r. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
222 |
blocker signal |
64 | 223 |
]. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
224 |
blocker wait. |
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
225 |
result isError ifTrue:[ |
88
90c50fd6374c
Introduced new exception class: `GDBCommandFailedError`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
87
diff
changeset
|
226 |
GDBCommandFailedError raiseForResult: result. |
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
227 |
]. |
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
38
diff
changeset
|
228 |
result. |
64 | 229 |
] |
230 |
ifFalse:[ |
|
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
231 |
| cmd | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
232 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
233 |
cmd := command. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
234 |
cmd isString ifTrue:[ |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
235 |
cmd := GDBCLICommand new value:cmd. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
236 |
]. |
64 | 237 |
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
|
238 |
nil. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
239 |
] |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
240 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
241 |
"Created: / 02-06-2014 / 23:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
105
1d4ca4370d05
Report gdb's exist status in `GDBExitEvent` in case `gdb` terminates prematurely
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
242 |
"Modified: / 04-02-2018 / 00:21:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 243 |
! |
244 |
||
245 |
send:command andWaitFor:eventHandlers |
|
246 |
"Sends given `command` to GDB and then wait for events mathing |
|
247 |
`eventHandlers`. |
|
248 |
||
249 |
Params: |
|
250 |
`command` may be either a GDBCommand or string, in which case it will |
|
251 |
be parsed into a GDBCommand. |
|
252 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
253 |
of event classes or blocks. |
|
254 |
- If nil then do not wait for anything (use nil for async send) |
|
255 |
- If event class, then wait for an event of that class. Note, that |
|
256 |
subclasses are handled too. |
|
257 |
- If block, then wait for an event for which the block returns true. |
|
258 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
259 |
||
260 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
261 |
||
262 |
^ self send: command andWaitFor: eventHandlers withTimeoutMs: nil |
|
263 |
||
264 |
"Created: / 08-03-2015 / 06:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
265 |
! |
|
266 |
||
267 |
send:command andWaitFor:eventHandlers withTimeoutMs:timeout |
|
268 |
"Sends given `command` to GDB and then wait for events mathing |
|
269 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
270 |
in specified time. |
|
271 |
||
272 |
Params: |
|
273 |
`command` may be either a GDBCommand or string, in which case it will |
|
274 |
be parsed into a GDBCommand. |
|
275 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
276 |
of event classes or blocks. |
|
277 |
- If nil then do not wait for anything (use nil for async send) |
|
278 |
- If event class, then wait for an event of that class. Note, that |
|
279 |
subclasses are handled too. |
|
280 |
- If block, then wait for an event for which the block returns true. |
|
281 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
282 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
283 |
then wait for indefinitly |
|
284 |
||
285 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
286 |
||
287 |
| commandObject | |
|
288 |
||
105
1d4ca4370d05
Report gdb's exist status in `GDBExitEvent` in case `gdb` terminates prematurely
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
289 |
self assert: self isConnected. |
64 | 290 |
command isString ifTrue:[ |
291 |
commandObject := (GDBMIParser on:command) parseCommand. |
|
292 |
commandObject token:self nextCommandSequnceNumber. |
|
293 |
] ifFalse:[ |
|
294 |
commandObject := command. |
|
295 |
commandObject token isNil ifTrue:[ |
|
296 |
commandObject token:self nextCommandSequnceNumber. |
|
297 |
]. |
|
298 |
]. |
|
299 |
^ self |
|
300 |
do:[ connection pushEvent:(GDBCommandEvent new command: commandObject) ] |
|
301 |
andWaitFor: eventHandlers |
|
302 |
withTimeoutMs: timeout |
|
303 |
||
304 |
"Created: / 07-03-2015 / 11:38:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
105
1d4ca4370d05
Report gdb's exist status in `GDBExitEvent` in case `gdb` terminates prematurely
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
305 |
"Modified (format): / 04-02-2018 / 00:20:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
306 |
! |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
307 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
308 |
send:command andWithResultDo: block |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
309 |
"Sends given `command` to GDB and return nil immediately. Once the command |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
310 |
is processed and result returned, evaluate `block` passing the |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
311 |
result (as instance of GDBCommandResult) |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
312 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
313 |
The `command` may be either a GDBCommand or string, in which case it will |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
314 |
be parsed into a GDBCommand. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
315 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
316 |
When calling this method from a UI code, i.e., from an UI even loop, keep |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
317 |
in mind that the block will be evaluated from within GDB's internal event |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
318 |
dispatch loop. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
319 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
320 |
It's is a gooc practice not to do anything real within the block but just |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
321 |
grab the result and lt it processed within UI event loop, e.g. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
322 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
323 |
doSomeAction |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
324 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
325 |
debugger send: (GDBMI_data_read_memory arguments:...) |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
326 |
andWithResultDo:[ :result | self sensor pushUserEvent: #updateWithReslt: with: result ]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
327 |
" |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
328 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
329 |
| cmd token handler1 handler2 result | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
330 |
|
105
1d4ca4370d05
Report gdb's exist status in `GDBExitEvent` in case `gdb` terminates prematurely
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
331 |
self assert: self isConnected. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
332 |
cmd := command. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
333 |
cmd isString ifTrue:[ |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
334 |
cmd := GDBCLICommand new value:cmd. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
335 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
336 |
token := self nextCommandSequnceNumber. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
337 |
cmd token:token. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
338 |
self assert:Processor activeProcess ~~ connection eventDispatchProcess |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
339 |
message:'Cannot send commands from within event dispatching process. Would deadlock'. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
340 |
handler1 := [:ev | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
341 |
ev token == token ifTrue:[ |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
342 |
connection eventAnnouncer unsubscribe:handler1. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
343 |
result := ev result. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
344 |
connection eventAnnouncerInternal when:GDBEventSetProcessingFinished |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
345 |
do:handler2. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
346 |
] |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
347 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
348 |
handler2 := [:ev | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
349 |
connection eventAnnouncerInternal unsubscribe:handler2. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
350 |
block value: result. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
351 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
352 |
connection eventAnnouncer when:GDBCommandResultEvent do:handler1. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
353 |
connection pushEvent:(GDBCommandEvent new command:cmd). |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
354 |
^ nil |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
355 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
356 |
"Created: / 26-01-2018 / 21:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
105
1d4ca4370d05
Report gdb's exist status in `GDBExitEvent` in case `gdb` terminates prematurely
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
104
diff
changeset
|
357 |
"Modified (format): / 04-02-2018 / 00:20:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 358 |
! ! |
359 |
||
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
360 |
!GDBDebugger methodsFor:'commands - API'! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
361 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
362 |
attach: aStringOrInteger |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
363 |
"Attach to a running process. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
364 |
API equivalent to CLI command: |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
365 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
366 |
(gdb) attach <aStringOrInteger> |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
367 |
" |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
368 |
self send:(GDBMI_target_attach arguments:(Array with: aStringOrInteger asString)). |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
369 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
370 |
"Created: / 05-06-2017 / 17:08:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
371 |
"Modified: / 25-01-2018 / 23:28:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
372 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
373 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
374 |
enableFrameFilters |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
375 |
"Enables frame filters & frame decorators for MI interface. Once enabled, |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
376 |
cannot be turned off. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
377 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
378 |
@see GDBMI_enable_frame_filters" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
379 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
380 |
| result | |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
381 |
result := self send: GDBMI_enable_frame_filters new. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
382 |
result isDone ifTrue:[ |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
383 |
frameFiltersEnabled := true. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
384 |
] ifFalse:[ |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
385 |
GDBError raiseErrorString: 'failed to enable frame filters' |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
386 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
387 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
388 |
"Created: / 12-06-2017 / 09:29:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
389 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
390 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
391 |
enablePrettyPrinting |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
392 |
"Enables pretty printing for MI interface. Once enabled, |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
393 |
cannot be turned off. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
394 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
395 |
@see GDBMI_enable_pretty_printing" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
396 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
397 |
| result | |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
398 |
result := self send: GDBMI_enable_pretty_printing new. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
399 |
result isDone ifTrue:[ |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
400 |
prettyPrintingEnabled := true. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
401 |
] ifFalse:[ |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
402 |
GDBError raiseErrorString: 'failed to enable pretty printing' |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
403 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
404 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
405 |
"Created: / 12-06-2017 / 09:29:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
406 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
407 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
408 |
executable: aStringOrFilename |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
409 |
"Sets the executable to debug. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
410 |
API equivalent to CLI command: |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
411 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
412 |
(gdb) exec-file <aStringOrFilename> |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
413 |
" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
414 |
self executable: aStringOrFilename arguments: nil |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
415 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
416 |
"Created: / 28-02-2015 / 00:19:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
417 |
"Modified: / 05-06-2017 / 17:06:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
418 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
419 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
420 |
executable: aStringOrFilename arguments: anArray"of String" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
421 |
"Sets the executable to debug and argument to pass to it. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
422 |
API equivalent to CLI command: |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
423 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
424 |
(gdb) exec-file <aStringOrFilename> |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
425 |
(gdb) set args <anArray> |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
426 |
" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
427 |
|
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
428 |
self send:(GDBMI_file_exec_and_symbols arguments: (Array with: aStringOrFilename asString)). |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
429 |
anArray notEmptyOrNil ifTrue:[ |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
430 |
self send: (GDBMI_exec_arguments arguments: anArray). |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
431 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
432 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
433 |
"Created: / 05-06-2017 / 17:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
434 |
"Modified: / 25-01-2018 / 23:28:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
104
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
435 |
! |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
436 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
437 |
selectFrame: aGDBFrame |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
438 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
439 |
Set the context frame to given frame. This frame is then |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
440 |
the contex frame for other commands, like finish, info frame |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
441 |
and so on |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
442 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
443 |
self send:(GDBMI_thread_select new arguments:(Array with:aGDBFrame thread id))andWait:false. |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
444 |
self send:(GDBMI_stack_select_frame new arguments:(Array with:aGDBFrame level)) andWait:false. |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
445 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
446 |
"Created: / 01-02-2018 / 22:27:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
447 |
! |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
448 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
449 |
selectThread: aGDBThread |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
450 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
451 |
Set the context thread to given thread. This thread is then |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
452 |
the contex thread for other commands (if no thread id is given) |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
453 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
454 |
self send:(GDBMI_thread_select new arguments:(Array with:aGDBThread id))andWait:false. |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
455 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
456 |
"Created: / 01-02-2018 / 22:25:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
457 |
! ! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
458 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
459 |
!GDBDebugger methodsFor:'evaluating'! |
64 | 460 |
|
461 |
do: block andWaitFor:eventHandlers |
|
462 |
"Evaluates a given block and then wait for events. |
|
463 |
`eventHandlers`. |
|
464 |
Params: |
|
465 |
`block` block to evaluate |
|
466 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
467 |
of event classes or blocks. |
|
468 |
- If nil then do not wait for anything (use nil for async send) |
|
469 |
- If event class, then wait for an event of that class. Note, that |
|
470 |
subclasses are handled too. |
|
471 |
- If block, then wait for an event for which the block returns true. |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
472 |
- If collection, then wait for a sequence of events, each matched as above. |
64 | 473 |
Returns: a matching event or events (in case a collection of handlers has been passed)" |
474 |
||
475 |
^ self do: block andWaitFor: eventHandlers withTimeoutMs: nil |
|
476 |
||
477 |
"Created: / 08-03-2015 / 07:30:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
478 |
"Modified (comment): / 12-06-2017 / 09:31:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 479 |
! |
480 |
||
481 |
do: block andWaitFor:eventHandlers withTimeoutMs:timeout |
|
482 |
"Evaluates a given block and then wait for events. |
|
483 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
484 |
in specified time. |
|
485 |
||
486 |
Params: |
|
487 |
`block` block to evaluate |
|
488 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
489 |
of event classes or blocks. |
|
490 |
- If nil then do not wait for anything (use nil for async send) |
|
491 |
- If event class, then wait for an event of that class. Note, that |
|
492 |
subclasses are handled too. |
|
493 |
- If block, then wait for an event for which the block returns true. |
|
494 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
495 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
496 |
then wait for indefinitly |
|
497 |
||
498 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
499 |
||
500 |
| handlersArray handlerFinal eventsArray blocker | |
|
501 |
||
502 |
eventHandlers isNil ifTrue:[ |
|
503 |
"/ Asynchronous send... |
|
504 |
self assert:timeout isNil. |
|
505 |
block value. |
|
506 |
^ nil |
|
507 |
]. |
|
508 |
"/ Synchronous send... |
|
509 |
self assert:Processor activeProcess ~~ connection eventDispatchProcess |
|
510 |
message:'Cannot send commands from within event dispatching process. Would deadlock'. |
|
511 |
eventHandlers isCollection |
|
512 |
ifTrue:[ handlersArray := eventHandlers ] |
|
513 |
ifFalse:[ handlersArray := Array with:eventHandlers ]. |
|
514 |
eventsArray := Array new:handlersArray size. |
|
515 |
1 to:handlersArray size do:[:i | |
|
516 |
| handler | |
|
517 |
||
518 |
handler := handlersArray at:i. |
|
519 |
handlersArray at:i |
|
520 |
put:[:event | |
|
521 |
| matches | |
|
522 |
||
523 |
matches := handler isBlock ifTrue:[ handler value:event ] ifFalse:[ event isKindOf:handler ]. |
|
524 |
(matches and:[ i == 1 or:[ (eventsArray at:i - 1) notNil ] ]) ifTrue:[ |
|
525 |
eventsArray at:i put:event. |
|
526 |
self announcer unsubscribe:(handlersArray at:i). |
|
527 |
i == handlersArray size ifTrue:[ |
|
528 |
connection eventAnnouncerInternal when: GDBEventSetProcessingFinished do: handlerFinal. |
|
529 |
]. |
|
530 |
]. |
|
531 |
]. |
|
532 |
self announcer when:GDBEvent do:(handlersArray at:i). |
|
533 |
]. |
|
534 |
handlerFinal := [ :event | connection eventAnnouncerInternal unsubscribe: handlerFinal. blocker signal ]. |
|
535 |
blocker := Semaphore new. |
|
536 |
block value. |
|
537 |
[ |
|
538 |
(blocker waitWithTimeoutMs:timeout) isNil ifTrue:[ |
|
539 |
eventsArray := nil. |
|
540 |
]. |
|
541 |
] ensure:[ |
|
542 |
handlersArray do:[:handler | |
|
543 |
handler notNil ifTrue:[ |
|
544 |
self announcer unsubscribe:handler |
|
545 |
] |
|
546 |
]. |
|
547 |
]. |
|
548 |
eventsArray isNil ifTrue:[ |
|
549 |
(TimeoutError newException) |
|
550 |
parameter:timeout; |
|
551 |
raise. |
|
552 |
]. |
|
553 |
^ eventHandlers isCollection ifTrue:[ eventsArray ] ifFalse:[ eventsArray first ] |
|
554 |
||
555 |
"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
|
556 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
557 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
558 |
!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
|
559 |
|
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
560 |
onBreakpointCreatedEvent: aGDBBreakpointCreatedEvent |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
561 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
562 |
breakpoints isNil ifTrue:[ |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
563 |
breakpoints := List new. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
564 |
]. |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
565 |
aGDBBreakpointCreatedEvent breakpoints do:[:breakpoint | |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
566 |
breakpoint setDebugger: self. |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
567 |
breakpoints add: breakpoint. |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
568 |
]. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
569 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
570 |
"Created: / 06-07-2017 / 16:08:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
571 |
"Modified: / 12-11-2017 / 20:17:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
572 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
573 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
574 |
onBreakpointDeletedEvent: aGDBBreakpointDeletedEvent |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
575 |
| breakpoint | |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
576 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
577 |
breakpoint := breakpoints detect:[:e | e number == aGDBBreakpointDeletedEvent id ]. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
578 |
breakpoint setDebugger: nil. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
579 |
breakpoints remove: breakpoint. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
580 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
581 |
"Created: / 06-07-2017 / 16:26:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
582 |
"Modified: / 07-07-2017 / 12:39:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
583 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
584 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
585 |
onBreakpointModifiedEvent: aGDBBreakpointModifiedEvent |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
586 |
|
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
587 |
aGDBBreakpointModifiedEvent breakpoints do:[:new | |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
588 |
| old | |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
589 |
|
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
590 |
old := breakpoints detect:[:e | e number = new number ]. |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
591 |
old updateFrom: new. |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
592 |
]. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
593 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
594 |
"Created: / 06-07-2017 / 16:28:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
595 |
"Modified: / 12-11-2017 / 20:18:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
596 |
"Modified: / 15-01-2018 / 23:11:52 / jv" |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
597 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
598 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
599 |
onCommandEvent:aGDBCommandEvent |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
600 |
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
|
601 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
602 |
"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
|
603 |
"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
|
604 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
605 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
606 |
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
|
607 |
self release. |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
608 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
609 |
"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
|
610 |
"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
|
611 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
612 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
613 |
onRunningEvent: aGDBRunningEvent |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
614 |
| threads threadId | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
615 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
616 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
617 |
threadId := aGDBRunningEvent threadId. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
618 |
threadId = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
619 |
threadId := threadId asInteger. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
620 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
621 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
622 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
623 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
624 |
(threadId isString or:[thread id = threadId]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
625 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
626 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
627 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
628 |
]. |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
629 |
aGDBRunningEvent setThreads: threads. |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
630 |
threads do:[:thread | |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
631 |
thread onRunningEvent: aGDBRunningEvent. |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
632 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
633 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
634 |
"Created: / 07-09-2014 / 23:34:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
635 |
"Modified: / 12-07-2017 / 13:48:32 / 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
|
636 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
637 |
|
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
638 |
onStoppedEvent: aGDBStoppedEvent |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
639 |
| threads threadIds | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
640 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
641 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
642 |
threadIds := aGDBStoppedEvent stoppedThreadIds. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
643 |
threadIds = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
644 |
threadIds := threadIds collect:[:e | e asInteger ]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
645 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
646 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
647 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
648 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
649 |
(threadIds isString or:[threadIds includes: thread id]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
650 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
651 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
652 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
653 |
]. |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
654 |
aGDBStoppedEvent setThreads: threads. |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
655 |
threads do:[:thread | |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
656 |
thread onStoppedEvent: aGDBStoppedEvent. |
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
657 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
658 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
659 |
"Created: / 07-09-2014 / 23:34:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
660 |
"Modified: / 12-07-2017 / 13:47:56 / 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
|
661 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
662 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
663 |
onThreadCreatedEvent:aGDBThreadCreatedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
664 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
665 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
666 |
inferior := self inferiorForId:aGDBThreadCreatedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
667 |
inferior onThreadCreatedEvent:aGDBThreadCreatedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
668 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
669 |
"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
|
670 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
671 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
672 |
onThreadExitedEvent:aGDBThreadExitedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
673 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
674 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
675 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
676 |
inferior := self inferiorForId:aGDBThreadExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
677 |
inferior onThreadExitedEvent:aGDBThreadExitedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
678 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
679 |
"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
|
680 |
"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
|
681 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
682 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
683 |
onThreadGroupAddedEvent:aGDBThreadGroupAddedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
684 |
| inferior | |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
685 |
|
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
686 |
inferiors isNil ifTrue:[ |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
687 |
inferiors := List new. |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
688 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
689 |
inferior := GDBThreadGroup newWithDebugger:self |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
690 |
id:aGDBThreadGroupAddedEvent threadGroupId. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
691 |
inferiors add:inferior. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
692 |
aGDBThreadGroupAddedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
693 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
694 |
"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
|
695 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
696 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
697 |
onThreadGroupExitedEvent:aGDBThreadGroupExitedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
698 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
699 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
700 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
701 |
inferior := self inferiorForId:aGDBThreadGroupExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
702 |
inferior setExitCode:aGDBThreadGroupExitedEvent exitCode. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
703 |
aGDBThreadGroupExitedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
704 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
705 |
"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
|
706 |
"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
|
707 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
708 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
709 |
onThreadGroupStartedEvent:aGDBThreadGroupStartedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
710 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
711 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
712 |
inferior := self inferiorForId:aGDBThreadGroupStartedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
713 |
inferior setPid:aGDBThreadGroupStartedEvent pid. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
714 |
aGDBThreadGroupStartedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
715 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
716 |
"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
|
717 |
"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
|
718 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
719 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
720 |
!GDBDebugger methodsFor:'finalization'! |
0 | 721 |
|
722 |
finalize |
|
723 |
self release. |
|
724 |
||
725 |
"Created: / 26-05-2014 / 21:23:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
726 |
! ! |
|
727 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
728 |
!GDBDebugger methodsFor:'initialize & release'! |
0 | 729 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
730 |
initializeWithProcess: aGDBProcess |
1 | 731 |
self registerForFinalization. |
102
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
732 |
|
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
733 |
finalizationRegistry := Registry new. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
734 |
connection := GDBConnection newWithProcess: aGDBProcess. |
0 | 735 |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
736 |
commandSequenceNumber := 0. |
19 | 737 |
inferiorStateSequenceNumber := 0. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
738 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
739 |
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
|
740 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
741 |
connection eventPumpStart. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
742 |
connection eventDispatchStart. |
25
58e042a191a9
More work on GDB session recorder.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
743 |
Delay waitForMilliseconds:100. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
744 |
|
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
745 |
connection inferiorPTY notNil ifTrue:[ |
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
746 |
self send: (GDBMI_inferior_tty_set arguments: (Array with: connection inferiorPTY name)). |
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
747 |
]. |
48
330aa6df3dfb
Set target-async option to allow asynchronous communication with GDB.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
46
diff
changeset
|
748 |
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
|
749 |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
750 |
prettyPrintingEnabled := false. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
751 |
frameFiltersEnabled := false. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
752 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
753 |
"Created: / 20-06-2014 / 21:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
754 |
"Modified: / 12-01-2018 / 00:13:09 / jv" |
102
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
755 |
"Modified: / 28-01-2018 / 23:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 756 |
! |
757 |
||
758 |
release |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
759 |
connection notNil ifTrue:[ |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
760 |
self unsubscribe. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
761 |
connection release. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
762 |
connection := nil. |
0 | 763 |
]. |
764 |
||
765 |
"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
|
766 |
"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
|
767 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
768 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
769 |
subscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
770 |
connection eventAnnouncerInternal |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
771 |
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
|
772 |
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
|
773 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
774 |
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
|
775 |
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
|
776 |
when: GDBThreadGroupExitedEvent send: #onThreadGroupExitedEvent: to: self; |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
777 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
778 |
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
|
779 |
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
|
780 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
781 |
when: GDBRunningEvent send: #onRunningEvent: to: self; |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
782 |
when: GDBStoppedEvent send: #onStoppedEvent: to: self; |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
783 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
784 |
when: GDBBreakpointCreatedEvent send: #onBreakpointCreatedEvent: to: self; |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
785 |
when: GDBBreakpointModifiedEvent send: #onBreakpointModifiedEvent: to: self; |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
786 |
when: GDBBreakpointDeletedEvent send: #onBreakpointDeletedEvent: to: self. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
787 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
788 |
"Created: / 20-06-2014 / 22:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
789 |
"Modified: / 06-07-2017 / 16:08:30 / 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
|
790 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
791 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
792 |
unsubscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
793 |
connection eventAnnouncerInternal unsubscribe: self |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
794 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
795 |
"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
|
796 |
! ! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
797 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
798 |
!GDBDebugger methodsFor:'testing'! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
799 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
800 |
isConnected |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
801 |
^ connection notNil |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
802 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
803 |
"Created: / 20-06-2014 / 22:12:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
804 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
805 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
806 |
isFrameFiltersEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
807 |
^ frameFiltersEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
808 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
809 |
"Created: / 12-06-2017 / 09:41:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
810 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
811 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
812 |
isPrettyPrintingEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
813 |
^ prettyPrintingEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
814 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
815 |
"Created: / 12-06-2017 / 09:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 816 |
! ! |
817 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
818 |
!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
|
819 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
820 |
version_HG |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
821 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
822 |
^ '$Changeset: <not expanded> $' |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
823 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
824 |