A small project to ease the bug reporting in Pharo application.
# BugReport
I provide some utilities to dump bug reports in Pharo applications.
- [Installation](#installation)
- [Documentation](#documentation)
- [Version management](#version-management)
- [Smalltalk versions compatibility](#smalltalk-versions-compatibility)
- [Contact](#contact)
## Installation
To install the project in your Pharo image execute:
```Smalltalk
Metacello new
githubUser: 'jecisc' project: 'BugReport' commitish: 'v1.x.x' path: 'src';
baseline: 'BugReport';
load
```
To add it to your baseline:
```Smalltalk
spec
baseline: 'BugReport'
with: [ spec repository: 'github://jecisc/BugReport:v1.x.x/src' ]
```
Note that you can replace the #v1.x.x by another branch such as #development or a tag such as #v1.0.0, #v1.? or #v1.1.?.
## Documentation
It is possible to export a bug report in a string.
```Smalltalk
[ (Set withAll: #(1 2 3 4)) first ]
on: Error
do: [ :ex |
String streamContents: [ :s |
BugReporter new
context: thisContext;
description: ex description;
stream: s;
write
] ]
```
It is also possible to export a bug report in a dump file.
```Smalltalk
[ (Set withAll: #(1 2 3 4)) first ]
on: Error
do: [ :ex |
FileBugReporter new
context: thisContext;
description: ex description;
file: 'report.txt' asFileReference;
write
]
```
Or in an easier way.
```Smalltalk
[ (Set withAll: #(1 2 3 4)) first ] on: Error do: [ :ex | ex dumpStackFor: thisContext ].
"or"
[ (Set withAll: #(1 2 3 4)) first ] on: Error do: [ :ex | ex dumpStack ].
```
<details>
<summary>Example of result</summary>
```
MessageNotUnderstood: Set>> #first
----------------------------------------------------------------------------------------------------
Set(Object)>>doesNotUnderstand: #first
receiver
a Set(1 2 3 4)
temps
aMessage first
RFReifyValueVar nil
RFArgumentsReificationVar an Array(first)
exception MessageNotUnderstood: Set>> #first
resumeValue nil
inst vars
tally 4
array #(nil 1 2 3 4 nil nil)
----------------------------------------------------------------------------------------------------
[ (Set withAll: #(1 2 3 4)) first ] in BugReporter class>>DoIt
receiver
BugReporter
temps
inst vars
superclass Object
methodDict a MethodDictionary(#context:->BugReporter>>#context: #description->BugReporter>>#description #description:->BugReporter>>#description: #movePastMessageNotUnderstood->BugReporter>>#movePastMessageNotUn...etc...
format 65539
layout a FixedLayout
organization a ClassOrganization
subclasses {FileBugReporter}
name #BugReporter
classPool a Dictionary()
sharedPools an OrderedCollection()
environment a SystemDictionary(lots of globals)
category #BugReport
----------------------------------------------------------------------------------------------------
BlockClosure>>on:do:
receiver
[ (Set withAll: #(1 2 3 4)) first ]
temps
exception Error
handlerAction [ :ex |
String
streamContents: [ :s |
BugReporter new
context: thisContext;
description: ex description;
stream: s;
write ] ]
inst vars
outerContext BugReporter class>>DoIt
startpc 141
numArgs 0
----------------------------------------------------------------------------------------------------
BugReporter class>>DoIt
receiver
BugReporter
temps
inst vars
superclass Object
methodDict a MethodDictionary(#context:->BugReporter>>#context: #description->BugReporter>>#description #description:->BugReporter>>#description: #movePastMessageNotUnderstood->BugReporter>>#movePastMessageNotUn...etc...
format 65539
layout a FixedLayout
organization a ClassOrganization
subclasses {FileBugReporter}
name #BugReporter
classPool a Dictionary()
sharedPools an OrderedCollection()
environment a SystemDictionary(lots of globals)
category #BugReport
----------------------------------------------------------------------------------------------------
OpalCompiler>>evaluate
receiver
an OpalCompiler
temps
value nil
inst vars
ast DoIt
^ [ (Set withAll: #(1 2 3 4)) first ]
on: Error
do: [ :ex |
String
streamContents: [ :s |
BugReporter new
context: thisContext;
description: ex description;
s...etc...
source a ReadStream
context nil
receiver BugReporter
compilationContext a CompilationContext
compilationContextClass nil
----------------------------------------------------------------------------------------------------
ClyTextEditor(RubSmalltalkEditor)>>evaluate:andDo:
receiver
a ClyTextEditor
temps
aStream a ReadWriteStream
aBlock [ :result | result inspect ]
result nil
rcvr BugReporter
ctxt nil
inst vars
defaultKeymappingIndex nil
textArea a RubEditingArea(620650752)
findReplaceService nil
selectorChooser nil
notificationStrategy a RubTextInsertionStrategy
completionEngine a CompletionEngine
----------------------------------------------------------------------------------------------------
ClyTextEditor(RubSmalltalkEditor)>>evaluateSelectionAndDo:
receiver
a ClyTextEditor
temps
aBlock [ :result | result inspect ]
inst vars
defaultKeymappingIndex nil
textArea a RubEditingArea(620650752)
findReplaceService nil
selectorChooser nil
notificationStrategy a RubTextInsertionStrategy
completionEngine a CompletionEngine
----------------------------------------------------------------------------------------------------
ClyTextEditor(RubSmalltalkEditor)>>inspectIt
receiver
a ClyTextEditor
temps
inst vars
defaultKeymappingIndex nil
textArea a RubEditingArea(620650752)
findReplaceService nil
selectorChooser nil
notificationStrategy a RubTextInsertionStrategy
completionEngine a CompletionEngine
----------------------------------------------------------------------------------------------------
ClyTextEditor(RubSmalltalkEditor)>>inspectIt:
receiver
a ClyTextEditor
temps
aKeyboardEvent nil
inst vars
defaultKeymappingIndex nil
textArea a RubEditingArea(620650752)
findReplaceService nil
selectorChooser nil
notificationStrategy a RubTextInsertionStrategy
completionEngine a CompletionEngine
----------------------------------------------------------------------------------------------------
[ :target | target editor inspectIt: nil ] in RubSmalltalkEditor class>>buildShortcutsOn:
receiver
RubSmalltalkEditor
temps
aBuilder a RubEditingArea(620650752)
t1 a RubEditingArea(620650752)
inst vars
superclass RubTextEditor
methodDict a MethodDictionary(size 103)
format 65542
layout a FixedLayout
organization a ClassOrganization
subclasses {ClyTextEditor}
name #RubSmalltalkEditor
classPool a Dictionary(#CompletionEngineClass->CompletionEngine )
sharedPools an OrderedCollection()
environment a SystemDictionary(lots of globals)
category #'Rubric-Editing-Code'
----------------------------------------------------------------------------------------------------
BlockClosure>>cull:
receiver
[ :target | target editor inspectIt: nil ]
temps
anArg a RubEditingArea(620650752)
inst vars
outerContext RubSmalltalkEditor class>>buildShortcutsOn:
startpc 567
numArgs 1
----------------------------------------------------------------------------------------------------
BlockClosure>>cull:cull:
receiver
[ :target | target editor inspectIt: nil ]
temps
firstArg a RubEditingArea(620650752)
secondArg a RubEditingArea(620650752)
inst vars
outerContext RubSmalltalkEditor class>>buildShortcutsOn:
startpc 567
numArgs 1
----------------------------------------------------------------------------------------------------
BlockClosure>>cull:cull:cull:
receiver
[ :target | target editor inspectIt: nil ]
temps
firstArg a RubEditingArea(620650752)
secondArg a RubEditingArea(620650752)
thirdArg [keystroke '<Cmd-i>']
inst vars
outerContext RubSmalltalkEditor class>>buildShortcuts