VDBAbstractUnixConsoleApplication.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 Mar 2019 13:54:14 +0000
changeset 148 7d2d523173af
parent 143 df7f89efd39d
child 159 c00d27805420
permissions -rw-r--r--
Workaround: assume native target when issuing `run` or `attach` commands using simple console Background command execution is not supported by some targets, most notably by Windows native target. However, at the point we have to decided whether use background execution or not, we don't know which target will get connected and therefore we cannot check target features. So, make a guess and assime we gonna use native target. This is so bad, this *absolutely* has to be fixed somehow.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     1
"
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     2
jv:vdb - Visual / VM Debugger
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     3
Copyright (C) 2015-now Jan Vrany
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     4
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     5
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     6
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     7
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
     8
"
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
"{ Package: 'jv:vdb' }"
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
"{ NameSpace: Smalltalk }"
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    13
VDBAbstractConsoleApplication subclass:#VDBAbstractUnixConsoleApplication
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    14
	instanceVariableNames:''
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
	classVariableNames:''
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
	poolDictionaries:''
51
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    17
	category:'VDB-UI-Console-Unix'
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
!
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
51
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    20
!VDBAbstractUnixConsoleApplication class methodsFor:'documentation'!
49
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    21
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    22
copyright
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    23
"
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    24
jv:vdb - Visual / VM Debugger
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    25
Copyright (C) 2015-now Jan Vrany
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    26
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    27
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    28
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    29
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    30
"
2ec7f7ed9242 License this package under 'Creative Commons Attribution-NonCommercial 4.0 International License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 46
diff changeset
    31
! !
46
6b857f3cec8c Initial support for breakpoints
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 44
diff changeset
    32
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    33
!VDBAbstractUnixConsoleApplication class methodsFor:'accessing - defaults'!
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    35
defaultWindowTitle
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    36
    "Returns default window title for this application. By default,
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    37
     extracts the title from #windowSpec.
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    38
     
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    39
     Subclasses may (must) override this method."
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    40
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    41
    ^ self shouldImplement:'Override #defaultWindowTitle in concrete classes'
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
! !
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    44
!VDBAbstractUnixConsoleApplication class methodsFor:'startup-web applications'!
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    46
initialPageSpec
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    47
    "this is only required for web-applications"
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    49
    ^ self shouldImplement
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    50
!
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    52
pageSpecs
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    53
    "this is only required for web-applications"
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    55
    ^ self shouldImplement
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
! !
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
51
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    58
!VDBAbstractUnixConsoleApplication class methodsFor:'testing'!
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    59
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    60
isAbstract
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    61
    ^ self == VDBAbstractUnixConsoleApplication
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    62
! !
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    63
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    64
!VDBAbstractUnixConsoleApplication methodsFor:'aspects'!
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    66
consoleViewClass
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    67
    ^ VT100TerminalView
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
139
c619cc458fb1 Factored out common console code into (new) `VDBAbstractConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
    69
    "Created: / 21-01-2019 / 14:23:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
40
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
! !
d766d4c854a2 Cleanup in debugger and inferior console applications to catch up changes in `jv:libgdbs`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    72
!VDBAbstractUnixConsoleApplication methodsFor:'initialization & release'!
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    73
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    74
initializeConsoleView: aTerminalView forDebugger: aGDBDebugger
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    75
    aGDBDebugger notNil ifTrue:[
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    76
        aTerminalView inStream: self consoleInput.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    77
        aTerminalView outStream: self consoleOutput. 
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    78
        aTerminalView startReaderProcessWhenVisible.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    79
    ].
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    80
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    81
    "Created: / 25-01-2019 / 12:04:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    82
! !
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 139
diff changeset
    83
51
6c982fc25fe2 Renamed `VDBAbstractConsoleApplication` to `VDBAbstractUnixConsoleApplication`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 49
diff changeset
    84
!VDBAbstractUnixConsoleApplication class methodsFor:'documentation'!
46
6b857f3cec8c Initial support for breakpoints
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 44
diff changeset
    85
6b857f3cec8c Initial support for breakpoints
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 44
diff changeset
    86
version_HG
6b857f3cec8c Initial support for breakpoints
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 44
diff changeset
    87
6b857f3cec8c Initial support for breakpoints
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 44
diff changeset
    88
    ^ '$Changeset: <not expanded> $'
6b857f3cec8c Initial support for breakpoints
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 44
diff changeset
    89
! !
6b857f3cec8c Initial support for breakpoints
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 44
diff changeset
    90