*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Wed, 05 Sep 2001 18:59:20 +0200
changeset 1484 089067851973
parent 1483 f27b959005c9
child 1485 7e96892bc9df
*** empty log message ***
SnapShotImageMemory.st
--- a/SnapShotImageMemory.st	Wed Sep 05 18:46:15 2001 +0200
+++ b/SnapShotImageMemory.st	Wed Sep 05 18:59:20 2001 +0200
@@ -1095,7 +1095,9 @@
     "return the sourcefilename if source is extern; nil otherwise"
 
     self isMethodOrLazyMethod ifTrue:[
-        self sourcePosition notNil ifTrue:[^ self source].
+        self sourcePosition notNil ifTrue:[
+            ^ self at:(Method instVarOffsetOf:'source').
+        ].
         ^ nil
     ].
     self halt.
@@ -1328,6 +1330,29 @@
 
 !SnapShotImageMemory::ImageMethodObject methodsFor:'method protocol'!
 
+localSourceStream
+    "try to open a stream from a local source file,
+     searching in standard places."
+
+    |fileName aStream package source|
+
+    package := self package.
+    source := self at:(Method instVarOffsetOf:'source').
+    package notNil ifTrue:[
+        fileName := Smalltalk getSourceFileName:(package copyReplaceAll:$: with:$/) , '/' , source.
+        fileName notNil ifTrue:[
+            aStream := fileName asFilename readStream.
+            aStream notNil ifTrue:[^ aStream].
+        ].
+    ].
+    fileName := Smalltalk getSourceFileName:source.
+    fileName notNil ifTrue:[
+        aStream := fileName asFilename readStream.
+        aStream notNil ifTrue:[^ aStream].
+    ].
+    ^ nil
+!
+
 package
     |packageSlotOffset packagePtr packageRef package|