Skip to content

Commit

Permalink
Adds adding examples per BPDebugger
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeAtHPI committed Jul 6, 2023
1 parent c3b8290 commit ab3c7af
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
examples
addExample

| argumentSpecimen receiverSpecimen method |
receiverSpecimen := BPSpecimenReference new
specimen: self receiverInspector object;
yourself.
argumentSpecimen := self contextVariablesInspector object arguments
collect: [:argumentObject |
BPSpecimenReference new
specimen: argumentObject;
yourself].
method := self selectedContext home method.
self halt.
(method bpNewExampleFrom: BPMethodExample)
receiverConstructor: receiverSpecimen;
argumentScripts: argumentSpecimen;
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
initialize
customButtonSpecs
"Answer an array of elements of the form wording, selector, help-message, that characterize the custom button row of a debugger."

| list |
list := #(('Proceed' proceed 'Close the debugger and proceed.' interruptedProcessShouldResume)
('Restart' restart 'Reset this context to its start.')
('Into' stepInto 'step Into message sends' interruptedProcessIsReady)
('Over' stepOver 'step Over message sends' interruptedProcessIsReady)
('Through' stepThrough 'step into a block' interruptedProcessIsReady)
('Full Stack' showFullStack 'show full stack')
('Where' showWhere 'select current pc range')
('Tally It' tally 'evaluate current selection and measure the time')
('Add Example' addExample 'Add current receiver and parameters as a Babylonian Example')).
(Preferences restartAlsoProceeds and: [self interruptedProcessShouldResume]) ifTrue:
[list := list collect: [:each |
each second == #restart
ifTrue: [each copy
at: 1 put: 'Proceed Here';
at: 3 put: 'Proceed from the beginning of this context.';
yourself]
ifFalse: [each second == #proceed
ifTrue: [each copy
at: 1 put: 'Proceed Top';
at: 3 put: 'Proceed from the current top context.';
yourself]
ifFalse: [each]]]].
^ list
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
},
"instance" : {
"aboutToStyle:" : "ct 8/20/2021 06:20",
"buildCodePaneWith:" : "ct 6/19/2021 21:46" } }
"addExample" : "joabe 7/6/2023 20:19",
"buildCodePaneWith:" : "ct 6/19/2021 21:46",
"customButtonSpecs" : "joabe 7/6/2023 19:42" } }

0 comments on commit ab3c7af

Please sign in to comment.