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