511 if sourcePosition is nonNil, its the fileName and |
511 if sourcePosition is nonNil, its the fileName and |
512 abs(sourcePosition) is the offset. |
512 abs(sourcePosition) is the offset. |
513 Otherwise, source is the real source |
513 Otherwise, source is the real source |
514 " |
514 " |
515 sourcePosition isNil ifTrue:[^ source]. |
515 sourcePosition isNil ifTrue:[^ source]. |
516 |
516 source isNil ifTrue:[^ nil]. |
517 source notNil ifTrue:[ |
517 |
518 self class lastMethodSourcesLock critical:[ |
518 self class lastMethodSourcesLock critical:[ |
519 LastMethodSources notNil ifTrue:[ |
519 LastMethodSources notNil ifTrue:[ |
520 chunk := LastMethodSources at:self ifAbsent:nil. |
520 chunk := LastMethodSources at:self ifAbsent:nil. |
521 ]. |
|
522 ]. |
521 ]. |
523 chunk notNil ifTrue:[ |
522 ]. |
524 ^ chunk |
523 chunk notNil ifTrue:[ |
525 ]. |
524 ^ chunk |
526 |
525 ]. |
527 LastFileLock critical:[ |
526 |
|
527 LastFileLock |
|
528 critical:[ |
528 "have to protect sourceStream from being closed as a side effect |
529 "have to protect sourceStream from being closed as a side effect |
529 of some other process fetching some the source from a different source file" |
530 of some other process fetching some the source from a different source file" |
530 |
531 |
531 sourceStream := self sourceStreamUsingCache:true. |
532 sourceStream := self sourceStreamUsingCache:true. |
532 sourceStream notNil ifTrue:[ |
533 sourceStream notNil ifTrue:[ |
538 ('DecodingError ignored when reading <1p> (<2p>)' expandMacrosWith:self whoString with:ex description) infoPrintCR. |
539 ('DecodingError ignored when reading <1p> (<2p>)' expandMacrosWith:self whoString with:ex description) infoPrintCR. |
539 sourceStream := self rawSourceStreamUsingCache:true. |
540 sourceStream := self rawSourceStreamUsingCache:true. |
540 ex restart. |
541 ex restart. |
541 ]. |
542 ]. |
542 ]. |
543 ]. |
543 ] timeoutMs:100 ifBlocking:[ |
544 ] |
|
545 timeoutMs:100 |
|
546 ifBlocking:[ |
544 "take care if LastFileLock is not available - maybe we are |
547 "take care if LastFileLock is not available - maybe we are |
545 called by a debugger while someone holds the lock. |
548 called by a debugger while someone holds the lock. |
546 Use uncached source streams" |
549 Use uncached source streams" |
547 sourceStream := self sourceStreamUsingCache:false. |
550 sourceStream := self sourceStreamUsingCache:false. |
548 sourceStream notNil ifTrue:[ |
551 sourceStream notNil ifTrue:[ |