author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 25 Feb 2019 17:55:20 +0000 | |
changeset 177 | e7bd05df3d6b |
parent 175 | a04e1a36e888 |
child 180 | cd22cacfcdcb |
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 |
165
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
29 |
finalizationRegistry debuggerFeatures targetFeatures |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
30 |
supportedCommands directories' |
0 | 31 |
classVariableNames:'' |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
32 |
poolDictionaries:'GDBCommandStatus GDBFeatures' |
0 | 33 |
category:'GDB-Core' |
34 |
! |
|
35 |
||
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
36 |
!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
|
37 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
38 |
copyright |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
39 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
40 |
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
|
41 |
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
|
42 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
43 |
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
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
48 |
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
|
49 |
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
|
50 |
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
|
51 |
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
|
52 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
53 |
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
|
54 |
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
|
55 |
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
|
56 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
57 |
! ! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
58 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
59 |
!GDBDebugger class methodsFor:'instance creation'! |
0 | 60 |
|
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
61 |
new |
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
62 |
^ 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
|
63 |
|
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
64 |
"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
|
65 |
! |
0 | 66 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
67 |
newWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
68 |
^ self basicNew initializeWithProcess: aGDBProcess |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
69 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
70 |
"Created: / 20-06-2014 / 21:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 71 |
! ! |
72 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
73 |
!GDBDebugger methodsFor:'accessing'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
74 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
75 |
announcer |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
76 |
^ connection eventAnnouncer. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
77 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
78 |
"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
|
79 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
80 |
|
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
81 |
breakpointForId: id |
175
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
82 |
^ self breakpointForId: id ifAbsent:[self error: ('No breakpoint with id ''%1'' found!!' bindWith: id)] |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
83 |
|
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
84 |
"Created: / 18-05-2018 / 13:39:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
85 |
"Modified: / 07-02-2019 / 15:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
86 |
! |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
87 |
|
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
88 |
breakpointForId: id ifAbsent: block |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
89 |
self breakpoints do:[:bp | |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
90 |
bp number = id ifTrue:[ ^ bp ]. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
91 |
bp locations do: [ :loc | |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
92 |
loc number = id ifTrue:[ ^ loc ]. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
93 |
]. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
94 |
]. |
175
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
95 |
^ block value. |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
96 |
|
175
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
97 |
"Created: / 07-02-2019 / 15:04:10 / 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
|
98 |
! |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
99 |
|
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
100 |
breakpoints |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
101 |
breakpoints isNil ifTrue:[ |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
102 |
breakpoints := List new. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
103 |
]. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
104 |
^ breakpoints |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
105 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
106 |
"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
|
107 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
108 |
|
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
109 |
consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
110 |
^ connection consoleInput |
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: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
|
113 |
"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
|
114 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
115 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
116 |
consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
117 |
^ connection consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
118 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
119 |
"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
|
120 |
"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
|
121 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
122 |
|
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
123 |
directories |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
124 |
"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
|
125 |
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
|
126 |
" |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
127 |
| result | |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
128 |
|
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
129 |
directories isNil ifTrue:[ |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
130 |
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
|
131 |
|
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
132 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
133 |
"/ 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
|
134 |
"/ 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
|
135 |
directories := ((result propertyAt: #value) tokensBasedOn: $;) |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
136 |
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
|
137 |
as: Array. |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
138 |
] ifFalse:[ |
258bf0b2317c
Fixed `GDBDebugger >> directories` to work on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
139 |
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
|
140 |
]. |
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
141 |
]. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
142 |
^ directories |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
143 |
|
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
144 |
"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
|
145 |
"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
|
146 |
! |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
147 |
|
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
148 |
features |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
149 |
"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
|
150 |
See |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
151 |
* GDBFeatures` pool |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
152 |
* 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
|
153 |
command `-list-features` |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
154 |
" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
155 |
^ 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
|
156 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
157 |
"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
|
158 |
"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
|
159 |
"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
|
160 |
! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
161 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
162 |
inferiorForId: id |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
163 |
^ inferiors ? #() detect:[:e | e id = id ] ifNone:[ |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
164 |
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
|
165 |
]. |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
166 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
167 |
"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
|
168 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
169 |
|
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
170 |
inferiorStderr |
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: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
|
174 |
"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
|
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 |
inferiorStdin |
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: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
|
181 |
"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
|
182 |
! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
183 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
184 |
inferiorStdout |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
185 |
^ connection inferiorPTY master |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
186 |
|
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
187 |
"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
|
188 |
"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
|
189 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
190 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
191 |
inferiors |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
192 |
^ inferiors ? #() |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
193 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
194 |
"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
|
195 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
196 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
197 |
selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
198 |
selectedInferior isNil ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
199 |
inferiors size == 1 ifTrue:[ |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
200 |
^ inferiors anElement. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
201 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
202 |
]. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
203 |
^ selectedInferior |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
204 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
205 |
"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
|
206 |
! |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
207 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
208 |
threadForId: id |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
209 |
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
|
210 |
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
|
211 |
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
|
212 |
]. |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
213 |
]. |
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
214 |
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
|
215 |
|
12c96f17fc53
Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
216 |
"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
|
217 |
! ! |
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
218 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
219 |
!GDBDebugger methodsFor:'accessing-private'! |
10
f04a22c9b16c
Use special PTY for inferior input/output...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
9
diff
changeset
|
220 |
|
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
|
221 |
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
|
222 |
^ 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
|
223 |
|
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
224 |
"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
|
225 |
! |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
226 |
|
19 | 227 |
currentInferiorStateSequnceNumber |
228 |
^ inferiorStateSequenceNumber |
|
229 |
||
230 |
"Created: / 19-06-2014 / 22:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
231 |
! |
|
232 |
||
102
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
233 |
finalizationRegistry |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
234 |
^ finalizationRegistry |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
235 |
! |
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
236 |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
237 |
nextCommandSequnceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
238 |
commandSequenceNumber := commandSequenceNumber + 1. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
239 |
commandSequenceNumber == SmallInteger maxVal ifTrue:[ |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
240 |
commandSequenceNumber := 0. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
241 |
]. |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
242 |
^ commandSequenceNumber |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
243 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
244 |
"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
|
245 |
! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
246 |
|
19 | 247 |
nextInferiorStateSequnceNumber |
248 |
inferiorStateSequenceNumber := inferiorStateSequenceNumber + 1. |
|
249 |
inferiorStateSequenceNumber == SmallInteger maxVal ifTrue:[ |
|
250 |
inferiorStateSequenceNumber := 0. |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
251 |
]. |
19 | 252 |
^ inferiorStateSequenceNumber |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
253 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
254 |
"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
|
255 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
256 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
257 |
!GDBDebugger methodsFor:'commands'! |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
258 |
|
56
20989de12cfb
More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
259 |
send: command |
64 | 260 |
"Execute given `command` and wait until it finishes and return its result. |
261 |
`command` may be either a GDBCommand or string, in which case it will |
|
262 |
be parsed into a GDBCommand. |
|
263 |
" |
|
264 |
^ 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
|
265 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
266 |
"Created: / 03-06-2014 / 00:10:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 267 |
"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
|
268 |
! |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
269 |
|
64 | 270 |
send:command andWait:wait |
271 |
"Sends given `command` to GDB. If `wait` is true, wait for |
|
272 |
command to finish and return the command result. |
|
273 |
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
|
274 |
|
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
275 |
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
|
276 |
is thrown. |
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
277 |
|
64 | 278 |
`command` may be either a GDBCommand or string, in which case it will |
279 |
be parsed into a GDBCommand. |
|
280 |
" |
|
281 |
||
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
282 |
| blocker result | |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
283 |
|
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
|
284 |
self assert: self isConnected. |
64 | 285 |
^ 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
|
286 |
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
|
287 |
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
|
288 |
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
|
289 |
blocker := Semaphore new. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
290 |
self send: command andWithResultDo: [ :r | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
291 |
result := r. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
292 |
blocker signal |
64 | 293 |
]. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
294 |
blocker wait. |
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
295 |
result isError ifTrue:[ |
88
90c50fd6374c
Introduced new exception class: `GDBCommandFailedError`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
87
diff
changeset
|
296 |
GDBCommandFailedError raiseForResult: result. |
85
6fea1000a2a5
Implemented proper quoting of MI commands
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
82
diff
changeset
|
297 |
]. |
40
0ce76b671515
Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
38
diff
changeset
|
298 |
result. |
64 | 299 |
] |
300 |
ifFalse:[ |
|
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
301 |
| cmd | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
302 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
303 |
cmd := command. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
304 |
cmd isString ifTrue:[ |
174
18ef81a3fee5
Add `GDBCLICommand >> #operation` returning (expanded) CLI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
172
diff
changeset
|
305 |
cmd := GDBCommand parse:cmd. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
306 |
]. |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
307 |
cmd token: self nextCommandSequnceNumber. |
64 | 308 |
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
|
309 |
nil. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
310 |
] |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
311 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
312 |
"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
|
313 |
"Modified: / 26-03-2018 / 21:19:59 / jv" |
174
18ef81a3fee5
Add `GDBCLICommand >> #operation` returning (expanded) CLI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
172
diff
changeset
|
314 |
"Modified: / 28-01-2019 / 21:26:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 315 |
! |
316 |
||
317 |
send:command andWaitFor:eventHandlers |
|
318 |
"Sends given `command` to GDB and then wait for events mathing |
|
319 |
`eventHandlers`. |
|
320 |
||
321 |
Params: |
|
322 |
`command` may be either a GDBCommand or string, in which case it will |
|
323 |
be parsed into a GDBCommand. |
|
324 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
325 |
of event classes or blocks. |
|
326 |
- If nil then do not wait for anything (use nil for async send) |
|
327 |
- If event class, then wait for an event of that class. Note, that |
|
328 |
subclasses are handled too. |
|
329 |
- If block, then wait for an event for which the block returns true. |
|
330 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
331 |
||
332 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
333 |
||
334 |
^ self send: command andWaitFor: eventHandlers withTimeoutMs: nil |
|
335 |
||
336 |
"Created: / 08-03-2015 / 06:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
337 |
! |
|
338 |
||
339 |
send:command andWaitFor:eventHandlers withTimeoutMs:timeout |
|
340 |
"Sends given `command` to GDB and then wait for events mathing |
|
341 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
342 |
in specified time. |
|
343 |
||
344 |
Params: |
|
345 |
`command` may be either a GDBCommand or string, in which case it will |
|
346 |
be parsed into a GDBCommand. |
|
347 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
348 |
of event classes or blocks. |
|
349 |
- If nil then do not wait for anything (use nil for async send) |
|
350 |
- If event class, then wait for an event of that class. Note, that |
|
351 |
subclasses are handled too. |
|
352 |
- If block, then wait for an event for which the block returns true. |
|
353 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
354 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
355 |
then wait for indefinitly |
|
356 |
||
357 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
358 |
||
359 |
| commandObject | |
|
360 |
||
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
|
361 |
self assert: self isConnected. |
64 | 362 |
command isString ifTrue:[ |
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
363 |
commandObject := GDBCommand parse: command. |
64 | 364 |
commandObject token:self nextCommandSequnceNumber. |
365 |
] ifFalse:[ |
|
366 |
commandObject := command. |
|
367 |
commandObject token isNil ifTrue:[ |
|
368 |
commandObject token:self nextCommandSequnceNumber. |
|
369 |
]. |
|
370 |
]. |
|
371 |
^ self |
|
372 |
do:[ connection pushEvent:(GDBCommandEvent new command: commandObject) ] |
|
373 |
andWaitFor: eventHandlers |
|
374 |
withTimeoutMs: timeout |
|
375 |
||
376 |
"Created: / 07-03-2015 / 11:38:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
377 |
"Modified: / 19-01-2019 / 23:05:35 / 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
|
378 |
! |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
379 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
380 |
send:command andWithResultDo: block |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
381 |
"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
|
382 |
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
|
383 |
result (as instance of GDBCommandResult) |
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 |
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
|
386 |
be parsed into a GDBCommand. |
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 |
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
|
389 |
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
|
390 |
dispatch loop. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
391 |
|
166
5cb191425081
Add class for new MI command `-complete`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
392 |
It's is a good practice not to do anything real within the block but just |
5cb191425081
Add class for new MI command `-complete`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
393 |
grab the result and let it be processed within UI event loop, e.g. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
394 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
395 |
doSomeAction |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
396 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
397 |
debugger send: (GDBMI_data_read_memory arguments:...) |
166
5cb191425081
Add class for new MI command `-complete`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
398 |
andWithResultDo:[ :result | self sensor pushUserEvent: #updateWithResult: with: result ]. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
399 |
" |
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 |
| cmd token handler1 handler2 result | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
402 |
|
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
|
403 |
self assert: self isConnected. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
404 |
cmd := command. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
405 |
cmd isString ifTrue:[ |
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
406 |
cmd := GDBCommand parse:cmd. |
96
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
407 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
408 |
token := self nextCommandSequnceNumber. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
409 |
cmd token:token. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
410 |
handler1 := [:ev | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
411 |
ev token == token ifTrue:[ |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
412 |
connection eventAnnouncer unsubscribe:handler1. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
413 |
result := ev result. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
414 |
connection eventAnnouncerInternal when:GDBEventSetProcessingFinished |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
415 |
do:handler2. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
416 |
] |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
417 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
418 |
handler2 := [:ev | |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
419 |
connection eventAnnouncerInternal unsubscribe:handler2. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
420 |
block value: result. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
421 |
]. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
422 |
connection eventAnnouncer when:GDBCommandResultEvent do:handler1. |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
423 |
connection pushEvent:(GDBCommandEvent new command:cmd). |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
424 |
^ nil |
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
425 |
|
43591d874c9f
Added API method `GDBDebugger >> send:andWithResultDo:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
95
diff
changeset
|
426 |
"Created: / 26-01-2018 / 21:47:34 / 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
|
427 |
"Modified: / 26-03-2018 / 21:48:02 / jv" |
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
428 |
"Modified: / 19-01-2019 / 23:06:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 429 |
! ! |
430 |
||
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
431 |
!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
|
432 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
433 |
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
|
434 |
"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
|
435 |
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
|
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 |
(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
|
438 |
" |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
439 |
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
|
440 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
441 |
"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
|
442 |
"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
|
443 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
444 |
|
126
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
445 |
disassembleFile: file line: line count: count |
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 |
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
|
448 |
Returns a list of GDBInstructionsAndSourceLine objects. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
449 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
450 |
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
|
451 |
source `file` and `line`. |
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 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
454 |
| cmd result disassembly | |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
455 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
456 |
self assert: file isString. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
457 |
self assert: line isInteger. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
458 |
self assert:(count isNil or:[ count isInteger ]). |
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 |
count notNil ifTrue:[ |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
461 |
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
|
462 |
] ifFalse:[ |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
463 |
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
|
464 |
]. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
465 |
result := self send: cmd. |
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 |
disassembly := result propertyAt: 'asm_insns' |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
468 |
. disassembly do:[:each | each setDebugger: self ]. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
469 |
^ disassembly |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
470 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
471 |
"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
|
472 |
! |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
473 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
474 |
disassembleFunction: address |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
475 |
" |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
476 |
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
|
477 |
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
|
478 |
appears in debug info) |
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 |
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
|
481 |
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
|
482 |
8.2. |
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 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
485 |
| result disassembly | |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
486 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
487 |
self assert: address isString. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
488 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
489 |
self ensureFeature: 'data-disassemble-a-option'. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
490 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
491 |
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
|
492 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
493 |
disassembly := result propertyAt: 'asm_insns' |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
494 |
. disassembly do:[:each | each setDebugger: self ]. |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
495 |
^ disassembly |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
496 |
|
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
497 |
"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
|
498 |
! |
fb73b0af430b
Added initial support for disassembling
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
120
diff
changeset
|
499 |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
500 |
enableFrameFilters |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
501 |
"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
|
502 |
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
|
503 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
504 |
@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
|
505 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
506 |
| result | |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
507 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
508 |
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
|
509 |
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
|
510 |
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
|
511 |
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
|
512 |
] ifFalse:[ |
153
dd55019f1d86
Partability: use ANSI `#signal:` to raise an exception
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
513 |
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
|
514 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
515 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
516 |
"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
|
517 |
"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
|
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 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
520 |
enablePrettyPrinting |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
521 |
"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
|
522 |
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
|
523 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
524 |
@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
|
525 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
526 |
| result | |
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
527 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
528 |
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
|
529 |
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
|
530 |
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
|
531 |
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
|
532 |
] ifFalse:[ |
153
dd55019f1d86
Partability: use ANSI `#signal:` to raise an exception
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
148
diff
changeset
|
533 |
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
|
534 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
535 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
536 |
"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
|
537 |
"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
|
538 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
539 |
|
109
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
540 |
evaluate: expression |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
541 |
"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
|
542 |
Returns the result as `GDBVariableObject`," |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
543 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
544 |
^ self evaluate: expression in: nil |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
545 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
546 |
"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
|
547 |
! |
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 |
evaluate: expression in: frame |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
550 |
"Evaluates passed `expression` (in target language). If |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
551 |
`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
|
552 |
context of that `frame`. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
553 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
554 |
Returns the result as `GDBVariableObject`," |
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 |
| result varobj | |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
557 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
558 |
frame notNil ifTrue:[ |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
559 |
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
|
560 |
] ifFalse:[ |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
561 |
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
|
562 |
]. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
563 |
varobj := result value. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
564 |
varobj |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
565 |
setDebugger: self; |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
566 |
setExpression: expression; |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
567 |
setFrame: frame; |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
568 |
registerForFinalization. |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
569 |
^ varobj |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
570 |
|
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
571 |
"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
|
572 |
"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
|
573 |
! |
f57ce907abf4
Variable objects: added `GDBVariableObject >> #duplicate`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
574 |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
575 |
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
|
576 |
"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
|
577 |
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
|
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 |
(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
|
580 |
" |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
581 |
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
|
582 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
583 |
"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
|
584 |
"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
|
585 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
586 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
587 |
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
|
588 |
"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
|
589 |
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
|
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 |
(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
|
592 |
(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
|
593 |
" |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
594 |
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
|
595 |
anArray notEmptyOrNil ifTrue:[ |
97
b17c889076e4
Added API for memory dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
596 |
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
|
597 |
]. |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
598 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
599 |
"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
|
600 |
"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
|
601 |
! |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
602 |
|
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
603 |
getParameter:name |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
604 |
"Teturn the current value of a GDB parameter. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
605 |
See `show` GDB command. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
606 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
607 |
Subscribe to `GDBCmdParamChangedEvent` to get notified |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
608 |
when parameter value changes. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
609 |
" |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
610 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
611 |
| result | |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
612 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
613 |
result := self send:(GDBMI_gdb_show arguments:(Array with:name)). |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
614 |
^ result propertyAt:#value. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
615 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
616 |
"Created: / 19-01-2019 / 21:55:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
617 |
! |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
618 |
|
104
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
619 |
selectFrame: aGDBFrame |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
620 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
621 |
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
|
622 |
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
|
623 |
and so on |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
624 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
625 |
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
|
626 |
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
|
627 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
628 |
"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
|
629 |
! |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
630 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
631 |
selectThread: aGDBThread |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
632 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
633 |
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
|
634 |
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
|
635 |
" |
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
636 |
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
|
637 |
|
4add55336dfe
Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
102
diff
changeset
|
638 |
"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
|
639 |
! |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
640 |
|
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
641 |
setParameter:name to:value |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
642 |
"Set an internal GDB parameter named `name` to `value`. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
643 |
See `set` GDB command. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
644 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
645 |
Subscribe to `GDBCmdParamChangedEvent` to get notified |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
646 |
when parameter value changes. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
647 |
" |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
648 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
649 |
self assert:value isString. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
650 |
self send:(GDBMI_gdb_set arguments:(Array with:name with:value)). |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
651 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
652 |
"Created: / 19-01-2019 / 21:56:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
653 |
! |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
654 |
|
128
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
655 |
targetConnect: type parameters: parameters |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
656 |
"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
|
657 |
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
|
658 |
host names and the like. |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
659 |
|
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
660 |
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
|
661 |
" |
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
662 |
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
|
663 |
|
8d7c075a06b9
API: added GDBDebugger >> #targetConnect:parameters:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
126
diff
changeset
|
664 |
"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
|
665 |
! ! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
666 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
667 |
!GDBDebugger methodsFor:'evaluating'! |
64 | 668 |
|
669 |
do: block andWaitFor:eventHandlers |
|
670 |
"Evaluates a given block and then wait for events. |
|
671 |
`eventHandlers`. |
|
672 |
Params: |
|
673 |
`block` block to evaluate |
|
674 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
675 |
of event classes or blocks. |
|
676 |
- If nil then do not wait for anything (use nil for async send) |
|
677 |
- If event class, then wait for an event of that class. Note, that |
|
678 |
subclasses are handled too. |
|
679 |
- 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
|
680 |
- If collection, then wait for a sequence of events, each matched as above. |
64 | 681 |
Returns: a matching event or events (in case a collection of handlers has been passed)" |
682 |
||
683 |
^ self do: block andWaitFor: eventHandlers withTimeoutMs: nil |
|
684 |
||
685 |
"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
|
686 |
"Modified (comment): / 12-06-2017 / 09:31:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
64 | 687 |
! |
688 |
||
689 |
do: block andWaitFor:eventHandlers withTimeoutMs:timeout |
|
690 |
"Evaluates a given block and then wait for events. |
|
691 |
`eventHandlers`. Raise a TimeoutError if expected events don't arrive |
|
692 |
in specified time. |
|
693 |
||
694 |
Params: |
|
695 |
`block` block to evaluate |
|
696 |
`eventHandler` may be either nil or event class or one arg block or collection |
|
697 |
of event classes or blocks. |
|
698 |
- If nil then do not wait for anything (use nil for async send) |
|
699 |
- If event class, then wait for an event of that class. Note, that |
|
700 |
subclasses are handled too. |
|
701 |
- If block, then wait for an event for which the block returns true. |
|
702 |
- If collectio, then wait for a sequence of events, each matched as above. |
|
703 |
`timeout` wait at most that much milliseconds, throw TimeoutError otherwise. If `timeout` == mil |
|
704 |
then wait for indefinitly |
|
705 |
||
706 |
Returns: a matching event or events (in case a collection of handlers has been passes)" |
|
707 |
||
708 |
| handlersArray handlerFinal eventsArray blocker | |
|
709 |
||
710 |
eventHandlers isNil ifTrue:[ |
|
711 |
"/ Asynchronous send... |
|
712 |
self assert:timeout isNil. |
|
713 |
block value. |
|
714 |
^ nil |
|
715 |
]. |
|
716 |
"/ 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
|
717 |
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
|
718 |
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
|
719 |
message:'Cannot send commands from within event dispatching process. Would deadlock'. |
64 | 720 |
eventHandlers isCollection |
721 |
ifTrue:[ handlersArray := eventHandlers ] |
|
722 |
ifFalse:[ handlersArray := Array with:eventHandlers ]. |
|
723 |
eventsArray := Array new:handlersArray size. |
|
724 |
1 to:handlersArray size do:[:i | |
|
725 |
| handler | |
|
726 |
||
727 |
handler := handlersArray at:i. |
|
728 |
handlersArray at:i |
|
729 |
put:[:event | |
|
730 |
| matches | |
|
731 |
||
732 |
matches := handler isBlock ifTrue:[ handler value:event ] ifFalse:[ event isKindOf:handler ]. |
|
733 |
(matches and:[ i == 1 or:[ (eventsArray at:i - 1) notNil ] ]) ifTrue:[ |
|
734 |
eventsArray at:i put:event. |
|
735 |
self announcer unsubscribe:(handlersArray at:i). |
|
736 |
i == handlersArray size ifTrue:[ |
|
737 |
connection eventAnnouncerInternal when: GDBEventSetProcessingFinished do: handlerFinal. |
|
738 |
]. |
|
739 |
]. |
|
740 |
]. |
|
741 |
self announcer when:GDBEvent do:(handlersArray at:i). |
|
742 |
]. |
|
743 |
handlerFinal := [ :event | connection eventAnnouncerInternal unsubscribe: handlerFinal. blocker signal ]. |
|
744 |
blocker := Semaphore new. |
|
745 |
block value. |
|
746 |
[ |
|
747 |
(blocker waitWithTimeoutMs:timeout) isNil ifTrue:[ |
|
748 |
eventsArray := nil. |
|
749 |
]. |
|
750 |
] ensure:[ |
|
751 |
handlersArray do:[:handler | |
|
752 |
handler notNil ifTrue:[ |
|
753 |
self announcer unsubscribe:handler |
|
754 |
] |
|
755 |
]. |
|
756 |
]. |
|
757 |
eventsArray isNil ifTrue:[ |
|
758 |
(TimeoutError newException) |
|
759 |
parameter:timeout; |
|
760 |
raise. |
|
761 |
]. |
|
762 |
^ eventHandlers isCollection ifTrue:[ eventsArray ] ifFalse:[ eventsArray first ] |
|
763 |
||
764 |
"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
|
765 |
"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
|
766 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
767 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
768 |
!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
|
769 |
|
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
770 |
onBreakpointCreatedEvent: aGDBBreakpointCreatedEvent |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
771 |
| breakpoint | |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
772 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
773 |
breakpoints isNil ifTrue:[ |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
774 |
breakpoints := List new. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
775 |
]. |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
776 |
|
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
777 |
"/ 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
|
778 |
"/ |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
779 |
"/.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
|
780 |
"/ 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
|
781 |
"/ 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
|
782 |
"/ for each location. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
783 |
|
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
784 |
breakpoint := aGDBBreakpointCreatedEvent breakpoints first. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
785 |
aGDBBreakpointCreatedEvent breakpoints size > 1 ifTrue:[ |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
786 |
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
|
787 |
]. |
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
788 |
breakpoint setDebugger: self. |
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
789 |
breakpoints add: breakpoint. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
790 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
791 |
"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
|
792 |
"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
|
793 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
794 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
795 |
onBreakpointDeletedEvent: aGDBBreakpointDeletedEvent |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
796 |
| breakpoint | |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
797 |
|
120
73877848ea7f
Added support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
119
diff
changeset
|
798 |
breakpoint := self breakpointForId: aGDBBreakpointDeletedEvent id. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
799 |
breakpoint setDebugger: nil. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
800 |
breakpoints remove: breakpoint. |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
801 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
802 |
"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
|
803 |
"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
|
804 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
805 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
806 |
onBreakpointModifiedEvent: aGDBBreakpointModifiedEvent |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
807 |
aGDBBreakpointModifiedEvent breakpoints do:[:new | |
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
808 |
| old | |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
809 |
|
175
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
810 |
old := self breakpointForId: new number ifAbsent:[ nil ]. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
811 |
old notNil ifTrue:[ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
812 |
old updateFrom: new. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
813 |
] ifFalse:[ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
814 |
"/ Care for breakpoints with multiple locations. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
815 |
"/ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
816 |
"/.If the breakpoint has been created as pending breakpoint |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
817 |
"/ it is unknown whether it is a multi-location breakpoint or not |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
818 |
"/ so it has no locations. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
819 |
"/ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
820 |
"/ If, once the object is loaded abd breakpoint can be installed, |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
821 |
"/ it turns out there are multiple locations, we get an an |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
822 |
"/ =breakpoint-modified event listing all locations. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
823 |
"/ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
824 |
"/ Therefore, we have to update existing breakpoint and add |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
825 |
"/ locations. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
826 |
|
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
827 |
| dot | |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
828 |
|
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
829 |
"/ First, check if it is a 'location': |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
830 |
dot := new number indexOf: $.. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
831 |
dot ~~ 0 ifTrue:[ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
832 |
| bpt | |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
833 |
|
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
834 |
bpt := self breakpointForId: (new number copyTo: dot - 1). |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
835 |
"/ See GDBBreakpoint >> locations... |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
836 |
(bpt locations includes: bpt) ifTrue:[ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
837 |
bpt locations: (Array with: new) |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
838 |
] ifFalse:[ |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
839 |
bpt locations: (bpt locations copyWith: new) |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
840 |
]. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
841 |
]. |
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
842 |
]. |
89
ba62d486014f
Initial support for breakpoints with multiple locations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
843 |
]. |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
844 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
845 |
"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
|
846 |
"Modified: / 15-01-2018 / 23:11:52 / jv" |
175
a04e1a36e888
Fix for multi-location breakpoints created initially as pending
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
174
diff
changeset
|
847 |
"Modified: / 07-02-2019 / 15:14:58 / 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
|
848 |
! |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
849 |
|
114
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
850 |
onCmdParamChangedEvent: aGDBCmdParamChangedEvent |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
851 |
(aGDBCmdParamChangedEvent name = 'directories') ifTrue:[ |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
852 |
directories := nil. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
853 |
]. |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
854 |
|
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
855 |
"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
|
856 |
! |
be5bdaecb9b3
API: added methods for querying source directories
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
113
diff
changeset
|
857 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
858 |
onCommandEvent:aGDBCommandEvent |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
859 |
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
|
860 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
861 |
"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
|
862 |
"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
|
863 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
864 |
|
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
865 |
onCommandResultEvent:aGDBCommandResultEvent |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
866 |
| result | |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
867 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
868 |
result := aGDBCommandResultEvent result. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
869 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
870 |
"/ For some reason, -gdb-set MI command does not cause |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
871 |
"/ =cmd-param-changed notification. To make this transparent |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
872 |
"/ for users, catch successful -gdb-set here and send |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
873 |
"/ GDBCmdParamChangedEvent manually. Sigh, what a hack!! |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
874 |
(result isDone |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
875 |
and:[ result command notNil |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
876 |
and:[ result command isMICommand |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
877 |
and:[ result command operation = 'gdb-set' ]]]) ifTrue:[ |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
878 |
| event | |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
879 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
880 |
event := GDBCmdParamChangedEvent name: result command arguments first value: result command arguments second. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
881 |
connection pushEvent: event. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
882 |
]. |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
883 |
|
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
884 |
"Created: / 19-01-2019 / 22:35:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
885 |
"Modified: / 21-01-2019 / 17:53:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
886 |
! |
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
887 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
888 |
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
|
889 |
self release. |
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
890 |
|
7f4882e2562a
More work on basic example. GDB exiting not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7
diff
changeset
|
891 |
"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
|
892 |
"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
|
893 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
894 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
895 |
onRunningEvent: aGDBRunningEvent |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
896 |
| threads threadId | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
897 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
898 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
899 |
threadId := aGDBRunningEvent threadId. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
900 |
threadId = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
901 |
threadId := threadId asInteger. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
902 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
903 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
904 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
905 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
906 |
(threadId isString or:[thread id = threadId]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
907 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
908 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
909 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
910 |
]. |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
911 |
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
|
912 |
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
|
913 |
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
|
914 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
915 |
|
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
916 |
"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
|
917 |
"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
|
918 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
919 |
|
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
920 |
onStoppedEvent: aGDBStoppedEvent |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
921 |
| threads threadIds | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
922 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
923 |
self nextInferiorStateSequnceNumber. |
38
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
924 |
threadIds := aGDBStoppedEvent stoppedThreadIds. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
925 |
threadIds = 'all' ifFalse:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
926 |
threadIds := threadIds collect:[:e | e asInteger ]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
927 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
928 |
threads := Set new. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
929 |
inferiors do:[:inferior | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
930 |
inferior threads do:[:thread | |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
931 |
(threadIds isString or:[threadIds includes: thread id]) ifTrue:[ |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
932 |
threads add: thread. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
933 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
934 |
]. |
c9eaa506824b
More work on GDBThreadStatus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
37
diff
changeset
|
935 |
]. |
86
7f53d51a0a65
Cache thread status and update it on `=stopped` and `=running` events
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
936 |
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
|
937 |
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
|
938 |
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
|
939 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
940 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
941 |
"/ Initialize target features properly |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
942 |
targetFeatures isNil ifTrue:[ |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
943 |
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
|
944 |
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
|
945 |
]. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
946 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
947 |
"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
|
948 |
"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
|
949 |
! |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
950 |
|
172
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
951 |
onTargetConnectedEvent: aGDBTargetConnectedEvent |
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
952 |
targetFeatures := aGDBTargetConnectedEvent features |
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
953 |
|
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
954 |
"Created: / 22-01-2019 / 13:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
955 |
! |
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
956 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
957 |
onThreadCreatedEvent:aGDBThreadCreatedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
958 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
959 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
960 |
inferior := self inferiorForId:aGDBThreadCreatedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
961 |
inferior onThreadCreatedEvent:aGDBThreadCreatedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
962 |
|
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
963 |
"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
|
964 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
965 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
966 |
onThreadExitedEvent:aGDBThreadExitedEvent |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
967 |
| inferior | |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
968 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
969 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
970 |
inferior := self inferiorForId:aGDBThreadExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
971 |
inferior onThreadExitedEvent:aGDBThreadExitedEvent. |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
972 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
973 |
"/ reset target features |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
974 |
targetFeatures := nil. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
975 |
|
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
976 |
"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
|
977 |
"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
|
978 |
! |
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
979 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
980 |
onThreadGroupAddedEvent:aGDBThreadGroupAddedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
981 |
| inferior | |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
982 |
|
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
983 |
inferiors isNil ifTrue:[ |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
984 |
inferiors := List new. |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
985 |
]. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
986 |
inferior := GDBThreadGroup newWithDebugger:self |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
987 |
id:aGDBThreadGroupAddedEvent threadGroupId. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
988 |
inferiors add:inferior. |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
989 |
aGDBThreadGroupAddedEvent setThreadGroup:inferior. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
990 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
991 |
"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
|
992 |
"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
|
993 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
994 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
995 |
onThreadGroupExitedEvent:aGDBThreadGroupExitedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
996 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
997 |
|
72
eb4eea3ebf4c
Increate sequence number also when thread or thread group is stopped
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
998 |
self nextInferiorStateSequnceNumber. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
999 |
inferior := self inferiorForId:aGDBThreadGroupExitedEvent threadGroupId. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1000 |
inferior setExitCode:aGDBThreadGroupExitedEvent exitCode. |
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1001 |
aGDBThreadGroupExitedEvent setThreadGroup:inferior |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
1002 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
1003 |
"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
|
1004 |
"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
|
1005 |
! |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
1006 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1007 |
onThreadGroupStartedEvent:aGDBThreadGroupStartedEvent |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
1008 |
| inferior | |
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
1009 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1010 |
inferior := self inferiorForId:aGDBThreadGroupStartedEvent threadGroupId. |
144
342b6dfe3a6f
Add model for machine registers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
129
diff
changeset
|
1011 |
inferior reset. |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1012 |
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
|
1013 |
aGDBThreadGroupStartedEvent setThreadGroup:inferior. |
35
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
1014 |
|
c17ecf90e446
Initial support for thread groups, threads and breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
1015 |
"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
|
1016 |
"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
|
1017 |
"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
|
1018 |
! |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1019 |
|
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1020 |
onThreadSelectedEvent: aGDBThreadSelectedEvent |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1021 |
| inferior | |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1022 |
|
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1023 |
inferior := self selectedInferior. |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1024 |
inferior onThreadSelectedEvent:aGDBThreadSelectedEvent. |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1025 |
|
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1026 |
"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
|
1027 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1028 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
1029 |
!GDBDebugger methodsFor:'finalization'! |
0 | 1030 |
|
1031 |
finalize |
|
1032 |
self release. |
|
1033 |
||
1034 |
"Created: / 26-05-2014 / 21:23:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1035 |
! ! |
|
1036 |
||
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
1037 |
!GDBDebugger methodsFor:'initialize & release'! |
0 | 1038 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1039 |
initializeWithProcess: aGDBProcess |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1040 |
| result | |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1041 |
|
1 | 1042 |
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
|
1043 |
|
d573a3b2abe2
Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
1044 |
finalizationRegistry := Registry new. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1045 |
connection := GDBConnection newWithProcess: aGDBProcess. |
0 | 1046 |
|
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1047 |
commandSequenceNumber := 0. |
19 | 1048 |
inferiorStateSequenceNumber := 0. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1049 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1050 |
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
|
1051 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1052 |
connection eventPumpStart. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1053 |
connection eventDispatchStart. |
25
58e042a191a9
More work on GDB session recorder.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
1054 |
Delay waitForMilliseconds:100. |
7
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1055 |
|
95
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
1056 |
connection inferiorPTY notNil ifTrue:[ |
f417138e9c48
Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
1057 |
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
|
1058 |
]. |
174
18ef81a3fee5
Add `GDBCLICommand >> #operation` returning (expanded) CLI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
172
diff
changeset
|
1059 |
self send: (GDBMI_gdb_set arguments: #('mi-async' 'on')). |
11
474fbb650afe
PTY support refactored to use GDBPTY object.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10
diff
changeset
|
1060 |
|
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1061 |
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
|
1062 |
debuggerFeatures := result propertyAt: #features. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1063 |
targetFeatures := nil. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1064 |
|
82
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1065 |
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
|
1066 |
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
|
1067 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1068 |
"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
|
1069 |
"Modified: / 26-03-2018 / 21:36:31 / jv" |
174
18ef81a3fee5
Add `GDBCLICommand >> #operation` returning (expanded) CLI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
172
diff
changeset
|
1070 |
"Modified: / 28-01-2019 / 15:45:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 1071 |
! |
1072 |
||
1073 |
release |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1074 |
connection notNil ifTrue:[ |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1075 |
self unsubscribe. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1076 |
connection release. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1077 |
connection := nil. |
0 | 1078 |
]. |
1079 |
||
1080 |
"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
|
1081 |
"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
|
1082 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1083 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1084 |
subscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1085 |
connection eventAnnouncerInternal |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1086 |
when: GDBCommandEvent send: #onCommandEvent: to: self; |
169
a3d1f59e3bfd
API: add `GDBDebugger >> getParameter:` and `setParameter:to:`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
166
diff
changeset
|
1087 |
when: GDBCommandResultEvent send: #onCommandResultEvent: to: self; |
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1088 |
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
|
1089 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1090 |
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
|
1091 |
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
|
1092 |
when: GDBThreadGroupExitedEvent send: #onThreadGroupExitedEvent: to: self; |
36
095c4b0b74d3
Added support for threads.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
35
diff
changeset
|
1093 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1094 |
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
|
1095 |
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
|
1096 |
|
129
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1097 |
when: GDBThreadSelectedEvent send: #onThreadSelectedEvent: to: self; |
661e16236c67
Set `GDBThreadSelectedEvent`'s thread and frame
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
128
diff
changeset
|
1098 |
|
37
a85f0c91f164
Some more work on threads (thread status)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
1099 |
when: GDBRunningEvent send: #onRunningEvent: to: self; |
87
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1100 |
when: GDBStoppedEvent send: #onStoppedEvent: to: self; |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1101 |
|
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1102 |
when: GDBBreakpointCreatedEvent send: #onBreakpointCreatedEvent: to: self; |
50e80d25ea6f
Added initial support for breakppints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
86
diff
changeset
|
1103 |
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
|
1104 |
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
|
1105 |
|
172
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
1106 |
when: GDBCmdParamChangedEvent send: #onCmdParamChangedEvent: to: self; |
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
1107 |
|
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
1108 |
when: GDBTargetConnectedEvent send: #onTargetConnectedEvent: to: self. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1109 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1110 |
"Created: / 20-06-2014 / 22:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
172
836209352efb
Update target features from `=target-connected event`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
1111 |
"Modified: / 22-01-2019 / 13:36:38 / 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
|
1112 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1113 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1114 |
unsubscribe |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1115 |
connection eventAnnouncerInternal unsubscribe: self |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1116 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1117 |
"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
|
1118 |
! ! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1119 |
|
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
|
1120 |
!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
|
1121 |
|
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1122 |
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
|
1123 |
<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
|
1124 |
^ (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
|
1125 |
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
|
1126 |
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
|
1127 |
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
|
1128 |
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
|
1129 |
|
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1130 |
"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
|
1131 |
! ! |
c4f07d0e7b7a
GNI/MI: added custom inspector view for viewing GDB/MI comminicatication trace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
1132 |
|
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1133 |
!GDBDebugger methodsFor:'queries'! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1134 |
|
165
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1135 |
hasCommand: aClassOrString |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1136 |
"Return `true`, if this debugger support given MI command, false otherwise. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1137 |
|
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1138 |
`aClassOrString can be either a MI command class (a subclass of GDBMICommand |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1139 |
or MI command string (inclusding starting dash). |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1140 |
|
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1141 |
Note, that this can only query MI commands, queries for CLI command support |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1142 |
are not supported (limitation of GDB itself). |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1143 |
" |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1144 |
| commandString | |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1145 |
|
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1146 |
supportedCommands isNil ifTrue:[ supportedCommands := Dictionary new ]. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1147 |
aClassOrString isClass ifTrue:[ |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1148 |
self assert: (aClassOrString inheritsFrom: GDBMICommand). |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1149 |
commandString := aClassOrString new operation. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1150 |
] ifFalse:[ |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1151 |
commandString := aClassOrString. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1152 |
]. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1153 |
^ supportedCommands at: commandString ifAbsentPut:[ |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1154 |
| result exists | |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1155 |
|
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1156 |
result := self send: (GDBMI_info_gdb_mi_command arguments: (Array with: commandString)) andWait: true. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1157 |
exists := ((result propertyAt: #command) at: #exists) = 'true'. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1158 |
exists |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1159 |
]. |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1160 |
|
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1161 |
" |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1162 |
GDBDebugger new hasCommand: |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1163 |
" |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1164 |
|
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1165 |
"Created: / 29-12-2018 / 23:10:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1166 |
! |
780e1f6168c5
Add new API `GDBDebugger >> #hasCommand:` to test support for particular MI command
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
1167 |
|
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1168 |
hasFeature: feature |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1169 |
"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
|
1170 |
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
|
1171 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1172 |
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
|
1173 |
" |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1174 |
^ 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
|
1175 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1176 |
"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
|
1177 |
"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
|
1178 |
! |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1179 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1180 |
hasFeatureAsync |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1181 |
"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
|
1182 |
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
|
1183 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1184 |
targetFeatures notNil ifTrue:[ |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1185 |
^ targetFeatures includes: 'async' |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1186 |
] ifFalse:[ |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1187 |
^ connection nativeTargetFeatures includes: 'async'. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1188 |
]. |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1189 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
1190 |
"Created: / 09-04-2018 / 15:45:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
170
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1191 |
! |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1192 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1193 |
hasPendingCommands |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1194 |
"Return `true` if there are commands being sent but not yet |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1195 |
processed, `false` otherwise. By 'processed' we mean that |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1196 |
command result event not yet arrived or is waiting in a queue |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1197 |
to be dispatched. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1198 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1199 |
Note that by the nature of event queues and threads, |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1200 |
return value may be obsolete by the time client uses |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1201 |
it. Use with caution!! |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1202 |
" |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1203 |
^ connection hasPendingCommands |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1204 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1205 |
"Created: / 23-01-2019 / 20:41:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1206 |
! |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1207 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1208 |
hasPendingEvents |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1209 |
"Return `true` if there are events in a queue wating |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1210 |
to be dispatched, `false` otherwise. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1211 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1212 |
Note that by the nature of event queues and threads, |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1213 |
return value may be obsolete by the time client uses |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1214 |
it. Use with caution!! |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1215 |
" |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1216 |
^ connection hasPendingEvents |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1217 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1218 |
"Created: / 23-01-2019 / 20:38:23 / 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
|
1219 |
! ! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1220 |
|
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1221 |
!GDBDebugger methodsFor:'testing'! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1222 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1223 |
isConnected |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1224 |
^ connection notNil |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1225 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
21
diff
changeset
|
1226 |
"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
|
1227 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1228 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1229 |
isFrameFiltersEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1230 |
^ frameFiltersEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1231 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1232 |
"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
|
1233 |
! |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1234 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1235 |
isPrettyPrintingEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1236 |
^ prettyPrintingEnabled |
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1237 |
|
7ee72b7a498f
Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
80
diff
changeset
|
1238 |
"Created: / 12-06-2017 / 09:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 1239 |
! ! |
1240 |
||
111
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1241 |
!GDBDebugger methodsFor:'utilities'! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1242 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1243 |
ensureFeature: feature |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1244 |
"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
|
1245 |
throw an error" |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1246 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1247 |
(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
|
1248 |
GDBUnsupportedFeatureError newException |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1249 |
parameter: self -> feature; |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1250 |
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
|
1251 |
raise. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1252 |
]. |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1253 |
|
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1254 |
"Created: / 07-02-2018 / 11:34:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
170
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1255 |
! |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1256 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1257 |
waitUntilAlCommandsProcessed |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1258 |
"BLock caller until all commands are processed. This method is provided |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1259 |
mainly for use in tests or synchronization. Normal code should avoid |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1260 |
using this. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1261 |
" |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1262 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1263 |
self |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1264 |
assert:Processor activeProcess ~~ connection eventDispatchProcess |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1265 |
message:'Cannot wait from within event dispatching process. Would deadlock'. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1266 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1267 |
"/ Since this method is not required to be 100% accurate, polling seems |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1268 |
"/ like an easy and safe approach. It's not meant for normal usage, anyway. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1269 |
[ self hasPendingCommands ] whileTrue:[ Delay waitForMilliseconds: 100 ]. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1270 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1271 |
"Created: / 23-01-2019 / 21:03:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1272 |
! |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1273 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1274 |
waitUntilAllEventsProcessed |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1275 |
"BLock caller until all events are processed. This method is provided |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1276 |
mainly for use in tests or synchronization. Normal code should avoid |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1277 |
using this. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1278 |
" |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1279 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1280 |
self |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1281 |
assert:Processor activeProcess ~~ connection eventDispatchProcess |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1282 |
message:'Cannot wait from within event dispatching process. Would deadlock'. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1283 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1284 |
"/ Since this method is not required to be 100% accurate, polling seems |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1285 |
"/ like an easy and safe approach. It's not meant for normal usage, anyway. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1286 |
[ self hasPendingEvents ] whileTrue:[ Delay waitForMilliseconds: 100 ]. |
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1287 |
|
6cf990ac2cad
Add `GDBDebugger >> #waitForAllEventsProcessed` and `#waitForAllCommandsProcessed`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
1288 |
"Created: / 23-01-2019 / 21:03:36 / 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
|
1289 |
! ! |
7ce18f6f18ac
API: added methods for querying debugger and target features
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
109
diff
changeset
|
1290 |
|
21
83395ca8b257
Renamed GDB to GDBDebugger
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
1291 |
!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
|
1292 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1293 |
version_HG |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1294 |
|
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1295 |
^ '$Changeset: <not expanded> $' |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1296 |
! ! |
7a51f98e7162
Initial implementation of event dispatcher and event pump.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1297 |