GDBUnixProcess.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 03 Oct 2018 22:23:19 +0100
changeset 149 0db2ccc6da7b
parent 138 5d6ef1b8f539
permissions -rw-r--r--
Refactor configuration and autodetection of gdb executable Namely: * add new preference (`1UserPreferences current gdbExecutable:`) and actually implement `gdbExecutable:` in `UserPreferences` to make the code clearer, * refactor `GDBProcess class >> #gdbExecutable` to look at preferences and if not configured, try to autodecet path to GDB (with some magic for Windows)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
23
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
GDBProcess subclass:#GDBUnixProcess
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
91
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    30
!GDBUnixProcess class methodsFor:'documentation'!
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
"
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    51
! !
58
531c7f5d6558 Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 25
diff changeset
    52
79
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    53
!GDBUnixProcess methodsFor:'accessing'!
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    54
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    55
consoleInput
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    56
    ^ consolePTY master
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    57
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    58
    "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
    59
!
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    60
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    61
consoleOutput
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    62
    ^ consolePTY master
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    63
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    64
    "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
    65
!
ffd185f7a357 Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
    66
ffd185f7a357 Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
    67
nativeTargetFeatures
ffd185f7a357 Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
    68
    ^ #('async')
ffd185f7a357 Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
    69
ffd185f7a357 Fix: initialize debugger features early during initialization
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
    70
    "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
    71
! !
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    72
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    73
!GDBUnixProcess methodsFor:'initialization & release'!
23
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
initialize
149
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    76
    | exe conpty dbgpty args |
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    77
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    78
    exe := self class gdbExecutable.
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    79
    (exe isNil or:[ exe asFilename isExecutable not ]) ifTrue:[ 
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    80
        GDBError raiseErrorString: 'Could not find gdb, please set path to gdb using GDBProcess class >> gdbExecutable:'.
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    81
        ^ self.
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    82
    ].
79
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
    conpty := GDBPTY new.
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    85
    dbgpty := GDBPTY new.
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
    86
    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
    87
    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
    88
134
3abcf54431c1 Do not show GDB version on command console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
    89
    args := (Array new: 6)
149
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    90
                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
    91
                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
    92
                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
    93
                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
    94
                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
    95
                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
    96
                yourself.
6046abc9ddf4 Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 79
diff changeset
    97
    Processor
23
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
        monitor:[
90
6046abc9ddf4 Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 79
diff changeset
    99
            pid := OperatingSystem
23
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
                    exec:args first
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
                    withArguments:args
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
                    environment:OperatingSystem getEnvironment
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
                    fileDescriptors:{
79
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   104
                            conpty slave fileDescriptor.
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   105
                            conpty slave fileDescriptor.
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   106
                            conpty slave fileDescriptor
23
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
                        }
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
                    fork:true
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
                    newPgrp:false
79
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   110
                    inDirectory:Filename currentDirectory
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   111
                    showWindow: false.
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   112
            consolePTY := conpty.
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   113
            debuggerPTY := dbgpty.
93
b1715ebf8df1 Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   114
            debuggerInput := debuggerOutput := debuggerPTY master.
23
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
            pid.
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
        ]
79
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   117
        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
   118
    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
   119
        conpty close.
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   120
        dbgpty close.
23
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
        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
   122
    ].
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
149
0db2ccc6da7b Refactor configuration and autodetection of gdb executable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
   124
    "Modified: / 03-10-2018 / 22:22:09 / 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
   125
!
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   126
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   127
release
90
6046abc9ddf4 Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 79
diff changeset
   128
    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
   129
        debuggerPTY release.
93
b1715ebf8df1 Resurected old `GDBProcess` implementation using pipes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   130
        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
   131
    ].
90
6046abc9ddf4 Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 79
diff changeset
   132
    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
   133
        consolePTY release.
90
6046abc9ddf4 Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 79
diff changeset
   134
    ].
79
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   135
    super release
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   136
303c4edc75ad `GDBProcess` refatored to have console interpreter on STDIN/STDOUT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   137
    "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
   138
    "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
   139
! !
a7eb888c81b5 Introduced GDBProcess - a class encapsulating gdb OS process.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
58
531c7f5d6558 Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 25
diff changeset
   141
!GDBUnixProcess class methodsFor:'documentation'!
531c7f5d6558 Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 25
diff changeset
   142
531c7f5d6558 Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 25
diff changeset
   143
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
   144
531c7f5d6558 Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 25
diff changeset
   145
    ^ '$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
   146
! !
531c7f5d6558 Allow for setting path to GDB executable via classvar in GDBUnixProcess.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 25
diff changeset
   147