--- 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|