GDBUnixProcess.st
changeset 93 b1715ebf8df1
parent 91 472a4841a8b6
child 116 ffd185f7a357
equal deleted inserted replaced
92:0f11fece852c 93:b1715ebf8df1
    20 
    20 
    21 "{ NameSpace: Smalltalk }"
    21 "{ NameSpace: Smalltalk }"
    22 
    22 
    23 GDBProcess subclass:#GDBUnixProcess
    23 GDBProcess subclass:#GDBUnixProcess
    24 	instanceVariableNames:'debuggerPTY consolePTY'
    24 	instanceVariableNames:'debuggerPTY consolePTY'
    25 	classVariableNames:'GDBExecutable'
    25 	classVariableNames:''
    26 	poolDictionaries:''
    26 	poolDictionaries:''
    27 	category:'GDB-Private'
    27 	category:'GDB-Private'
    28 !
    28 !
    29 
    29 
    30 !GDBUnixProcess class methodsFor:'documentation'!
    30 !GDBUnixProcess class methodsFor:'documentation'!
    48 License along with this library; if not, write to the Free Software
    48 License along with this library; if not, write to the Free Software
    49 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    49 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    50 "
    50 "
    51 ! !
    51 ! !
    52 
    52 
    53 !GDBUnixProcess class methodsFor:'accessing'!
       
    54 
       
    55 gdbExecutable
       
    56     ^ GDBExecutable
       
    57 
       
    58     "Created: / 01-03-2015 / 08:07:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    59 !
       
    60 
       
    61 gdbExecutable: aString
       
    62     GDBExecutable := aString
       
    63 
       
    64     "Created: / 01-03-2015 / 08:07:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    65 ! !
       
    66 
       
    67 !GDBUnixProcess methodsFor:'accessing'!
    53 !GDBUnixProcess methodsFor:'accessing'!
    68 
    54 
    69 consoleInput
    55 consoleInput
    70     ^ consolePTY master
    56     ^ consolePTY master
    71 
    57 
    74 
    60 
    75 consoleOutput
    61 consoleOutput
    76     ^ consolePTY master
    62     ^ consolePTY master
    77 
    63 
    78     "Created: / 02-06-2017 / 23:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    64     "Created: / 02-06-2017 / 23:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    79 !
       
    80 
       
    81 debuggerInput
       
    82     ^ debuggerPTY master
       
    83 
       
    84     "Modified: / 26-05-2017 / 11:33:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    85 !
       
    86 
       
    87 debuggerOutput
       
    88     ^ debuggerPTY master
       
    89 
       
    90     "Modified: / 26-05-2017 / 11:34:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    91 ! !
    65 ! !
    92 
    66 
    93 !GDBUnixProcess methodsFor:'initialization & release'!
    67 !GDBUnixProcess methodsFor:'initialization & release'!
    94 
    68 
    95 initialize
    69 initialize
   126                     newPgrp:false
   100                     newPgrp:false
   127                     inDirectory:Filename currentDirectory
   101                     inDirectory:Filename currentDirectory
   128                     showWindow: false.
   102                     showWindow: false.
   129             consolePTY := conpty.
   103             consolePTY := conpty.
   130             debuggerPTY := dbgpty.
   104             debuggerPTY := dbgpty.
       
   105             debuggerInput := debuggerOutput := debuggerPTY master.
   131             pid.
   106             pid.
   132         ]
   107         ]
   133         action:[:stat | self exited:stat ].
   108         action:[:stat | self exited:stat ].
   134     pid isNil ifTrue:[
   109     pid isNil ifTrue:[
   135         conpty close.
   110         conpty close.
   136         dbgpty close.
   111         dbgpty close.
   137         self error:'Failed to launch gdb'.
   112         self error:'Failed to launch gdb'.
   138     ].
   113     ].
   139 
   114 
   140     "Modified: / 17-11-2017 / 20:18:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   115     "Modified: / 16-12-2017 / 22:27:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   141 !
   116 !
   142 
   117 
   143 release
   118 release
   144     debuggerPTY notNil ifTrue:[
   119     debuggerPTY notNil ifTrue:[
   145         debuggerPTY release.
   120         debuggerPTY release.
       
   121         debuggerInput := debuggerOutput := nil
   146     ].
   122     ].
   147     consolePTY notNil ifTrue:[
   123     consolePTY notNil ifTrue:[
   148         consolePTY release.
   124         consolePTY release.
   149     ].
   125     ].
   150     super release
   126     super release
   151 
   127 
   152     "Created: / 02-06-2017 / 23:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   128     "Created: / 02-06-2017 / 23:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   129     "Modified: / 15-12-2017 / 23:59:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   153 ! !
   130 ! !
   154 
   131 
   155 !GDBUnixProcess class methodsFor:'documentation'!
   132 !GDBUnixProcess class methodsFor:'documentation'!
   156 
   133 
   157 version_HG
   134 version_HG