VDBSourceAndDisassemblyApplication.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 26 Jul 2022 15:01:33 +0100
changeset 265 f2470f0dd9cd
parent 264 23960fcb9dac
permissions -rw-r--r--
Do not show address for (pseudo) instructions with no code While such instructions do not appear in GDB-produced disassembly, they may appear in some manually-generated instruction lists. One example of such (pseudo) instruction is label.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
     2
jv:libgdbs - GNU Debugger Interface Library
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
Copyright (C) 2015-now Jan Vrany
193
e6393500a665 Make container "application" a kind of "contents" application
Jan Vrany <jan.vrany@labware.com>
parents: 164
diff changeset
     4
Copyright (C) 2020 LabWare
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
     5
Copyright (C) 2022 LabWare
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
     7
Permission is hereby granted, free of charge, to any person obtaining a copy
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
     8
of this software and associated documentation files (the 'Software'), to deal
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
     9
in the Software without restriction, including without limitation the rights
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    10
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    11
copies of the Software, and to permit persons to whom the Software is
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    12
furnished to do so, subject to the following conditions:
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    14
The above copyright notice and this permission notice shall be included in all
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    15
copies or substantial portions of the Software.
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    16
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    17
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    19
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    20
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    21
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    22
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    23
SOFTWARE.
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
"
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
"{ Package: 'jv:vdb' }"
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
"{ NameSpace: Smalltalk }"
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
VDBTabbingContainer subclass:#VDBSourceAndDisassemblyApplication
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
	instanceVariableNames:'frameHolder'
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
	classVariableNames:''
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
	poolDictionaries:''
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
	category:'VDB-UI-Source'
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
!
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
!VDBSourceAndDisassemblyApplication class methodsFor:'documentation'!
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
copyright
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
"
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    40
jv:libgdbs - GNU Debugger Interface Library
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
Copyright (C) 2015-now Jan Vrany
193
e6393500a665 Make container "application" a kind of "contents" application
Jan Vrany <jan.vrany@labware.com>
parents: 164
diff changeset
    42
Copyright (C) 2020 LabWare
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    43
Copyright (C) 2022 LabWare
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    45
Permission is hereby granted, free of charge, to any person obtaining a copy
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    46
of this software and associated documentation files (the 'Software'), to deal
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    47
in the Software without restriction, including without limitation the rights
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    48
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    49
copies of the Software, and to permit persons to whom the Software is
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    50
furnished to do so, subject to the following conditions:
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
264
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    52
The above copyright notice and this permission notice shall be included in all
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    53
copies or substantial portions of the Software.
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    54
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    55
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    56
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    57
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    58
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    59
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    60
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23960fcb9dac Relicense under MIT license.
Jan Vrany <jan.vrany@labware.com>
parents: 193
diff changeset
    61
SOFTWARE.
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
"
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
! !
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
!VDBSourceAndDisassemblyApplication methodsFor:'aspects'!
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
frameHolder
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    "return/create the 'frameHolder' value holder (automatically generated)"
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    frameHolder isNil ifTrue:[
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
        frameHolder := ValueHolder new.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
        frameHolder addDependent:self.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
    ].
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
    ^ frameHolder
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
!
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
frameHolder:aValueModel
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    "set the 'frameHolder' value holder (automatically generated)"
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    |oldValue newValue|
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    frameHolder notNil ifTrue:[
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
        oldValue := frameHolder value.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
        frameHolder removeDependent:self.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
    ].
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    frameHolder := aValueModel.
164
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    87
    components do:[:each | 
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    88
        each application perform: #frameHolder: with: frameHolder .
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    89
        MessageNotUnderstood ignoreIn:[  
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    90
            each application perform: #disassemblableHolder: with: frameHolder
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    91
        ]
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    92
    ].
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
    frameHolder notNil ifTrue:[
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
        frameHolder addDependent:self.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
    ].
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
    newValue := frameHolder value.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    oldValue ~~ newValue ifTrue:[
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
        self update:#value with:newValue from:frameHolder.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
    ].
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
164
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   101
    "Modified: / 10-06-2019 / 22:37:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
! !
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
!VDBSourceAndDisassemblyApplication methodsFor:'initialization'!
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
initialize
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
    super initialize.
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
    self addApplication: (VDBSourceApplication new
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
                            debuggerHolder: self debuggerHolder;
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
                            frameHolder:  self frameHolder;
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
                            yourself).
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
    self addApplication: (VDBInstructionListApplication new
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
                            debuggerHolder: self debuggerHolder;
164
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   114
                            disassemblableHolder: self frameHolder;
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   115
                            frameHolder: self frameHolder;
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
                            yourself)
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
    "Created: / 01-10-2018 / 12:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
164
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   119
    "Modified: / 10-06-2019 / 12:46:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   120
    "Modified (format): / 10-06-2019 / 22:31:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
113
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
! !
1a40f33af921 UI: Show disassembly along with source code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
164
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   123
!VDBSourceAndDisassemblyApplication class methodsFor:'documentation'!
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   124
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   125
version_HG
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   126
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   127
    ^ '$Changeset: <not expanded> $'
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   128
! !
364ebdd1d42c Generalize `VDBInstructionListView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   129