The Trunk: Tools-eem.749.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-eem.749.mcz

commits-2
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.749.mcz

==================== Summary ====================

Name: Tools-eem.749
Author: eem
Time: 29 March 2017, 2:32:55.824435 pm
UUID: 6953ef67-4430-4da2-9d44-0fdf9c87e1c7
Ancestors: Tools-eem.748

Compile ContextPart>>errorReportOn: in MethodContext, and refer to MehodContext in informExistingDebugger:label:, not ContextPart, prior to eliminating ContextPart.

=============== Diff against Tools-eem.748 ===============

Item was changed:
  ----- Method: Debugger class>>informExistingDebugger:label: (in category 'instance creation') -----
  informExistingDebugger: aContext label: aString
  "Walking the context chain, we try to find out if we're in a debugger stepping situation.
+ If we find the relevant contexts, we must rearrange them so they look just like they would
+ if the methods were executed outside of the debugger.
+ hmm 8/3/2001 13:05"
- If we find the relevant contexts, we must rearrange them so they look just like they would
- if the methods were excuted outside of the debugger."
  | ctx quickStepMethod oldSender baseContext |
  ctx := thisContext.
+ quickStepMethod := MethodContext compiledMethodAt: #quickSend:to:with:super:.
- quickStepMethod := ContextPart compiledMethodAt: #quickSend:to:with:super:.
  [ctx sender == nil or: [ctx sender method == quickStepMethod]] whileFalse: [ctx := ctx sender].
+ ctx sender ifNil: [^self].
- ctx sender == nil ifTrue: [^self].
  baseContext := ctx.
  "baseContext is now the context created by the #quickSend... method."
  oldSender := ctx := ctx sender home sender.
  "oldSender is the context which originally sent the #quickSend... method"
+ [ctx == nil or: [(ctx objectClass: ctx receiver) includesBehavior: self]] whileFalse: [ctx := ctx sender].
+ ctx ifNil: [^self].
- [ctx == nil or: [ctx receiver isKindOf: self]] whileFalse: [ctx := ctx sender].
- ctx == nil ifTrue: [^self].
  "ctx is the context of the Debugger method #doStep"
+ ctx receiver
+ labelString: aString;
+ externalInterrupt: false;
+ proceedValue: aContext receiver.
- ctx receiver labelString: aString.
- ctx receiver externalInterrupt: false; proceedValue: aContext receiver.
  baseContext swapSender: baseContext sender sender sender. "remove intervening contexts"
  thisContext swapSender: oldSender. "make myself return to debugger"
  ErrorRecursion := false.
  ^aContext!

Item was added:
+ ----- Method: MethodContext>>errorReportOn: (in category '*Tools-debugger access') -----
+ errorReportOn: strm
+ "Write a detailed error report on the stack (above me) on a stream.  For both the error file, and emailing a bug report.  Suppress any errors while getting printStrings.  Limit the length."
+
+ | cnt aContext startPos |
+   strm print: Date today; space; print: Time now; cr.
+ strm cr.
+ strm nextPutAll: 'VM: ';
+ nextPutAll:  Smalltalk platformName asString;
+ nextPutAll: ' - ';
+ nextPutAll: Smalltalk asString;
+ cr.
+ strm nextPutAll: 'Image: ';
+ nextPutAll:  SystemVersion current version asString;
+ nextPutAll: ' [';
+ nextPutAll: Smalltalk lastUpdateString asString;
+ nextPutAll: ']';
+ cr.
+ strm cr.
+ SecurityManager default printStateOn: strm.
+
+ "Note: The following is an open-coded version of ContextPart>>stackOfSize: since this method may be called during a low space condition and we might run out of space for allocating the full stack."
+ cnt := 0.  startPos := strm position.
+ aContext := self.
+ [aContext notNil and: [(cnt := cnt + 1) < 20]] whileTrue:
+ [aContext printDetails: strm. "variable values"
+ strm cr.
+ aContext := aContext sender].
+
+ strm cr; nextPutAll: '--- The full stack ---'; cr.
+ aContext := self.
+ cnt := 0.
+ [aContext == nil] whileFalse:
+ [cnt := cnt + 1.
+ cnt = 20 ifTrue: [strm nextPutAll: ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'; cr].
+ strm print: aContext; cr.  "just class>>selector"
+
+ "exit early if too long..."
+ strm position > (startPos+ self class maxLengthForASingleDebugLogReport) ifTrue: [strm nextPutAll: '...etc...'. ^ self]. cnt > self class maxStackDepthForASingleDebugLogReport ifTrue: [strm nextPutAll: '-- and more not shown --'. ^ self].
+ aContext := aContext sender].
+ !