The Trunk: Tools-tfel.729.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-tfel.729.mcz

commits-2
Tim Felgentreff uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tfel.729.mcz

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

Name: Tools-tfel.729
Author: tfel
Time: 29 September 2016, 4:47:02.790594 pm
UUID: 9b62c088-e527-4b8b-aa12-58517f3ec58e
Ancestors: Tools-tfel.728

When the system is set to eToyFriendly, the debugger previously offered to store the log of the error in a text file. To help with keeping track of problems for the people who use Etoys, add some facility so we can offer to send error reports to a server set in a preference.

=============== Diff against Tools-tfel.728 ===============

Item was changed:
  CodeHolder subclass: #Debugger
  instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject errorWasInUIProcess labelString message untilExpression'
+ classVariableNames: 'ContextStackKeystrokes ErrorRecursion ErrorReportServer InterruptUIProcessIfBlockedOnErrorInBackgroundProcess WantsAnnotationPane'
- classVariableNames: 'ContextStackKeystrokes ErrorRecursion InterruptUIProcessIfBlockedOnErrorInBackgroundProcess WantsAnnotationPane'
  poolDictionaries: ''
  category: 'Tools-Debugger'!
 
  !Debugger commentStamp: '<historical>' prior: 0!
  I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.
 
  Special note on recursive errors:
  Some errors affect Squeak's ability to present a debugger.  This is normally an unrecoverable situation.  However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger.  Here is the chain of events in such a recovery.
 
  * A recursive error is detected.
  * The current project is queried for an isolationHead
  * Changes in the isolationHead are revoked
  * The parent project of isolated project is returned to
  * The debugger is opened there and execution resumes.
 
  If the user closes that debugger, execution continues in the outer project and layer.  If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world. !

Item was added:
+ ----- Method: Debugger class>>errorReportServer (in category 'preferences') -----
+ errorReportServer
+ <preference: 'Server to send error reports to'
+ category: 'debug'
+ description: 'When eToyFriendly is enabled, the debugger offers to send an error report to the developers of the system. This variable controls where this error report is sent to.'
+ type: #String>
+ ^ErrorReportServer ifNil: ['']!

Item was added:
+ ----- Method: Debugger class>>errorReportServer: (in category 'preferences') -----
+ errorReportServer: aString
+
+ ErrorReportServer := aString!

Item was changed:
  ----- Method: Debugger>>preDebugButtonQuads (in category 'initialize') -----
  preDebugButtonQuads
 
  ^Preferences eToyFriendly
  ifTrue: [
  {
+ {'Send error report' translated. #sendReport. #blue. 'send a report of the encountered problem to the Squeak developers' translated}.
- {'Store log' translated. #storeLog. #blue. 'write a log of the encountered problem' translated}.
  {'Abandon' translated. #abandon. #black. 'abandon this execution by closing this window' translated}.
  {'Debug' translated. #debug. #red. 'bring up a debugger' translated}}]
  ifFalse: [
  {
  {'Proceed' translated. #proceed. #blue. 'continue execution' translated}.
  {'Abandon' translated. #abandon. #black. 'abandon this execution by closing this window' translated}.
  {'Debug' translated. #debug. #red. 'bring up a debugger' translated}}]
  !

Item was changed:
  ----- Method: Debugger>>preDebugMessageString (in category 'toolbuilder') -----
  preDebugMessageString
+ ^ message ifNil: [
+ String streamContents: [:s |
+ s nextPutAll: 'An error has occurred, sorry!! You could send the Squeak developers an error report or just hit ''Abandon''.
+
+ In the error report, there is no personal information, only information that we can use to investigate the error. If you decide to send us the error report, it will include the following text:
+
+ ' translated.
+ [s nextPutAll: self contextStackTop printString; cr.
+ self contextStackTop errorReportOn: s] on: Error do: [s nextPutAll: 'no text, there was an error creating the error report' translated]]].!
- ^ message ifNil: ['An error has occurred; you should probably just hit ''abandon''.  Sorry!!' translated].!

Item was added:
+ ----- Method: Debugger>>sendReport (in category 'notifier menu') -----
+ sendReport
+ [| errorReport |
+ errorReport := String streamContents: [:s |
+ s nextPutAll: self contextStackTop printString; cr.
+ self contextStackTop errorReportOn: s].
+ (Smalltalk classNamed: #WebClient)
+ ifNotNil: [:wc |
+ wc
+ httpPost: self class errorReportServer
+ content: errorReport
+ type: 'text/plain']] on: Error do: ["nothing"].
+ self abandon.!