VDBAbstractConsoleApplication.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 29 Jul 2022 16:12:54 +0100
changeset 266 e21d777d076e
parent 264 23960fcb9dac
permissions -rw-r--r--
Fix `VDBInstructionListApplication` to analyze blocks for standalone instruction list ...that is, for instructions without any "disassemblable" (function, address range). This is used in some inspector goodies on Compiler's code buffer.

"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2021-2022 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
"{ Package: 'jv:vdb' }"

"{ NameSpace: Smalltalk }"

VDBAbstractApplication subclass:#VDBAbstractConsoleApplication
	instanceVariableNames:'consoleView'
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-UI-Abstract'
!

!VDBAbstractConsoleApplication class methodsFor:'documentation'!

copyright
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2021-2022 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
! !

!VDBAbstractConsoleApplication class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:VDBAbstractConsoleApplication andSelector:#windowSpec
     VDBAbstractConsoleApplication new openInterface:#windowSpec
     VDBAbstractConsoleApplication open
    "

    <resource: #canvas>

    ^ 
    #(FullSpec
       name: windowSpec
       window: 
      (WindowSpec
         label: 'Console'
         name: 'Console'
         min: (Point 10 10)
         bounds: (Rectangle 0 0 782 332)
       )
       component: 
      (SpecCollection
         collection: (
          (ArbitraryComponentSpec
             name: 'Console'
             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
             hasHorizontalScrollBar: true
             hasVerticalScrollBar: true
             miniScrollerHorizontal: true
             autoHideScrollBars: false
             hasBorder: false
             component: consoleView
           )
          )
        
       )
     )
! !

!VDBAbstractConsoleApplication class methodsFor:'plugIn spec'!

aspectSelectors
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this. If it is corrupted,
     the UIPainter may not be able to read the specification."

    "Return a description of exported aspects;
     these can be connected to aspects of an embedding application
     (if this app is embedded in a subCanvas)."

    ^ #(
        #debuggerHolder
      ).

! !

!VDBAbstractConsoleApplication class methodsFor:'queries'!

isAbstract
    "Return if this class is an abstract class.
     True is returned here for myself only; false for subclasses.
     Abstract subclasses must redefine this again."

    ^ self == VDBAbstractConsoleApplication.
! !

!VDBAbstractConsoleApplication methodsFor:'aspects'!

consoleView
    consoleView isNil ifTrue:[ 
        consoleView := self consoleViewClass new.
        self initializeConsoleView: consoleView.
    ].
    ^ consoleView.

    "Created: / 21-01-2019 / 14:09:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

consoleViewClass
    ^ self subclassResponsibility

    "Created: / 21-01-2019 / 14:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBAbstractConsoleApplication methodsFor:'initialization & release'!

initializeConsoleView: aTerminalView
     aTerminalView font: self textFont;
                cursorType: #block;  
                foregroundColor: Color white
                backgroundColor: Color black;
                cursorForegroundColor: Color white
                      backgroundColor: Color white.        
     self initializeConsoleView: aTerminalView forDebugger: debugger.

    "Created: / 21-01-2019 / 14:11:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-01-2019 / 15:31:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

initializeConsoleView: aTerminalView forDebugger: aGDBDebugger
    "/ Nothing to do by default

    "Created: / 21-01-2019 / 15:30:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 25-01-2019 / 12:05:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

subscribe   
    super subscribe.

    consoleView notNil ifTrue:[
        self initializeConsoleView: consoleView forDebugger: debugger
    ].

    "Created: / 10-06-2014 / 21:02:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-01-2019 / 15:31:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (comment): / 18-11-2021 / 16:24:21 / Jan Vrany <jan.vrany@labware.com>"
!

unsubscribe
    "Unsubscribe myself fo debugger events"

    super unsubscribe.
    consoleView notNil ifTrue:[ 
        self initializeConsoleView: consoleView forDebugger: nil 
    ].

    "Created: / 09-06-2014 / 10:09:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-01-2019 / 15:32:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBAbstractConsoleApplication class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !