SnapShotImageMemory.st
author Claus Gittinger <cg@exept.de>
Tue, 24 Oct 2000 13:17:22 +0200
changeset 1417 28d6026fe30c
parent 1416 eec0911414fe
child 1419 f808d17ff6f5
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
     1
'From Smalltalk/X, Version:4.1.1 on 24-Okt-2000 at 12:50:47'                    !
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
     2
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'cg:private' }"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
Object subclass:#SnapShotImageMemory
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
     6
	instanceVariableNames:'image stream msb ptrSize intSize intTag spaceInfos symbolEntries
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
		globalEntries addrToObjectMapping'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	classVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	poolDictionaries:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	category:'System-Support'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    13
Object subclass:#ImageHeader
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    14
	instanceVariableNames:'memory classRef bits byteSize'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    15
	classVariableNames:''
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    16
	poolDictionaries:''
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    17
	privateIn:SnapShotImageMemory
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    18
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    19
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
Object subclass:#SpaceInfo
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	instanceVariableNames:'start end size flags imageBase'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	classVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
	poolDictionaries:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
	privateIn:SnapShotImageMemory
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    27
SnapShotImageMemory::ImageHeader variableSubclass:#ImageObject
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    28
	instanceVariableNames:''
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
	classVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
	poolDictionaries:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
	privateIn:SnapShotImageMemory
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
SnapShotImageMemory::ImageObject variableSubclass:#ImageClassObject
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
	instanceVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
	classVariableNames:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
	poolDictionaries:''
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
	privateIn:SnapShotImageMemory
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    41
SnapShotImageMemory::ImageHeader variableByteSubclass:#ImageByteObject
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    42
	instanceVariableNames:''
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    43
	classVariableNames:''
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    44
	poolDictionaries:''
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    45
	privateIn:SnapShotImageMemory
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    46
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    47
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
!SnapShotImageMemory class methodsFor:'instance creation'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
for:aFilename
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    ^ self new for:aFilename
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
!SnapShotImageMemory class methodsFor:'private'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
isNilOOP:anOOP
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    ^ anOOP == 0
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
isPointerOOP:anOOP
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    ^ (anOOP bitTest:1) not
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
isSmallIntegerOOP:anOOP
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    ^ anOOP bitTest:1
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!SnapShotImageMemory methodsFor:'accessing'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
globalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    "return the value of the instance variable 'globalEntries' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    ^ globalEntries!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
globalEntries:something
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    "set the value of the instance variable 'globalEntries' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    79
    globalEntries := something.!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    80
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    81
image
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    82
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    83
    ^ image
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    84
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    85
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    86
image:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    87
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    88
    image := something.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    89
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    90
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    91
ptrSize
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    92
    "return the value of the instance variable 'ptrSize' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    93
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    94
    ^ ptrSize!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    95
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    96
ptrSize:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    97
    "set the value of the instance variable 'ptrSize' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    98
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
    99
    ptrSize := something.! !
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
!SnapShotImageMemory methodsFor:'object access'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   103
fetchByteAt:addr
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   104
    |byte imgAddr|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   105
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   106
    imgAddr := self imageAddressOf:addr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   107
    stream position:imgAddr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   108
    byte := stream next.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   109
    ^ byte
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   110
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   111
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
fetchClassObjectAt:baseAddr
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   113
    |addr classPtr size bits o classRef nInsts|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   114
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   115
    (baseAddr bitAnd:3) ~~ 0 ifTrue:[self halt].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    o := addrToObjectMapping at:baseAddr ifAbsent:nil.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    o notNil ifTrue:[^ o].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    addr := baseAddr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    classPtr := self fetchPointerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    addr := addr + ptrSize.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    size := self fetchUnboxedIntegerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    addr := addr + ptrSize.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    bits := self fetchUnboxedIntegerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    addr := addr + ptrSize.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   128
    nInsts := (size - (intSize *3)) // intSize.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   129
    o := ImageClassObject new:nInsts.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   130
    addrToObjectMapping at:baseAddr put:o.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   131
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   132
    (self class isPointerOOP:classPtr) ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   133
        self halt
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   134
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   135
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   136
    classRef := self fetchClassObjectAt:classPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   137
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   138
    o classRef:classRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   139
size > 8000 ifTrue:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   140
    o byteSize:size.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    o bits:bits.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   143
    1 to:nInsts do:[:idx |
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
        o at:idx put:(self fetchUnboxedIntegerAt:addr).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   145
"/        o at:idx put:(self fetchObjectAt:(self fetchUnboxedIntegerAt:addr)).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   146
        addr := addr + ptrSize.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   148
    o memory:self.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    ^ o
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
fetchObjectAt:baseAddr
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   153
    |addr classPtr classRef size bits o nBytes nInsts flags imgAddr|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   154
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   155
    baseAddr == 0 ifTrue:[^ nil].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   156
    (baseAddr bitAnd:1) == 1 ifTrue:[(baseAddr bitTest:16r80000000) ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   157
                                         ^ (baseAddr - 16r100000000) bitShift32:-1
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   158
                                     ] ifFalse:[   
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   159
                                         ^ baseAddr bitShift32:-1
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   160
                                     ]
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   161
                                    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   162
    (baseAddr bitAnd:3) ~~ 0 ifTrue:[self halt].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
    o := addrToObjectMapping at:baseAddr ifAbsent:nil.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    o notNil ifTrue:[^ o].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    addr := baseAddr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    classPtr := self fetchPointerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    addr := addr + ptrSize.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    size := self fetchUnboxedIntegerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    addr := addr + ptrSize.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    bits := self fetchUnboxedIntegerAt:addr.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    addr := addr + ptrSize.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    (self class isPointerOOP:classPtr) ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
        self halt
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    classRef := self fetchClassObjectAt:classPtr.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   180
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   181
    flags := classRef flags bitAnd:Behavior maskIndexType.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   182
    (flags = Behavior flagBytes) ifTrue:[ 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   183
        nBytes := (size - (intSize * 3)).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   184
        o := ImageByteObject new:nBytes.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   185
        o classRef:classRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   186
size > 8000 ifTrue:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   187
        o byteSize:size.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   188
        o bits:bits.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   190
        imgAddr := self imageAddressOf:addr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   191
        stream position:imgAddr.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   193
        1 to:nBytes do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   194
            o at:idx put:(stream next).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   195
            addr := addr + 1.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   196
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   197
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   198
"/Transcript show:'#'.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   199
"/Transcript show:((ByteArray new:nBytes-1) replaceFrom:1 to:nBytes-1 with:o startingAt:1) asString.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   200
"/Transcript cr.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   202
    ] ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   203
        (flags = Behavior flagNotIndexed) ifFalse:[ 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   204
            (flags ~= Behavior flagPointers) ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   205
                (flags ~= Behavior flagWeakPointers) ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   206
                    self halt 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   207
                ]
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   208
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   209
        ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   211
        nInsts := (size - (intSize * 3)) // intSize.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   212
        (classRef flags bitTest:Behavior flagBehavior)
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   213
        "/ classRef isImageBehavior 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   214
        ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   215
            o := ImageClassObject new:nInsts.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   216
        ] ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   217
            o := ImageObject new:nInsts.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   218
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   219
        o classRef:classRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   220
size > 8000 ifTrue:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   221
        o byteSize:size.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   222
        o bits:bits.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   223
        addrToObjectMapping at:baseAddr put:o.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   225
        1 to:nInsts do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   226
            o at:idx put:(self fetchUnboxedIntegerAt:addr).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   227
"/            o at:idx put:(self fetchObjectAt:(self fetchUnboxedIntegerAt:addr)).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   228
            addr := addr + ptrSize.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   229
        ]
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   230
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   231
    o memory:self.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   232
    ^ o
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
fetchPointerAt:addr
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    ^ self fetchUnboxedIntegerAt:addr
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
fetchUnboxedIntegerAt:addr
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   240
    |ptr imgAddr|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   241
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   242
    (addr bitAnd:3) ~~ 0 ifTrue:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   243
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   244
    imgAddr := self imageAddressOf:addr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   245
    stream position:imgAddr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   246
    ptr := stream nextUnsignedLongMSB:msb.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   247
    ^ ptr
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   248
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   249
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   250
imageAddressOf:addr
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
    spaceInfos do:[:eachSpace |
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   252
        |byte imgAddr|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
        addr >= eachSpace start ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
            addr <= eachSpace end ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
                imgAddr := eachSpace imageBase + (addr - eachSpace start).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   257
                ^ imgAddr
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
            ]
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   261
    self halt:'image address error'.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
!SnapShotImageMemory methodsFor:'private'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
allClassesDo:aBlock
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    self allGlobalKeysDo:[:eachKey |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
        |val|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
        val := self at:eachKey.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
        val isBehavior ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
            aBlock value:val
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   273
        ] ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   274
            self halt.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   275
        ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
allGlobalKeysDo:aBlock
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   280
    globalEntries isNil ifTrue:[
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
        self readHeader.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
        self readGlobals.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
    ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   286
fetchStringFor:aStringRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   287
    |nBytes|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   288
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   289
    (aStringRef isImageBytes) ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   290
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   291
    nBytes := aStringRef byteSize - (intSize * 3).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   292
    ^ ((ByteArray new:nBytes-1) replaceFrom:1 to:nBytes-1 with:aStringRef startingAt:1) asString.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   293
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   294
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
for:aFilename
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    stream := aFilename asFilename readStream binary.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    addrToObjectMapping := IdentityDictionary new.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   298
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   299
    addrToObjectMapping at:(ObjectMemory addressOf:false) put:false.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   300
    addrToObjectMapping at:(ObjectMemory addressOf:true) put:true.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   301
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   302
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   303
printStringOfClass:aClassRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   304
    |nameSlot|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   305
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   306
    (aClassRef isImageBehavior) ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   307
    ((aClassRef byteSize // intSize) - 3) < Class instSize ifTrue:[self halt.].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   308
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   309
    nameSlot := aClassRef at:7.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   310
    nameSlot isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   311
        nameSlot := self fetchObjectAt:nameSlot
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   312
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   313
    nameSlot isImageSymbol ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   314
    ^ 'Class: ' , (self printStringOfSymbol:nameSlot)
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   315
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   316
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   317
printStringOfObject:anObjectRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   318
    |s nBytes|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   319
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   320
    anObjectRef isNil ifTrue:[^ 'nil'].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   321
    (anObjectRef isInteger) ifTrue:[^ anObjectRef printString].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   322
    (anObjectRef == true ) ifTrue:[^ anObjectRef printString].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   323
    (anObjectRef == false) ifTrue:[^ anObjectRef printString].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   324
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   325
    (anObjectRef isImageSymbol) ifTrue:[^ self printStringOfSymbol:anObjectRef].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   326
    (anObjectRef isImageBehavior) ifTrue:[^ self printStringOfClass:anObjectRef].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   327
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   328
    ^ 'obj(' , anObjectRef printString , ')'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   329
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   330
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   331
printStringOfString:aStringRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   332
    |nBytes|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   333
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   334
    (aStringRef isString) ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   335
    ^ self fetchStringFor:aStringRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   336
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   337
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   338
printStringOfSymbol:aSymbolRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   339
    |nBytes|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   340
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   341
    (aSymbolRef isImageSymbol) ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   342
^ self fetchStringFor:aSymbolRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   343
"/    nBytes := aSymbolRef size - (intSize * 3).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   344
"/    ^ ((ByteArray new:nBytes-1) replaceFrom:1 to:nBytes-1 with:aSymbolRef startingAt:1) asString.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
readGlobalEntries
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   348
        |refPointer theSymbolPtr theSymbolRef theValuePtr theValueRef pos|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
        globalEntries := OrderedCollection new.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
        [
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
            refPointer := stream nextUnsignedLongMSB:msb.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   353
            theSymbolPtr := stream nextUnsignedLongMSB:msb.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   354
            theValuePtr := stream nextUnsignedLongMSB:msb.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   355
            theSymbolPtr ~~ 0
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
        ] whileTrue:[
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   357
            globalEntries add:(theSymbolPtr -> theValuePtr).
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
        ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   359
        globalEntries := globalEntries asArray.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   360
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   361
"/ globalEntries inspect.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   362
        pos := stream position.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   363
        globalEntries do:[:item |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   364
            theSymbolPtr := item key.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   365
            theValuePtr := item value.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   366
            theSymbolRef := self fetchObjectAt:theSymbolPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   367
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   368
"/            Transcript show:(self printStringOfSymbol:theSymbolRef).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   369
"/            Transcript show:'->'.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   370
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   371
            theValueRef := self fetchObjectAt:theValuePtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   372
"/            Transcript show:(self printStringOfObject:theValueRef).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   373
"/            Transcript cr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   374
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   375
            item key:theSymbolRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   376
            item value:theValueRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   377
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   378
        stream position:pos.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
readHeader
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
        "
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
         (self for:'stmeas.img') readHeader
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
        "
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
        |order magic version timeStamp snapID last_util_addr hiText_addr flags 
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
         lowData hiData charSlots charTableSlots fixMemStart fixMemEnd 
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
         symMemStart symMemEnd vmDataAddr sharedMethodCode sharedBlockCode 
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
         nContexts contextSpace nRegistered symbolsSeqNr nSpaces 
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   390
         classNameSize spaceSize|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
        stream next:256.        "/ skip execCmd
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
        msb := false.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
        order := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
        order = 16r076543210 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
        ] ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
            order = 16r01234567 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
                msb := true.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
            ] ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
                self error:'unhandled byteorder'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
            ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
        magic := (stream next:8) asString.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
        magic ~= 'ST/X-IMG' ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
            self error:'not an st/x image'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
        version := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
        timeStamp := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
        ptrSize := stream nextByte.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
        ptrSize ~~ 4 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
            self error:'unhandled ptr format'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
        stream next:7.    "/ filler    
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
        intSize := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
        intSize == 9 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
            intSize := 4.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
            intTag := 1.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
        ] ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
            self error:'unhandled int format'
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
        snapID := stream nextUnsignedLongMSB:msb.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
        last_util_addr := stream next:intSize.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
        hiText_addr := stream next:intSize.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
        flags := stream next:intSize.        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
        stream next:8.    "/ info, debug & filler    
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
        lowData := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
        hiData := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
        charSlots := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
        charTableSlots := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
        version >= 8 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
            fixMemStart := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
            fixMemEnd := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
            symMemStart := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
            symMemEnd := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
            vmDataAddr := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
        stream next:(128 * intSize).    "/ skip sharedMethodCode ptrs
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
        stream next:(128 * intSize).    "/ skip sharedBlockCode ptrs
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
        nContexts := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
        contextSpace := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
        nRegistered := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
        version >= 8 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
            version >= 9 ifTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
                symbolsSeqNr := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
                stream next:(intSize * 31).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
            ] ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
                stream next:(intSize * 32).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
            ]
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
        nSpaces := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
        spaceInfos := (1 to:nSpaces) collect:[:idx | SpaceInfo new].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
        
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
        1 to:nSpaces do:[:i |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
            (spaceInfos at:i) flags:(stream nextUnsignedLongMSB:msb).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
        nSpaces+1 to:32 do:[:i | stream nextUnsignedLongMSB:msb].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
        1 to:nSpaces do:[:i |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
            (spaceInfos at:i) start:(stream nextUnsignedLongMSB:msb).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
        nSpaces+1 to:32 do:[:i | stream nextUnsignedLongMSB:msb].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
        1 to:nSpaces do:[:i |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
            (spaceInfos at:i) size:(stream nextUnsignedLongMSB:msb).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
        nSpaces+1 to:32 do:[:i | stream nextUnsignedLongMSB:msb].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
        version >= 8 ifTrue:[
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   477
            stream position:(stream class zeroPosition).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   478
            stream skip:4096.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
        1 to:nSpaces do:[:i |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
            (spaceInfos at:i) end:((spaceInfos at:i) start + (spaceInfos at:i) size - 1).
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
        1 to:nSpaces do:[:i |
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
            (spaceInfos at:i) imageBase:(stream position).
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   486
            spaceSize := (spaceInfos at:i) size.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   487
            stream skip:spaceSize.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   489
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
        "/ registration
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
        self readRegistrationEntries.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   493
        Transcript showCR:'reading symbols...'.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
        self readSymbolEntries.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   495
        self readUGlobalEntries.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   496
        Transcript showCR:'reading globals...'.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
        self readGlobalEntries.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
"/struct basicImageHeader {
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
"/        char            h_execCmd[256];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
"/        int             h_orderWord;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
"/        char            h_magic[8];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
"/        int             h_version;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
"/        int             h_timeStamp;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
"/        char            h_ptrSize;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
"/        char            h_filler1[7];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
"/        int             h_intSize;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
"/        int             h_snapID;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
"/        INT             h_last_util_addr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
"/        INT             h_hiText_addr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
"/        INT             h_flags;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
"/        char            h_infoPrinting;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
"/        char            h_debugPrinting;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
"/        char            h_filler2[6];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
"/         * these are to verify compatibility of the image with
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
"/         * myself ...
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
"/         * this is now obsolete.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
"/        INT             h_lowData, h_hiData;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
"/         * base address of character- and characterTable slots
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
"/        INT             h_charSlots;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
"/        INT             h_charTableSlots;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
"/#if HEADER_VERSION >= 8
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
"/         * the fixBase (VMDATA address)
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
"/        INT             h_fixMemStart;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
"/        INT             h_fixMemEnd;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
"/        INT             h_symMemStart;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
"/        INT             h_symMemEnd;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   539
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
"/        INT             h_vmDataAddr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
"/#endif
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
"/        INT             h_sharedMethodCode[128];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
"/        INT             h_sharedBlockCode[128];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
"/        /*      
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
"/         * space needed to restore contexts
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
"/        INT             h_nContexts;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
"/        INT             h_contextSpace;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
"/         * number of class registration info records
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
"/        INT             h_nRegistered;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
"/#if HEADER_VERSION >= 8
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
"/         * reserved slots, for future versions
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
"/         * (can add additional info, without affecting position of following stuff)
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
"/         * If you add slots, you MUST DECREMENT the fillcount.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
"/# if HEADER_VERSION >= 9
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
"/        INT             h_symbolsSeqNr;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
"/        INT             h_reserved[31];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   566
"/# else
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
"/        INT             h_reserved[32];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
"/# endif
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
"/#endif
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
"/         * number of spaces, base and size of each
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
"/        INT             h_nSpaces;
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
"/        INT             h_spaceFlags[MAXSPACES];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
"/        INT             h_spaceBase[MAXSPACES];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
"/        INT             h_spaceSize[MAXSPACES];
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   578
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
"/         * here come nSpaces object spaces
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
"/         * here comes registration info
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
"/         * here come nSymbols symbolEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
"/         * followed by a zero/zero entry
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   591
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   592
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
"/         * here come nGlobal globalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
"/         * followed by a zero/zero entry
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
"/         * here come nUnnamedGlobal globalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
"/         * followed by a zero/zero entry
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
"/
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
"/        /*
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
"/         * here come stack contexts
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
"/         */
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
"/};      
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
readRegistrationEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
        |classNameSize|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
        [
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
            classNameSize := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
            classNameSize ~~ 0
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
        ] whileTrue:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
            |className flags moduleTimestamp signature nMethods nBlocks oldLitRefs nLitRefs
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
             oldConstTable nConsts|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
            className := (stream next:classNameSize) asString.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
            stream next. "/ 0-byte
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   620
            flags := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
            moduleTimestamp := stream nextUnsignedLongMSB:msb.   
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
            signature := stream nextUnsignedLongMSB:msb.   
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
            nMethods := stream nextUnsignedLongMSB:msb.   
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
            nMethods timesRepeat:[ stream nextUnsignedLongMSB:msb ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
            nBlocks := stream nextUnsignedLongMSB:msb.   
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
            nBlocks timesRepeat:[ stream nextUnsignedLongMSB:msb ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
            oldLitRefs := stream nextUnsignedLongMSB:msb.  
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
            nLitRefs := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
            nLitRefs timesRepeat:[ stream nextUnsignedLongMSB:msb ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
            stream nextUnsignedLongMSB:msb. "/ 0-litRef
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   631
            oldConstTable := stream nextUnsignedLongMSB:msb.  
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   632
            nConsts := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
            nConsts timesRepeat:[ stream nextUnsignedLongMSB:msb ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   634
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   635
            Transcript showCR:className.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
        ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   639
readSymbolEntries
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   640
        |refPointer theSymbolPtr theSymbolRef pos|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
        symbolEntries := OrderedCollection new.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
        [
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
            refPointer := stream nextUnsignedLongMSB:msb.
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   646
            theSymbolPtr := stream nextUnsignedLongMSB:msb.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   647
            theSymbolPtr ~~ 0
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
        ] whileTrue:[
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   649
            symbolEntries add:theSymbolPtr.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
        ].
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   651
        symbolEntries := symbolEntries asArray.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   652
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   653
        pos := stream position.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   654
        symbolEntries := symbolEntries collect:[:theSymbolPtr |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   655
            theSymbolRef := self fetchObjectAt:theSymbolPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   656
            theSymbolRef isImageSymbol ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   657
                self halt
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   658
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   659
        ].        
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   660
        stream position:pos
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
readUGlobalEntries
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
        |refPointer theValue|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
        [
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
            refPointer := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
            theValue := stream nextUnsignedLongMSB:msb.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
            refPointer ~~ 0
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
        ] whileTrue
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   672
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   673
!SnapShotImageMemory::ImageHeader methodsFor:'accessing'!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   674
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   675
bits
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   676
    "return the value of the instance variable 'bits' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   677
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   678
    ^ bits!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   679
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   680
bits:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   681
    "set the value of the instance variable 'bits' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   682
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   683
    bits := something.!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   684
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   685
byteSize
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   686
    "return the value of the instance variable 'size' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   687
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   688
    ^ byteSize
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   689
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   690
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   691
byteSize:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   692
    "set the value of the instance variable 'size' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   693
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   694
something > 8000 ifTrue:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   695
    byteSize := something.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   696
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   697
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   698
classRef
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   699
    "return the value of the instance variable 'classRef' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   700
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   701
    ^ classRef!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   702
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   703
classRef:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   704
    "set the value of the instance variable 'classRef' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   705
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   706
    classRef := something.!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   707
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   708
memory
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   709
    "return the value of the instance variable 'memory' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   710
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   711
    ^ memory!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   712
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   713
memory:something
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   714
    "set the value of the instance variable 'memory' (automatically generated)"
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   715
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   716
    memory := something.! !
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   717
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   718
!SnapShotImageMemory::ImageHeader methodsFor:'queries'!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   719
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   720
category
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   721
    |categoryPtr categoryRef category|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   722
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   723
    self isMethodOrLazyMethod ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   724
        categoryPtr := self at:6.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   725
        categoryRef := memory fetchObjectAt:categoryPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   726
        category := memory fetchStringFor:categoryRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   727
        ^ category
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   728
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   729
self halt.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   730
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   731
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   732
isImageBehavior
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   733
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   734
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   735
    flags := classRef flags.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   736
    ^ flags bitTest:Behavior flagBehavior  
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   737
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   738
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   739
isImageBytes
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   740
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   741
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   742
    flags := classRef flags bitAnd:Behavior maskIndexType.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   743
    ^ flags = Behavior flagBytes 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   744
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   745
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   746
isImageMethod
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   747
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   748
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   749
    flags := classRef flags.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   750
    ^ flags bitTest:Behavior flagMethod 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   751
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   752
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   753
isImageSymbol
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   754
    |flags|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   755
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   756
    flags := classRef flags.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   757
    ^ flags bitTest:Behavior flagSymbol 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   758
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   759
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   760
isMeta
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   761
    ^ false
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   762
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   763
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   764
isMethod                               
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   765
    ^ classRef name = 'Method'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   766
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   767
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   768
isMethodDictionary
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   769
    ^ classRef name = 'MethodDictionary'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   770
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   771
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   772
isMethodOrLazyMethod                 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   773
    classRef name = 'LazyMethod' ifTrue:[^ true].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   774
    ^ classRef name = 'Method'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   775
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   776
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   777
isString                               
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   778
    ^ classRef name = 'String'
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   779
! !
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   780
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
!SnapShotImageMemory::SpaceInfo methodsFor:'accessing'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
end
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   784
    "return the value of the instance variable 'end' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
    ^ end!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
end:something
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
    "set the value of the instance variable 'end' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   790
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
    end := something.!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   792
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   793
flags
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   794
    "return the value of the instance variable 'flags' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
    ^ flags!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   797
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   798
flags:something
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   799
    "set the value of the instance variable 'flags' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   800
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   801
    flags := something.!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   802
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   803
imageBase
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   804
    "return the value of the instance variable 'imageBase' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   805
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   806
    ^ imageBase!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   807
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   808
imageBase:something
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   809
    "set the value of the instance variable 'imageBase' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   810
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   811
    imageBase := something.!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   812
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   813
size
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   814
    "return the value of the instance variable 'size' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   815
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   816
    ^ size!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
size:something
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
    "set the value of the instance variable 'size' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   820
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   821
    size := something.!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   822
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   823
start
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   824
    "return the value of the instance variable 'start' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   825
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
    ^ start!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
start:something
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
    "set the value of the instance variable 'start' (automatically generated)"
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
    start := something.! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   833
!SnapShotImageMemory::ImageObject methodsFor:'object protocol'!
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   835
at:aSelector ifAbsent:exceptionValue
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   836
    |symPtr symRef mthdPtr mthdRef s|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   837
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   838
    self isMethodDictionary ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   839
        1 to:self size by:2 do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   840
            symPtr := self at:idx.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   841
            symRef := memory fetchObjectAt:symPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   842
            symRef isImageSymbol ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   843
            s := memory fetchStringFor:symRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   844
            mthdPtr := self at:idx + 1.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   845
            mthdRef := memory fetchObjectAt:mthdPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   846
            ^ mthdRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   847
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   848
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   849
    ^ exceptionValue value
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   850
!
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   851
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   852
do:aBlock
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   853
    |mthdPtr mthdRef|
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   854
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   855
    self isMethodDictionary ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   856
        2 to:self size by:2 do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   857
            mthdPtr := self at:idx.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   858
            mthdRef := memory fetchObjectAt:mthdPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   859
            aBlock value:mthdRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   860
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   861
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   862
!
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   863
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   864
isWrapped
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   865
    ^ false
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   868
keysAndValuesDo:aBlock
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   869
    |symPtr symRef mthdPtr mthdRef s|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   870
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   871
    self isMethodDictionary ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   872
        1 to:self size by:2 do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   873
            symPtr := self at:idx.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   874
            symRef := memory fetchObjectAt:symPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   875
            symRef isImageSymbol ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   876
            s := memory fetchStringFor:symRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   877
            mthdPtr := self at:idx + 1.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   878
            mthdRef := memory fetchObjectAt:mthdPtr.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   879
            aBlock value:s asSymbol value:mthdRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   880
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   881
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   882
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   883
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   884
printStringForBrowserWithSelector:selector
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   885
    ^ selector
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   886
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   887
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   888
resources
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   889
    ^ nil
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   890
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   891
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   892
source
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   893
    |sourcePosition source aStream junk|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   894
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   895
    self isMethod ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   896
        sourcePosition := self at:(Method instVarOffsetOf:'sourcePosition').
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   897
        source := self at:(Method instVarOffsetOf:'source').
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   898
        source := memory fetchObjectAt:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   899
        source isString ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   900
            self halt.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   901
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   902
        source := memory printStringOfString:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   903
        sourcePosition isNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   904
            self halt.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   905
            ^ source
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   906
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   907
        sourcePosition := memory fetchObjectAt:sourcePosition.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   908
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   909
        aStream := self sourceStream.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   910
        aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   911
            Stream positionErrorSignal handle:[:ex |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   912
                ^ nil
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   913
            ] do:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   914
                aStream position:sourcePosition abs.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   915
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   916
            junk := aStream nextChunk.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   917
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   918
            aStream close.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   919
            ^ junk
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   920
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   921
    ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
    self halt.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   925
sourceStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   926
    |sourcePosition source aStream fileName junk who 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   927
     myClass mgr className sep dir mod package|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   928
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   929
    self isMethod ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   930
        sourcePosition := self at:(Method instVarOffsetOf:'sourcePosition').
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   931
        source := self at:(Method instVarOffsetOf:'source').
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   932
        source := memory fetchObjectAt:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   933
        source isString ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   934
            source := memory printStringOfString:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   935
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   936
        sourcePosition notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   937
            sourcePosition := memory fetchObjectAt:sourcePosition.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   938
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   939
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   940
        source isNil ifTrue:[^ nil].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   941
        sourcePosition isNil ifTrue:[^ source readStream].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   942
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   943
        sourcePosition < 0 ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   944
            aStream := source asFilename readStream.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   945
            aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   946
                ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   947
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   948
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   949
            fileName := Smalltalk getSourceFileName:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   950
            fileName notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   951
                aStream := fileName asFilename readStream.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   952
                aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   953
                    ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   954
                ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   955
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   956
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   957
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   958
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   959
        "/ if there is no SourceManager, look in local standard places first
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   960
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   961
        (mgr := Smalltalk at:#SourceCodeManager) isNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   962
            aStream := self localSourceStream.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   963
            aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   964
                ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   965
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   966
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   967
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   968
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   969
        "/ nope - ask my class for the source (this also invokes the SCMgr)
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   970
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   971
        myClass := self mclass.
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   973
        package := self package.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   974
        (package notNil and:[package ~= myClass package]) ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   975
            mgr notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   976
                "/ try to get the source using my package information ...
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   977
                sep := package indexOfAny:'/\:'.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   978
                sep ~~ 0 ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   979
                    mod := package copyTo:sep - 1.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   980
                    dir := package copyFrom:sep + 1.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   981
                    aStream := mgr streamForClass:nil fileName:source revision:nil directory:dir module:mod cache:true.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   982
                    aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   983
                        ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   984
                    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   985
                ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   986
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   987
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   988
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   989
        aStream := myClass sourceStreamFor:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   990
        aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   991
            ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   992
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   993
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   994
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   995
        "/ nope - look in standard places 
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   996
        "/ (if there is a source-code manager - otherwise, we already did that)
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   997
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   998
        mgr notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
   999
            aStream := self localSourceStream.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1000
            aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1001
                ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1002
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1003
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1004
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1005
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1006
        "/ final chance: try current directory
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1007
        "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1008
        aStream isNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1009
            aStream := source asFilename readStream.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1010
            aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1011
                ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1012
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1013
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1014
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1015
        (who isNil and:[source notNil]) ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1016
            "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1017
            "/ mhmh - seems to be a method which used to be in some
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1018
            "/ class, but has been overwritten by another or removed.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1019
            "/ (i.e. it has no containing class anyMore)
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1020
            "/ try to guess the class from the sourceFileName.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1021
            "/ and retry.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1022
            "/
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1023
            className := Smalltalk classNameForFile:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1024
            className knownAsSymbol ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1025
                myClass := Smalltalk at:className asSymbol ifAbsent:nil.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1026
                myClass notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1027
                    aStream := myClass sourceStreamFor:source.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1028
                    aStream notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1029
                        ^ aStream
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1030
                    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1031
                ]
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1032
            ]
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1033
        ].                
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1034
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1035
        ^ nil
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1036
    ].
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
    self halt.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1039
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
!SnapShotImageMemory::ImageClassObject methodsFor:'accessing - slots'!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1041
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1042
category
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1043
    |categoryRef category|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1044
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1045
    categoryRef := self categorySlot.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1046
    categoryRef isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1047
        categoryRef := memory fetchObjectAt:categoryRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1048
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1049
    categoryRef notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1050
        category := memory fetchStringFor:categoryRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1051
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1052
    ^ category
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1053
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1054
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1055
categorySlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1056
    ^ self at:8
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1057
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1058
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1059
classFilenameSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
    ^ self at:12
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1063
classVarNames
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1064
    |classVarNamesRef classVarNames s|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1065
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1066
    classVarNamesRef := self classVarsSlot.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1067
    classVarNamesRef isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1068
        classVarNamesRef := memory fetchObjectAt:classVarNamesRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1069
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1070
    classVarNamesRef notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1071
        classVarNamesRef isImageBytes ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1072
            "/ a string
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1073
            classVarNames := memory fetchStringFor:classVarNamesRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1074
            classVarNames := classVarNames asCollectionOfWords.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1075
        ] ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1076
            classVarNames := Array new:(classVarNamesRef size).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1077
            1 to:classVarNames size do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1078
                s := classVarNamesRef at:idx.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1079
                s := memory fetchObjectAt:s.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1080
                s isImageBytes ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1081
                s := memory fetchStringFor:s.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1082
                classVarNames at:idx put:s.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1083
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1084
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1085
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1086
    ^ classVarNames
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1087
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1088
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1089
classVarsSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
    ^ self at:9
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1093
comment
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1094
    |commentRef comment|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1095
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1096
    commentRef := self commentSlot.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1097
    commentRef isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1098
        commentRef := memory fetchObjectAt:commentRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1099
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1100
    commentRef notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1101
        comment := memory fetchStringFor:commentRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1102
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1103
    ^ comment
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1104
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1105
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
commentSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
    ^ self at:10
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1110
flags
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
    |flags|
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
    flags := self flagsSlot.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
    (SnapShotImageMemory isSmallIntegerOOP:flags) ifFalse:[
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
        self halt
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
    ].
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
    ^ flags bitShift:-1.
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1119
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1120
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1121
flagsSlot
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1122
    ^ self at:2
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1123
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1124
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
instSizeSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1126
    ^ self at:5
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1129
instVarNames
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1130
    |instVarNamesRef instVarNames s|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1131
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1132
    instVarNamesRef := self instVarsSlot.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1133
    instVarNamesRef isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1134
        instVarNamesRef := memory fetchObjectAt:instVarNamesRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1135
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1136
    instVarNamesRef notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1137
        instVarNamesRef isImageBytes ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1138
            "/ a string
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1139
            instVarNames := memory fetchStringFor:instVarNamesRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1140
            instVarNames := instVarNames asCollectionOfWords.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1141
        ] ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1142
            instVarNames := Array new:(instVarNamesRef size).
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1143
            1 to:instVarNames size do:[:idx |
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1144
                s := instVarNamesRef at:idx.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1145
                s := memory fetchObjectAt:s.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1146
                s isImageBytes ifFalse:[self halt].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1147
                s := memory fetchStringFor:s.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1148
                instVarNames at:idx put:s.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1149
            ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1150
        ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1151
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1152
    ^ instVarNames
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1153
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1154
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
instVarsSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
    ^ self at:6
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1159
methodDictionary
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1160
    |methodDictionaryRef methodDictionary|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1161
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1162
    methodDictionaryRef := self methodDictionarySlot.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1163
    methodDictionaryRef isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1164
        methodDictionaryRef == 0 ifTrue:[^ nil].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1165
        methodDictionary := memory fetchObjectAt:methodDictionaryRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1166
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1167
    ^ methodDictionary
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1168
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1169
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1170
methodDictionarySlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1171
    ^ self at:3
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1172
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1173
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1174
name
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1175
    |nameRef name|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1176
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1177
    nameRef := self nameSlot.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1178
    nameRef isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1179
        nameRef := memory fetchObjectAt:nameRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1180
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1181
    nameRef notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1182
        name := memory fetchStringFor:nameRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1183
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1184
    nameRef notNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1185
        name := name asSymbol.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1186
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1187
    ^ name
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1188
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1189
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1190
nameSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1191
    ^ self at:7
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1192
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1193
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1194
packageSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1195
    ^ self at:13
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1196
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1197
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1198
revisionSlot
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1199
    ^ self at:14
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
!
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1202
superclass
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1203
    |superClassRef superClass|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1204
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1205
    superClassRef := self superclassSlot.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1206
    superClassRef isInteger ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1207
        superClass := memory fetchObjectAt:superClassRef.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1208
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1209
    ^ superClass
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1210
!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1211
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1212
superclassSlot
1416
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1213
    ^ self at:1
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1214
! !
eec0911414fe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1215
1417
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1216
!SnapShotImageMemory::ImageClassObject methodsFor:'class protocol'!
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1217
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1218
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1219
    "append an expression on aStream, which defines myself."
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1220
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1221
    |s owner ns nsName fullName superName cls topOwner
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1222
     syntaxHilighting superclass category|
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1223
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1224
    superclass := self superclass.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1225
    category := self category.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1226
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1227
    UserPreferences isNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1228
        syntaxHilighting := false
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1229
    ] ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1230
        syntaxHilighting := UserPreferences current syntaxColoring.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1231
    ].
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1232
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1233
    owner := self owningClass.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1234
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1235
    owner isNil ifTrue:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1236
        ns := self nameSpace.
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1237
    ] ifFalse:[
28d6026fe30c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  1238
        ns := self topOwningClass nameSpace