author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 30 Oct 2018 20:04:25 +0000 | |
changeset 159 | 5a364902a0fa |
parent 153 | dd55019f1d86 |
child 165 | 780e1f6168c5 |
permissions | -rw-r--r-- |
128
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
2 |
|
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
3 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
4 |
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
|
5 |
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
|
6 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
7 |
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
|
8 |
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
|
9 |
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
|
10 |
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
|
11 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
12 |
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
|
13 |
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
|
14 |
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
|
15 |
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
|
16 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
17 |
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
|
18 |
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
|
19 |
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
|
20 |
" |
0 | 21 |
"{ Package: 'jv:libgdbs' }" |
22 |
||
53 | 23 |
"{ NameSpace: Smalltalk }" |
24 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
25 |
Object subclass:#GDBDebugger |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
26 |
instanceVariableNames:'connection commandSequenceNumber inferiorStateSequenceNumber |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
27 |
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
|
28 |
selectedFrame prettyPrintingEnabled frameFiltersEnabled |
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
29 |
finalizationRegistry debuggerFeatures targetFeatures directories' |
0 | 30 |
classVariableNames:'' |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
31 |
poolDictionaries:'GDBCommandStatus GDBFeatures' |
0 | 32 |
category:'GDB-Core' |
33 |
! |
|
34 |
||
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
35 |
!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
|
36 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
37 |
copyright |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
38 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
39 |
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
|
40 |
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
|
41 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
42 |
This library is 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
|
43 |
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
|
44 |
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
|
45 |
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
|
46 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
47 |
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
|
48 |
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
|
49 |
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
|
50 |
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
|
51 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
52 |
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
|
53 |
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
|
54 |
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
|
55 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
56 |
! ! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
57 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
58 |
!GDBDebugger class methodsFor:'instance creation'! |
0 | 59 |
|
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
60 |
new |
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
61 |
^ 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
|
62 |
|
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
63 |
"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
|
64 |
! |
0 | 65 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
66 |
newWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
67 |
^ self basicNew initializeWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
68 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
69 |
"Created: / 20-06-2014 / 21:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 70 |
! ! |
71 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
72 |
!GDBDebugger methodsFor:'accessing'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
73 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
74 |
announcer |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
75 |
^ connection eventAnnouncer. |
7
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 |
"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
|
78 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
79 |
|
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
80 |
breakpointForId: id |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
81 |
self breakpoints do:[:bp | |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
82 |
bp number = id ifTrue:[ ^ bp ]. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
83 |
bp locations do: [ :loc | |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
84 |
loc number = id ifTrue:[ ^ loc ]. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
85 |
]. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
86 |
]. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
87 |
self error: ('No breakpoint with id ''%1'' found!!' bindWith: id) |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
88 |
|
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
89 |
"Created: / 18-05-2018 / 13:39:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
90 |
"Modified: / 18-05-2018 / 15:03:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
91 |
! |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
92 |
|
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
93 |
breakpoints |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
94 |
breakpoints isNil ifTrue:[ |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
95 |
breakpoints := List new. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
96 |
]. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
97 |
^ breakpoints |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
98 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
99 |
"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
|
100 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
101 |
|
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
102 |
consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
103 |
^ connection consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
104 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
105 |
"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
|
106 |
"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
|
107 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
108 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
109 |
consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
110 |
^ connection consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
111 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
112 |
"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
|
113 |
"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
|
114 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
115 |
|
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
116 |
directories |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
117 |
"Return a list of directories where GDB looks for source code and an Array. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
118 |
Variables such as $cdir and $cwd are NOT expanded. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
119 |
" |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
120 |
| result | |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
121 |
|
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
122 |
directories isNil ifTrue:[ |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
123 |
result := self send: (GDBMI_gdb_show arguments: #('directories')). |
119
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
124 |
|
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
125 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
126 |
"/ On Windows, GDB uses cygwin paths (i.e., slashed, unix-like paths). |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
127 |
"/ Convert them to Windows paths as used in Smalltalk/X: |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
128 |
directories := ((result propertyAt: #value) tokensBasedOn: $;) |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
129 |
collect: [ :d | (Filename cygNamed:d) pathName ] |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
130 |
as: Array. |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
131 |
] ifFalse:[ |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
132 |
directories := ((result propertyAt: #value) tokensBasedOn: $:) asArray |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
133 |
]. |
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
134 |
]. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
135 |
^ directories |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
136 |
|
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
137 |
"Created: / 09-03-2018 / 12:05:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
119
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
138 |
"Modified: / 03-04-2018 / 21:14:45 / jv" |
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
139 |
! |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
140 |
|
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
141 |
features |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
142 |
"Return a list of features supported ty this version og GDB. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
143 |
See |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
144 |
* GDBFeatures` pool |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
145 |
* https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Support-Commands.html, |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
146 |
command `-list-features` |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
147 |
" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
148 |
^ debuggerFeatures , (targetFeatures ? connection nativeTargetFeatures) |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
149 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
150 |
"Created: / 07-02-2018 / 10:50:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
151 |
"Modified: / 26-03-2018 / 21:35:22 / jv" |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
152 |
"Modified: / 09-04-2018 / 15:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
153 |
! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
154 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
155 |
inferiorForId: id |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
156 |
^ inferiors ? #() detect:[:e | e id = id ] ifNone:[ |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
157 |
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
|
158 |
]. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
159 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
160 |
"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
|
161 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
162 |
|
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
163 |
inferiorStderr |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
164 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
165 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
166 |
"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
|
167 |
"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
|
168 |
! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
169 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
170 |
inferiorStdin |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
171 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
172 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
173 |
"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
|
174 |
"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
|
175 |
! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
176 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
177 |
inferiorStdout |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
178 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
179 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
180 |
"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
|
181 |
"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
|
182 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
183 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
184 |
inferiors |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
185 |
^ inferiors ? #() |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
186 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
187 |
"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
|
188 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
189 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
190 |
selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
191 |
selectedInferior isNil ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
192 |
inferiors size == 1 ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
193 |
^ inferiors anElement. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
194 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
195 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
196 |
^ selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
197 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
198 |
"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
|
199 |
! |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
200 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
201 |
threadForId: id |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
202 |
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
|
203 |
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
|
204 |
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
|
205 |
]. |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
206 |
]. |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
207 |
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
|
208 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
209 |
"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
|
210 |
! ! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
211 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
212 |
!GDBDebugger methodsFor:'accessing-private'! |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
213 |
|
113
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
214 |
connectionTrace |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
215 |
^ connection trace |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
216 |
|
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
217 |
"Created: / 09-03-2018 / 10:04:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
218 |
! |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
219 |
|
19 | 220 |
currentInferiorStateSequnceNumber |
221 |
^ inferiorStateSequenceNumber |
|
222 |
||
223 |
"Created: / 19-06-2014 / 22:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
224 |
! |
|
225 |
||
102
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
226 |
finalizationRegistry |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
227 |
^ finalizationRegistry |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
228 |
! |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
229 |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
230 |
nextCommandSequnceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
231 |
commandSequenceNumber := commandSequenceNumber + 1. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
232 |
commandSequenceNumber == SmallInteger maxVal ifTrue:[ |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
233 |
commandSequenceNumber := 0. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
234 |
]. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
235 |
^ commandSequenceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
236 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
237 |
"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
|
238 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
239 |
|
19 | 240 |
nextInferiorStateSequnceNumber |
241 |
inferiorStateSequenceNumber := inferiorStateSequenceNumber + 1. |
|
242 |
inferiorStateSequenceNumber == SmallInteger maxVal ifTrue:[ |
|
243 |
inferiorStateSequenceNumber := 0. |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
244 |
]. |
19 | 245 |
^ inferiorStateSequenceNumber |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
246 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
247 |
"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
|
248 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
249 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
250 |
!GDBDebugger methodsFor:'commands'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
251 |
|
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
252 |
send: command |
64 | 253 |
"Execute given `command` and wait until it finishes and return its result. |
254 |
`command` may be either a GDBCommand or string, in which case it will |
|
255 |
be parsed into a GDBCommand. |
|
256 |
" |
|
257 |
^ 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
|
258 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
259 |
"Created: / 03-06-2014 / 00:10:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 260 |
"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
|
261 |
! |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
262 |
|
64 | 263 |
send:command andWait:wait |
264 |
"Sends given `command` to GDB. If `wait` is true, wait for |
|
265 |
command to finish and return the command result. |
|
266 |
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
|
267 |
|
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
268 |
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
|
269 |
is thrown. |
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
270 |
|
64 | 271 |
`command` may be either a GDBCommand or string, in which case it will |
272 |
be parsed into a GDBCommand. |
|
273 |
" |
|
274 |
||
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
275 |
| blocker result | |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
276 |
|
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
|
277 |
self assert: self isConnected. |
64 | 278 |
^ wait ifTrue:[ |
148
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
279 |
self |
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
280 |
assert:Processor activeProcess ~~ connection eventDispatchProcess |
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
281 |
message:'Cannot send commands from within event dispatching process. Would deadlock'. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
282 |
blocker := Semaphore new. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
283 |
self send: command andWithResultDo: [ :r | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
284 |
result := r. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
285 |
blocker signal |
64 | 286 |
]. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
287 |
blocker wait. |
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
288 |
result isError ifTrue:[ |
88
90c50fd6374c
Introduced new exception class: `GDBCommandFailedError`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
87
diff
changeset
|
289 |
GDBCommandFailedError raiseForResult: result. |
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
290 |
]. |
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
38
diff
changeset
|
291 |
result. |
64 | 292 |
] |
293 |
ifFalse:[ |
|
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
294 |
| cmd | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
295 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
296 |
cmd := command. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
297 |
cmd isString ifTrue:[ |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
298 |
cmd := GDBCLICommand new value:cmd. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
299 |
]. |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
300 |
cmd token: self nextCommandSequnceNumber. |
64 | 301 |
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
|
302 |
nil. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
303 |
] |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
304 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
305 |
"Created: / 02-06-2014 / 23:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
306 |
"Modified: / 26-03-2018 / 21:19:59 / jv" |
148
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
307 |
"Modified: / 03-10-2018 / 11:59:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 308 |
! |
309 |
||
310 |
send:command andWaitFor:eventHandlers |
|
311 |
"Sends given `command` to GDB and then wait for events mathing |
|
312 |
`eventHandlers`. |
|
313 |
||
314 |
Params: |
|
315 |
`command` may be either a GDBCommand or string, in which case it will |
|
316 |
be parsed into a GDBCommand. |
|
317 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
318 |
of event classes or blocks. |
|
319 |
- If nil then do not wait for anything (use nil for async send) |
|
320 |
- If event class, then wait for an event of that class. Note, that |
|
321 |
subclasses are handled too. |
|
322 |
- If block, then wait for an event for which the block returns true. |
|
323 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
324 |
||
325 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
326 |
||
327 |
^ self send: command andWaitFor: eventHandlers withTimeoutMs: nil |
|
328 |
||
329 |
"Created: / 08-03-2015 / 06:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
330 |
! |
|
331 |
||
332 |
send:command andWaitFor:eventHandlers withTimeoutMs:timeout |
|
333 |
"Sends given `command` to GDB and then wait for events mathing |
|
334 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
335 |
in specified time. |
|
336 |
||
337 |
Params: |
|
338 |
`command` may be either a GDBCommand or string, in which case it will |
|
339 |
be parsed into a GDBCommand. |
|
340 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
341 |
of event classes or blocks. |
|
342 |
- If nil then do not wait for anything (use nil for async send) |
|
343 |
- If event class, then wait for an event of that class. Note, that |
|
344 |
subclasses are handled too. |
|
345 |
- If block, then wait for an event for which the block returns true. |
|
346 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
347 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
348 |
then wait for indefinitly |
|
349 |
||
350 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
351 |
||
352 |
| commandObject | |
|
353 |
||
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
|
354 |
self assert: self isConnected. |
64 | 355 |
command isString ifTrue:[ |
356 |
commandObject := (GDBMIParser on:command) parseCommand. |
|
357 |
commandObject token:self nextCommandSequnceNumber. |
|
358 |
] ifFalse:[ |
|
359 |
commandObject := command. |
|
360 |
commandObject token isNil ifTrue:[ |
|
361 |
commandObject token:self nextCommandSequnceNumber. |
|
362 |
]. |
|
363 |
]. |
|
364 |
^ self |
|
365 |
do:[ connection pushEvent:(GDBCommandEvent new command: commandObject) ] |
|
366 |
andWaitFor: eventHandlers |
|
367 |
withTimeoutMs: timeout |
|
368 |
||
369 |
"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
|
370 |
"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
|
371 |
! |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
372 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
373 |
send:command andWithResultDo: block |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
374 |
"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
|
375 |
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
|
376 |
result (as instance of GDBCommandResult) |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
377 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
378 |
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
|
379 |
be parsed into a GDBCommand. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
380 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
381 |
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
|
382 |
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
|
383 |
dispatch loop. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
384 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
385 |
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
|
386 |
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
|
387 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
388 |
doSomeAction |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
389 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
390 |
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
|
391 |
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
|
392 |
" |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
393 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
394 |
| cmd token handler1 handler2 result | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
395 |
|
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
|
396 |
self assert: self isConnected. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
397 |
cmd := command. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
398 |
cmd isString ifTrue:[ |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
399 |
cmd := GDBCLICommand new value:cmd. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
400 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
401 |
token := self nextCommandSequnceNumber. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
402 |
cmd token:token. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
403 |
handler1 := [:ev | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
404 |
ev token == token ifTrue:[ |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
405 |
connection eventAnnouncer unsubscribe:handler1. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
406 |
result := ev result. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
407 |
connection eventAnnouncerInternal when:GDBEventSetProcessingFinished |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
408 |
do:handler2. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
409 |
] |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
410 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
411 |
handler2 := [:ev | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
412 |
connection eventAnnouncerInternal unsubscribe:handler2. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
413 |
block value: result. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
414 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
415 |
connection eventAnnouncer when:GDBCommandResultEvent do:handler1. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
416 |
connection pushEvent:(GDBCommandEvent new command:cmd). |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
417 |
^ nil |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
418 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
419 |
"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
|
420 |
"Modified (format): / 04-02-2018 / 00:20:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
421 |
"Modified: / 26-03-2018 / 21:48:02 / jv" |
64 | 422 |
! ! |
423 |
||
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
424 |
!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
|
425 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
426 |
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
|
427 |
"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
|
428 |
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
|
429 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
430 |
(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
|
431 |
" |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
432 |
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
|
433 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
434 |
"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
|
435 |
"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
|
436 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
437 |
|
126
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
438 |
disassembleFile: file line: line count: count |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
439 |
" |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
440 |
Disassemble `count` source lines from `file` starting at line `line`. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
441 |
Returns a list of GDBInstructionsAndSourceLine objects. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
442 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
443 |
If `count` is nil, then disassemble entire function at given |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
444 |
source `file` and `line`. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
445 |
" |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
446 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
447 |
| cmd result disassembly | |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
448 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
449 |
self assert: file isString. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
450 |
self assert: line isInteger. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
451 |
self assert:(count isNil or:[ count isInteger ]). |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
452 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
453 |
count notNil ifTrue:[ |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
454 |
cmd := GDBMI_data_disassemble arguments: (Array with: '-f' with: file with: '-l' with: line with: '-n' with: count with: '--' with: 5) |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
455 |
] ifFalse:[ |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
456 |
cmd := GDBMI_data_disassemble arguments: (Array with: '-f' with: file with: '-l' with: line with: '--' with: 5) |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
457 |
]. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
458 |
result := self send: cmd. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
459 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
460 |
disassembly := result propertyAt: 'asm_insns' |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
461 |
. disassembly do:[:each | each setDebugger: self ]. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
462 |
^ disassembly |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
463 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
464 |
"Created: / 22-06-2018 / 11:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
465 |
! |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
466 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
467 |
disassembleFunction: address |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
468 |
" |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
469 |
Disassemble function at given `address` (given as String). Address |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
470 |
might be any expression evaluable by GDB or function name (as it |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
471 |
appears in debug info) |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
472 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
473 |
WARNING: This requires feature 'data-disassemble-a-option'. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
474 |
This feature is not present in GDB as of 8.1 and likely won't be in |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
475 |
8.2. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
476 |
" |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
477 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
478 |
| result disassembly | |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
479 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
480 |
self assert: address isString. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
481 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
482 |
self ensureFeature: 'data-disassemble-a-option'. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
483 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
484 |
result := self send: (GDBMI_data_disassemble arguments: (Array with: '-a' with: address with: '--' with: 5)). |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
485 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
486 |
disassembly := result propertyAt: 'asm_insns' |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
487 |
. disassembly do:[:each | each setDebugger: self ]. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
488 |
^ disassembly |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
489 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
490 |
"Created: / 03-07-2018 / 14:31:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
491 |
! |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
492 |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
493 |
enableFrameFilters |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
494 |
"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
|
495 |
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
|
496 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
497 |
@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
|
498 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
499 |
| result | |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
500 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
501 |
self ensureFeature: DebuggerFeaturePython. |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
502 |
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
|
503 |
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
|
504 |
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
|
505 |
] ifFalse:[ |
153
dd55019f1d86
Partability: use ANSI `#signal:` to raise an exception
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
506 |
GDBError signal: 'failed to enable frame filters' |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
507 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
508 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
509 |
"Created: / 12-06-2017 / 09:29:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
153
dd55019f1d86
Partability: use ANSI `#signal:` to raise an exception
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
510 |
"Modified: / 21-10-2018 / 08:07:12 / 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
|
511 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
512 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
513 |
enablePrettyPrinting |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
514 |
"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
|
515 |
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
|
516 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
517 |
@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
|
518 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
519 |
| result | |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
520 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
521 |
self ensureFeature: DebuggerFeaturePython. |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
522 |
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
|
523 |
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
|
524 |
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
|
525 |
] ifFalse:[ |
153
dd55019f1d86
Partability: use ANSI `#signal:` to raise an exception
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
526 |
GDBError signal: 'failed to enable pretty printing' |
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
527 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
528 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
529 |
"Created: / 12-06-2017 / 09:29:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
153
dd55019f1d86
Partability: use ANSI `#signal:` to raise an exception
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
530 |
"Modified: / 21-10-2018 / 08:07:08 / 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
|
531 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
532 |
|
109
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
533 |
evaluate: expression |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
534 |
"Evaluates passed `expression` (in target language) in current thread. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
535 |
Returns the result as `GDBVariableObject`," |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
536 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
537 |
^ self evaluate: expression in: nil |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
538 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
539 |
"Created: / 20-03-2018 / 22:53:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
540 |
! |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
541 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
542 |
evaluate: expression in: frame |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
543 |
"Evaluates passed `expression` (in target language). If |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
544 |
`frame` (as `GDBFrame`) is given, evaluate expression in |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
545 |
context of that `frame`. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
546 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
547 |
Returns the result as `GDBVariableObject`," |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
548 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
549 |
| result varobj | |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
550 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
551 |
frame notNil ifTrue:[ |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
552 |
result := self send: (GDBMI_var_create new arguments: (Array with: '--thread' with: frame thread id with: '--frame' with: frame level with: '-' with: '*' with: expression)). |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
553 |
] ifFalse:[ |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
554 |
result := self send: (GDBMI_var_create new arguments: (Array with: '-' with: '*' with: expression)). |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
555 |
]. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
556 |
varobj := result value. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
557 |
varobj |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
558 |
setDebugger: self; |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
559 |
setExpression: expression; |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
560 |
setFrame: frame; |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
561 |
registerForFinalization. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
562 |
^ varobj |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
563 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
564 |
"Created: / 13-02-2018 / 22:21:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
565 |
"Modified (format): / 20-03-2018 / 22:55:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
566 |
! |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
567 |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
568 |
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
|
569 |
"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
|
570 |
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
|
571 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
572 |
(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
|
573 |
" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
574 |
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
|
575 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
576 |
"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
|
577 |
"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
|
578 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
579 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
580 |
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
|
581 |
"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
|
582 |
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
|
583 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
584 |
(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
|
585 |
(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
|
586 |
" |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
587 |
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
|
588 |
anArray notEmptyOrNil ifTrue:[ |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
589 |
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
|
590 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
591 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
592 |
"Created: / 05-06-2017 / 17:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
593 |
"Modified: / 09-02-2018 / 09:44:54 / 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
|
594 |
! |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
595 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
596 |
selectFrame: aGDBFrame |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
597 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
598 |
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
|
599 |
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
|
600 |
and so on |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
601 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
602 |
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
|
603 |
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
|
604 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
605 |
"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
|
606 |
! |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
607 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
608 |
selectThread: aGDBThread |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
609 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
610 |
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
|
611 |
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
|
612 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
613 |
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
|
614 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
615 |
"Created: / 01-02-2018 / 22:25:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
128
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
616 |
! |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
617 |
|
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
618 |
targetConnect: type parameters: parameters |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
619 |
"Connect to the remote target. `type` is the type of target, |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
620 |
for instance ‘extended-remote=’. `parameters` are device names, |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
621 |
host names and the like. |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
622 |
|
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
623 |
See https://sourceware.org/gdb/onlinedocs/gdb/Target-Commands.html#Target-Commands |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
624 |
" |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
625 |
self send:(GDBMI_target_select arguments:(Array with: type) , parameters). |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
626 |
|
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
627 |
"Created: / 26-07-2018 / 21:45:01 / 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
|
628 |
! ! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
629 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
630 |
!GDBDebugger methodsFor:'evaluating'! |
64 | 631 |
|
632 |
do: block andWaitFor:eventHandlers |
|
633 |
"Evaluates a given block and then wait for events. |
|
634 |
`eventHandlers`. |
|
635 |
Params: |
|
636 |
`block` block to evaluate |
|
637 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
638 |
of event classes or blocks. |
|
639 |
- If nil then do not wait for anything (use nil for async send) |
|
640 |
- If event class, then wait for an event of that class. Note, that |
|
641 |
subclasses are handled too. |
|
642 |
- 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
|
643 |
- If collection, then wait for a sequence of events, each matched as above. |
64 | 644 |
Returns: a matching event or events (in case a collection of handlers has been passed)" |
645 |
||
646 |
^ self do: block andWaitFor: eventHandlers withTimeoutMs: nil |
|
647 |
||
648 |
"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
|
649 |
"Modified (comment): / 12-06-2017 / 09:31:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 650 |
! |
651 |
||
652 |
do: block andWaitFor:eventHandlers withTimeoutMs:timeout |
|
653 |
"Evaluates a given block and then wait for events. |
|
654 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
655 |
in specified time. |
|
656 |
||
657 |
Params: |
|
658 |
`block` block to evaluate |
|
659 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
660 |
of event classes or blocks. |
|
661 |
- If nil then do not wait for anything (use nil for async send) |
|
662 |
- If event class, then wait for an event of that class. Note, that |
|
663 |
subclasses are handled too. |
|
664 |
- If block, then wait for an event for which the block returns true. |
|
665 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
666 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
667 |
then wait for indefinitly |
|
668 |
||
669 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
670 |
||
671 |
| handlersArray handlerFinal eventsArray blocker | |
|
672 |
||
673 |
eventHandlers isNil ifTrue:[ |
|
674 |
"/ Asynchronous send... |
|
675 |
self assert:timeout isNil. |
|
676 |
block value. |
|
677 |
^ nil |
|
678 |
]. |
|
679 |
"/ Synchronous send... |
|
148
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
680 |
self |
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
681 |
assert:Processor activeProcess ~~ connection eventDispatchProcess |
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
682 |
message:'Cannot send commands from within event dispatching process. Would deadlock'. |
64 | 683 |
eventHandlers isCollection |
684 |
ifTrue:[ handlersArray := eventHandlers ] |
|
685 |
ifFalse:[ handlersArray := Array with:eventHandlers ]. |
|
686 |
eventsArray := Array new:handlersArray size. |
|
687 |
1 to:handlersArray size do:[:i | |
|
688 |
| handler | |
|
689 |
||
690 |
handler := handlersArray at:i. |
|
691 |
handlersArray at:i |
|
692 |
put:[:event | |
|
693 |
| matches | |
|
694 |
||
695 |
matches := handler isBlock ifTrue:[ handler value:event ] ifFalse:[ event isKindOf:handler ]. |
|
696 |
(matches and:[ i == 1 or:[ (eventsArray at:i - 1) notNil ] ]) ifTrue:[ |
|
697 |
eventsArray at:i put:event. |
|
698 |
self announcer unsubscribe:(handlersArray at:i). |
|
699 |
i == handlersArray size ifTrue:[ |
|
700 |
connection eventAnnouncerInternal when: GDBEventSetProcessingFinished do: handlerFinal. |
|
701 |
]. |
|
702 |
]. |
|
703 |
]. |
|
704 |
self announcer when:GDBEvent do:(handlersArray at:i). |
|
705 |
]. |
|
706 |
handlerFinal := [ :event | connection eventAnnouncerInternal unsubscribe: handlerFinal. blocker signal ]. |
|
707 |
blocker := Semaphore new. |
|
708 |
block value. |
|
709 |
[ |
|
710 |
(blocker waitWithTimeoutMs:timeout) isNil ifTrue:[ |
|
711 |
eventsArray := nil. |
|
712 |
]. |
|
713 |
] ensure:[ |
|
714 |
handlersArray do:[:handler | |
|
715 |
handler notNil ifTrue:[ |
|
716 |
self announcer unsubscribe:handler |
|
717 |
] |
|
718 |
]. |
|
719 |
]. |
|
720 |
eventsArray isNil ifTrue:[ |
|
721 |
(TimeoutError newException) |
|
722 |
parameter:timeout; |
|
723 |
raise. |
|
724 |
]. |
|
725 |
^ eventHandlers isCollection ifTrue:[ eventsArray ] ifFalse:[ eventsArray first ] |
|
726 |
||
727 |
"Created: / 08-03-2015 / 07:28:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
148
9fb679577cac
Forbid blocking calls to `#send:andWait:` and: `send:andWaitFor:withTimeoutMs` from within an event dispatcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
728 |
"Modified (format): / 03-10-2018 / 12:58:30 / 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
|
729 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
730 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
731 |
!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
|
732 |
|
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
733 |
onBreakpointCreatedEvent: aGDBBreakpointCreatedEvent |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
734 |
| breakpoint | |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
735 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
736 |
breakpoints isNil ifTrue:[ |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
737 |
breakpoints := List new. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
738 |
]. |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
739 |
|
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
740 |
"/ Care for breakpoints with multiple locations. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
741 |
"/ |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
742 |
"/.If the breakpoint created has multiple locations, |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
743 |
"/ the breakppints contains an instance of GDBBreakpoint |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
744 |
"/ for the top-level breakpoint, followed by a GDBBreakpoint |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
745 |
"/ for each location. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
746 |
|
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
747 |
breakpoint := aGDBBreakpointCreatedEvent breakpoints first. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
748 |
aGDBBreakpointCreatedEvent breakpoints size > 1 ifTrue:[ |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
749 |
breakpoint locations: (aGDBBreakpointCreatedEvent breakpoints copyFrom: 2) |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
750 |
]. |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
751 |
breakpoint setDebugger: self. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
752 |
breakpoints add: breakpoint. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
753 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
754 |
"Created: / 06-07-2017 / 16:08:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
755 |
"Modified: / 18-05-2018 / 14:59:02 / 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
|
756 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
757 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
758 |
onBreakpointDeletedEvent: aGDBBreakpointDeletedEvent |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
759 |
| breakpoint | |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
760 |
|
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
761 |
breakpoint := self breakpointForId: aGDBBreakpointDeletedEvent id. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
762 |
breakpoint setDebugger: nil. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
763 |
breakpoints remove: breakpoint. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
764 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
765 |
"Created: / 06-07-2017 / 16:26:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
766 |
"Modified: / 18-05-2018 / 14:58:30 / 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
|
767 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
768 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
769 |
onBreakpointModifiedEvent: aGDBBreakpointModifiedEvent |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
770 |
aGDBBreakpointModifiedEvent breakpoints do:[:new | |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
771 |
| old | |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
772 |
|
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
773 |
old := self breakpointForId: new number. |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
774 |
old updateFrom: new. |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
775 |
]. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
776 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
777 |
"Created: / 06-07-2017 / 16:28:00 / 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
|
778 |
"Modified: / 15-01-2018 / 23:11:52 / jv" |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
779 |
"Modified: / 18-05-2018 / 14:58:00 / 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
|
780 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
781 |
|
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
782 |
onCmdParamChangedEvent: aGDBCmdParamChangedEvent |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
783 |
(aGDBCmdParamChangedEvent name = 'directories') ifTrue:[ |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
784 |
directories := nil. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
785 |
]. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
786 |
|
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
787 |
"Created: / 09-03-2018 / 12:12:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
788 |
! |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
789 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
790 |
onCommandEvent:aGDBCommandEvent |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
791 |
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
|
792 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
793 |
"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
|
794 |
"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
|
795 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
796 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
797 |
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
|
798 |
self release. |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
799 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
800 |
"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
|
801 |
"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
|
802 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
803 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
804 |
onRunningEvent: aGDBRunningEvent |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
805 |
| threads threadId | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
806 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
807 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
808 |
threadId := aGDBRunningEvent threadId. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
809 |
threadId = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
810 |
threadId := threadId asInteger. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
811 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
812 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
813 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
814 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
815 |
(threadId isString or:[thread id = threadId]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
816 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
817 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
818 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
819 |
]. |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
820 |
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
|
821 |
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
|
822 |
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
|
823 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
824 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
825 |
"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
|
826 |
"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
|
827 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
828 |
|
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
829 |
onStoppedEvent: aGDBStoppedEvent |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
830 |
| threads threadIds | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
831 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
832 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
833 |
threadIds := aGDBStoppedEvent stoppedThreadIds. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
834 |
threadIds = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
835 |
threadIds := threadIds collect:[:e | e asInteger ]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
836 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
837 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
838 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
839 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
840 |
(threadIds isString or:[threadIds includes: thread id]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
841 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
842 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
843 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
844 |
]. |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
845 |
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
|
846 |
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
|
847 |
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
|
848 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
849 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
850 |
"/ Initialize target features properly |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
851 |
targetFeatures isNil ifTrue:[ |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
852 |
self send: GDBMI_list_target_features new |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
853 |
andWithResultDo:[ :result | targetFeatures := result propertyAt: #features ]. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
854 |
]. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
855 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
856 |
"Created: / 07-09-2014 / 23:34:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
857 |
"Modified: / 09-04-2018 / 15:42:33 / 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
|
858 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
859 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
860 |
onThreadCreatedEvent:aGDBThreadCreatedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
861 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
862 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
863 |
inferior := self inferiorForId:aGDBThreadCreatedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
864 |
inferior onThreadCreatedEvent:aGDBThreadCreatedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
865 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
866 |
"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
|
867 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
868 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
869 |
onThreadExitedEvent:aGDBThreadExitedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
870 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
871 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
872 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
873 |
inferior := self inferiorForId:aGDBThreadExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
874 |
inferior onThreadExitedEvent:aGDBThreadExitedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
875 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
876 |
"/ reset target features |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
877 |
targetFeatures := nil. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
878 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
879 |
"Created: / 07-09-2014 / 21:20:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
880 |
"Modified: / 09-04-2018 / 15:42:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
881 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
882 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
883 |
onThreadGroupAddedEvent:aGDBThreadGroupAddedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
884 |
| inferior | |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
885 |
|
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
886 |
inferiors isNil ifTrue:[ |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
887 |
inferiors := List new. |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
888 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
889 |
inferior := GDBThreadGroup newWithDebugger:self |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
890 |
id:aGDBThreadGroupAddedEvent threadGroupId. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
891 |
inferiors add:inferior. |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
892 |
aGDBThreadGroupAddedEvent setThreadGroup:inferior. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
893 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
894 |
"Modified: / 26-03-2018 / 21:46:51 / jv" |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
895 |
"Modified: / 09-04-2018 / 15:36:15 / 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
|
896 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
897 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
898 |
onThreadGroupExitedEvent:aGDBThreadGroupExitedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
899 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
900 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
901 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
902 |
inferior := self inferiorForId:aGDBThreadGroupExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
903 |
inferior setExitCode:aGDBThreadGroupExitedEvent exitCode. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
904 |
aGDBThreadGroupExitedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
905 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
906 |
"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
|
907 |
"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
|
908 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
909 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
910 |
onThreadGroupStartedEvent:aGDBThreadGroupStartedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
911 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
912 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
913 |
inferior := self inferiorForId:aGDBThreadGroupStartedEvent threadGroupId. |
144
342b6dfe3a6f
Add model for machine registers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
129
diff
changeset
|
914 |
inferior reset. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
915 |
inferior setPid:aGDBThreadGroupStartedEvent pid. |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
916 |
aGDBThreadGroupStartedEvent setThreadGroup:inferior. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
917 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
918 |
"Created: / 06-09-2014 / 02:37:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
919 |
"Modified: / 26-03-2018 / 21:33:11 / jv" |
144
342b6dfe3a6f
Add model for machine registers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
129
diff
changeset
|
920 |
"Modified: / 26-09-2018 / 10:57:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
129
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
921 |
! |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
922 |
|
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
923 |
onThreadSelectedEvent: aGDBThreadSelectedEvent |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
924 |
| inferior | |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
925 |
|
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
926 |
inferior := self selectedInferior. |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
927 |
inferior onThreadSelectedEvent:aGDBThreadSelectedEvent. |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
928 |
|
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
929 |
"Created: / 29-07-2018 / 22:20: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
|
930 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
931 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
932 |
!GDBDebugger methodsFor:'finalization'! |
0 | 933 |
|
934 |
finalize |
|
935 |
self release. |
|
936 |
||
937 |
"Created: / 26-05-2014 / 21:23:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
938 |
! ! |
|
939 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
940 |
!GDBDebugger methodsFor:'initialize & release'! |
0 | 941 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
942 |
initializeWithProcess: aGDBProcess |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
943 |
| result | |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
944 |
|
1 | 945 |
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
|
946 |
|
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
947 |
finalizationRegistry := Registry new. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
948 |
connection := GDBConnection newWithProcess: aGDBProcess. |
0 | 949 |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
950 |
commandSequenceNumber := 0. |
19 | 951 |
inferiorStateSequenceNumber := 0. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
952 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
953 |
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
|
954 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
955 |
connection eventPumpStart. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
956 |
connection eventDispatchStart. |
25
58e042a191a9
More work on GDB session recorder.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
957 |
Delay waitForMilliseconds:100. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
958 |
|
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
959 |
connection inferiorPTY notNil ifTrue:[ |
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
960 |
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
|
961 |
]. |
48
330aa6df3dfb
Set target-async option to allow asynchronous communication with GDB.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
46
diff
changeset
|
962 |
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
|
963 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
964 |
result := self send: GDBMI_list_features new. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
965 |
debuggerFeatures := result propertyAt: #features. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
966 |
targetFeatures := nil. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
967 |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
968 |
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
|
969 |
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
|
970 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
971 |
"Created: / 20-06-2014 / 21:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
972 |
"Modified: / 26-03-2018 / 21:36:31 / jv" |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
973 |
"Modified: / 09-04-2018 / 15:38:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 974 |
! |
975 |
||
976 |
release |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
977 |
connection notNil ifTrue:[ |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
978 |
self unsubscribe. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
979 |
connection release. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
980 |
connection := nil. |
0 | 981 |
]. |
982 |
||
983 |
"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
|
984 |
"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
|
985 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
986 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
987 |
subscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
988 |
connection eventAnnouncerInternal |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
989 |
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
|
990 |
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
|
991 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
992 |
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
|
993 |
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
|
994 |
when: GDBThreadGroupExitedEvent send: #onThreadGroupExitedEvent: to: self; |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
995 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
996 |
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
|
997 |
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
|
998 |
|
129
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
999 |
when: GDBThreadSelectedEvent send: #onThreadSelectedEvent: to: self; |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1000 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1001 |
when: GDBRunningEvent send: #onRunningEvent: to: self; |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1002 |
when: GDBStoppedEvent send: #onStoppedEvent: to: self; |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1003 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1004 |
when: GDBBreakpointCreatedEvent send: #onBreakpointCreatedEvent: to: self; |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1005 |
when: GDBBreakpointModifiedEvent send: #onBreakpointModifiedEvent: to: self; |
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
1006 |
when: GDBBreakpointDeletedEvent send: #onBreakpointDeletedEvent: to: self; |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
1007 |
|
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
1008 |
when: GDBCmdParamChangedEvent send: #onCmdParamChangedEvent: to: self. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1009 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1010 |
"Created: / 20-06-2014 / 22:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
129
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1011 |
"Modified: / 29-07-2018 / 22:18:44 / 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
|
1012 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1013 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1014 |
unsubscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1015 |
connection eventAnnouncerInternal unsubscribe: self |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1016 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1017 |
"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
|
1018 |
! ! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1019 |
|
113
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1020 |
!GDBDebugger methodsFor:'inspecting'! |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1021 |
|
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1022 |
inspector2TabGDBMITrace |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1023 |
<inspector2Tab> |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1024 |
^ (self newInspector2Tab) |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1025 |
label:'GDB/MI Trace'; |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1026 |
priority:50; |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1027 |
application:[ GDBMITraceViewer new debugger:self ]; |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1028 |
yourself |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1029 |
|
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1030 |
"Modified (format): / 09-03-2018 / 10:09:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1031 |
! ! |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1032 |
|
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1033 |
!GDBDebugger methodsFor:'queries'! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1034 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1035 |
hasFeature: feature |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1036 |
"Return true, if this debugger support given feature, false otherwise. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1037 |
See GDBFeatures pool for available features. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1038 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1039 |
Note however, that newer versions og GDB may have more features. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1040 |
" |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1041 |
^ self features includes: feature |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1042 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1043 |
"Created: / 07-02-2018 / 11:32:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1044 |
"Modified (comment): / 07-02-2018 / 12:44:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1045 |
! |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1046 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1047 |
hasFeatureAsync |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1048 |
"Indicates that the target is capable of asynchronous command execution, which means |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1049 |
that GDB will accept further commands while the target is running." |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1050 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1051 |
targetFeatures notNil ifTrue:[ |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1052 |
^ targetFeatures includes: 'async' |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1053 |
] ifFalse:[ |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1054 |
^ connection nativeTargetFeatures includes: 'async'. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1055 |
]. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1056 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1057 |
"Created: / 09-04-2018 / 15:45:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1058 |
! ! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1059 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1060 |
!GDBDebugger methodsFor:'testing'! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1061 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1062 |
isConnected |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1063 |
^ connection notNil |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1064 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1065 |
"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
|
1066 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1067 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1068 |
isFrameFiltersEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1069 |
^ frameFiltersEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1070 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1071 |
"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
|
1072 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1073 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1074 |
isPrettyPrintingEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1075 |
^ prettyPrintingEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1076 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1077 |
"Created: / 12-06-2017 / 09:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 1078 |
! ! |
1079 |
||
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1080 |
!GDBDebugger methodsFor:'utilities'! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1081 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1082 |
ensureFeature: feature |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1083 |
"No-op if this debugger supports given `feature`, otherwise |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1084 |
throw an error" |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1085 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1086 |
(self hasFeature: feature) ifFalse:[ |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1087 |
GDBUnsupportedFeatureError newException |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1088 |
parameter: self -> feature; |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1089 |
messageText:'Unssuported feature: ' , feature printString; |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1090 |
raise. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1091 |
]. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1092 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1093 |
"Created: / 07-02-2018 / 11:34:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1094 |
! ! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1095 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
1096 |
!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
|
1097 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1098 |
version_HG |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1099 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1100 |
^ '$Changeset: <not expanded> $' |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1101 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1102 |