VDBInstructionPresenter.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 Mar 2019 13:54:14 +0000
changeset 148 7d2d523173af
parent 146 c037aa4ce54f
child 220 ae5ddc0ea07b
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.

"
jv:vdb - Visual / VM Debugger
Copyright (C) 2015-now Jan Vrany

This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'

You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
"
"{ Package: 'jv:vdb' }"

"{ NameSpace: Smalltalk }"

VDBAbstractPresenter subclass:#VDBInstructionPresenter
	instanceVariableNames:'instruction basicBlock'
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-Presentation'
!

!VDBInstructionPresenter class methodsFor:'documentation'!

copyright
"
jv:vdb - Visual / VM Debugger
Copyright (C) 2015-now Jan Vrany

This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'

You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
"
! !

!VDBInstructionPresenter methodsFor:'accessing'!

address
    ^instruction address

    "Created: / 26-06-2018 / 12:42:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

basicBlock
    ^ basicBlock
!

instruction
    ^ instruction
!

subject
    "Return an instance of GDB object that this presenter displays."

    ^ instruction

    "Created: / 22-06-2018 / 15:10:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBInstructionPresenter methodsFor:'initialization'!

setBasicBlock: aVDBBasicBLock
    basicBlock := aVDBBasicBLock

    "Created: / 26-06-2018 / 12:37:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

setInstruction: aGDBInstruction
    instruction := aGDBInstruction

    "Created: / 22-06-2018 / 12:19:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBInstructionPresenter methodsFor:'protocol-accessing'!

label
    ^String streamContents:[ :s |
        (parent notNil and:[ parent askFor: #isInstructionsAndSourcePresenter ]) ifTrue:[
            s next: parent lineDigitsToDisplay put: Character space.   
        ].
        instruction address printOn: s base: 16 size: 16 fill: $0.
        s space.
        s nextPutAll: instruction assembly withTabsExpanded
    ]

    "Created: / 22-06-2018 / 12:21:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 30-01-2019 / 11:33:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBInstructionPresenter methodsFor:'testing'!

isInstructionPresenter
    ^ true
! !

!VDBInstructionPresenter class methodsFor:'documentation'!

version_HG

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