author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 12 Dec 2018 16:32:44 +0000 | |
changeset 163 | f882d9048b54 |
parent 155 | 773093e3c3b4 |
child 164 | a16705f64a64 |
permissions | -rw-r--r-- |
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
1 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
2 |
jv:libgdbs - GNU Debugger Interface Library |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
3 |
Copyright (C) 2015-now Jan Vrany |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
4 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
5 |
This library is free software; you can redistribute it and/or |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
6 |
modify it under the terms of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
7 |
License as published by the Free Software Foundation; either |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
8 |
version 2.1 of the License. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
9 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
10 |
This library is distributed in the hope that it will be useful, |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
13 |
Lesser General Public License for more details. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
14 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
15 |
You should have received a copy of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
16 |
License along with this library; if not, write to the Free Software |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
18 |
" |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
"{ Package: 'jv:libgdbs' }" |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
|
58
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
21 |
"{ NameSpace: Smalltalk }" |
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
22 |
|
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
23 |
GDBLocalProcess subclass:#GDBStXUnixProcess |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
24 |
instanceVariableNames:'debuggerPTY consolePTY' |
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
25 |
classVariableNames:'' |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
poolDictionaries:'' |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
category:'GDB-Private' |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
|
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
30 |
!GDBStXUnixProcess class methodsFor:'documentation'! |
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
31 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
32 |
copyright |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
33 |
" |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
34 |
jv:libgdbs - GNU Debugger Interface Library |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
35 |
Copyright (C) 2015-now Jan Vrany |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
36 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
37 |
This library is free software; you can redistribute it and/or |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
38 |
modify it under the terms of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
39 |
License as published by the Free Software Foundation; either |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
40 |
version 2.1 of the License. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
41 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
42 |
This library is distributed in the hope that it will be useful, |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
43 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
44 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
45 |
Lesser General Public License for more details. |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
46 |
|
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
47 |
You should have received a copy of the GNU Lesser General Public |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
48 |
License along with this library; if not, write to the Free Software |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
49 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
50 |
" |
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
51 |
! |
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
52 |
|
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
53 |
documentation |
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
54 |
" |
163
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
55 |
GDBStXUnixProcess is a Smalltalk/X specific implementation of GDB process |
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
56 |
that uses two PTYs to communicate with GDB - one for MI channel, another |
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
57 |
for CLI channel. In this case, the CLI interface is driven by GDB itself |
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
58 |
(as opposite to be emulated as in case of GDBStXSimpleProcess). |
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
59 |
|
163
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
60 |
On UNIX platforms running GDB locally, this is preferred implementation |
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
61 |
to use. |
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
62 |
|
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
63 |
[author:] |
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
64 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
65 |
|
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
66 |
[instance variables:] |
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
67 |
|
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
68 |
[class variables:] |
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
69 |
|
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
70 |
[see also:] |
163
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
71 |
GDBRemoteProcess |
f882d9048b54
Renamed `GDBStXWindowsProcess` to `GDBStXSimpleProcess`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
155
diff
changeset
|
72 |
GDBStXSimpleProcess |
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
73 |
|
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
74 |
" |
91
472a4841a8b6
License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
90
diff
changeset
|
75 |
! ! |
58
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
76 |
|
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
77 |
!GDBStXUnixProcess methodsFor:'accessing'! |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
78 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
79 |
consoleInput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
80 |
^ consolePTY master |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
81 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
82 |
"Created: / 02-06-2017 / 23:36:24 / 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
|
83 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
84 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
85 |
consoleOutput |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
86 |
^ consolePTY master |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
87 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
88 |
"Created: / 02-06-2017 / 23:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
116
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
89 |
! |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
90 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
91 |
nativeTargetFeatures |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
92 |
^ #('async') |
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
93 |
|
ffd185f7a357
Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
94 |
"Created: / 09-04-2018 / 15:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
95 |
! ! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
96 |
|
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
97 |
!GDBStXUnixProcess methodsFor:'initialization & release'! |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
98 |
|
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
99 |
initialize |
149
0db2ccc6da7b
Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
100 |
| exe conpty dbgpty args | |
0db2ccc6da7b
Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
101 |
|
0db2ccc6da7b
Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
102 |
exe := self class gdbExecutable. |
0db2ccc6da7b
Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
103 |
(exe isNil or:[ exe asFilename isExecutable not ]) ifTrue:[ |
153
dd55019f1d86
Partability: use ANSI `#signal:` to raise an exception
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
104 |
GDBError signal: 'Could not find gdb, please set path to gdb using GDBProcess class >> gdbExecutable:'. |
149
0db2ccc6da7b
Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
105 |
^ self. |
0db2ccc6da7b
Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
106 |
]. |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
107 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
108 |
conpty := GDBPTY new. |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
109 |
dbgpty := GDBPTY new. |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
110 |
dbgpty setLocalEcho: false. |
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
111 |
dbgpty setOutputCRLF: false. |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
112 |
|
134
3abcf54431c1
Do not show GDB version on command console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
116
diff
changeset
|
113 |
args := (Array new: 6) |
149
0db2ccc6da7b
Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
114 |
at: 1 put: exe; |
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
115 |
at: 2 put: '-q'; |
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
116 |
at: 3 put: '-ex'; |
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
117 |
at: 4 put: 'new-ui mi ', dbgpty name; |
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
118 |
at: 5 put: '-ex'; |
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
119 |
at: 6 put: 'set pagination off'; |
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
120 |
yourself. |
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
121 |
Processor |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
122 |
monitor:[ |
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
123 |
pid := OperatingSystem |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
124 |
exec:args first |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
125 |
withArguments:args |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
126 |
environment:OperatingSystem getEnvironment |
155
773093e3c3b4
Portability: do not use Squeak computed arrays
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
127 |
fileDescriptors: (Array |
773093e3c3b4
Portability: do not use Squeak computed arrays
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
128 |
with: conpty slave fileDescriptor |
773093e3c3b4
Portability: do not use Squeak computed arrays
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
129 |
with: conpty slave fileDescriptor |
773093e3c3b4
Portability: do not use Squeak computed arrays
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
130 |
with: conpty slave fileDescriptor) |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
131 |
fork:true |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
132 |
newPgrp:false |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
133 |
inDirectory:Filename currentDirectory |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
134 |
showWindow: false. |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
135 |
consolePTY := conpty. |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
136 |
debuggerPTY := dbgpty. |
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
137 |
debuggerInput := debuggerOutput := debuggerPTY master. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
138 |
pid. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
139 |
] |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
140 |
action:[:stat | self exited:stat ]. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
141 |
pid isNil ifTrue:[ |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
142 |
conpty close. |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
143 |
dbgpty close. |
23
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
144 |
self error:'Failed to launch gdb'. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
145 |
]. |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
146 |
|
155
773093e3c3b4
Portability: do not use Squeak computed arrays
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
147 |
"Modified: / 29-10-2018 / 12:58:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
148 |
! |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
149 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
150 |
release |
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
151 |
debuggerPTY notNil ifTrue:[ |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
152 |
debuggerPTY release. |
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
153 |
debuggerInput := debuggerOutput := nil |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
154 |
]. |
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
155 |
consolePTY notNil ifTrue:[ |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
156 |
consolePTY release. |
90
6046abc9ddf4
Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
79
diff
changeset
|
157 |
]. |
79
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
158 |
super release |
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
159 |
|
303c4edc75ad
`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
78
diff
changeset
|
160 |
"Created: / 02-06-2017 / 23:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
93
b1715ebf8df1
Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
91
diff
changeset
|
161 |
"Modified: / 15-12-2017 / 23:59:56 / 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:
diff
changeset
|
162 |
! ! |
a7eb888c81b5
Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
163 |
|
152
fab425b52c21
Refactor `GDBProcess` hierarchy to improve portability
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
149
diff
changeset
|
164 |
!GDBStXUnixProcess class methodsFor:'documentation'! |
58
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
165 |
|
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
166 |
version_HG |
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
167 |
|
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
168 |
^ '$Changeset: <not expanded> $' |
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
169 |
! ! |
531c7f5d6558
Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
25
diff
changeset
|
170 |