The Trunk: Tools-ct.874.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-ct.874.mcz

commits-2
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ct.874.mcz

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

Name: Tools-ct.874
Author: ct
Time: 12 August 2019, 5:54:52.524878 pm
UUID: ff9f29fc-77ac-314e-879b-b5040a5e102f
Ancestors: Tools-mt.870

Feature: Remove message in Debugger

=============== Diff against Tools-mt.870 ===============

Item was added:
+ ----- Method: Debugger>>findCleanHomeBelow: (in category 'context stack (message list)') -----
+ findCleanHomeBelow: method
+
+ | dirtyIndex |
+ dirtyIndex := contextStack size + 1.
+ contextStack reverse detect: [:context |
+ dirtyIndex := dirtyIndex - 1.
+ context method = method].
+ ^ dirtyIndex + 1!

Item was changed:
  ----- Method: Debugger>>mainContextStackMenu: (in category 'context stack menu') -----
  mainContextStackMenu: aMenu
  "Set up the menu appropriately for the context-stack-list, unshifted"
  <contextStackMenuShifted: false>
  ^ aMenu addList: #(
  ('fullStack (f)' fullStack)
  ('restart (r)' restart)
  ('proceed (p)' proceed)
  ('step (t)' doStep)
  ('step through (T)' stepIntoBlock)
  ('send (e)' send)
  ('where (w)' where)
  ('peel to first like this' peelToFirst)
  -
  ('return entered value' returnValue)
  -
  ('toggle break on entry' toggleBreakOnEntry)
  ('senders of    (n)' browseSendersOfMessages)
  ('implementors of    (m)' browseMessages)
  ('inheritance (i)' methodHierarchy)
  -
  ('versions (v)' browseVersions)
  -
  ('references    (r)' browseVariableReferences)
  ('assignments    (a)' browseVariableAssignments)
  -
  ('class refs (N)' browseClassRefs)
  ('browse full (b)' browseMethodFull)
  ('file out ' fileOutMessage)
+ ('remove method (x) ' removeMessage)
  -
  ('copy bug report to clipboard' copyBugReportToClipboard));
  yourself
  !

Item was added:
+ ----- Method: Debugger>>removeMessage (in category 'context stack menu') -----
+ removeMessage
+
+ | oldContext method cleanIndex confirmation  |
+ self okToChange ifFalse: [^ false].
+ contextStackIndex isZero ifTrue: [^ false].
+
+ oldContext := self selectedContext.
+ method := oldContext method.
+ cleanIndex := self findCleanHomeBelow: method.
+ contextStack at: cleanIndex ifAbsent: [
+ self inform: 'Sender of method not found on stack, can''t remove message'.
+ ^ false].
+ (self confirm: 'I will have to revert to the sender of this message.  Is that OK?')
+ ifFalse: [^ false].
+
+ confirmation := self systemNavigation
+ confirmRemovalOf: method selector
+ on: method methodClass.
+ confirmation = 3 ifTrue: [^ self].
+ self selectedClassOrMetaClass removeSelector: method selector.
+
+ self
+ contextStackIndex: cleanIndex oldContextWas: oldContext;
+ tryRestartFrom: self selectedContext.
+ confirmation = 2
+ ifTrue: [self systemNavigation browseAllCallsOn: method selector].!

Item was changed:
  ----- Method: Debugger>>restart (in category 'context stack menu') -----
  restart
  "Proceed from the initial state of the currently selected context. The
  argument is a controller on a view of the receiver. That view is closed."
  "Closing now depends on a preference #restartAlsoProceeds - hmm 9/7/2001 16:46"
 
+ | unwindError |
- | ctxt noUnwindError |
  self okToChange ifFalse: [^ self].
  self checkContextSelection.
+ unwindError := self tryRestartFrom: self selectedContext.
+ (Preferences restartAlsoProceeds and: [unwindError not])
+ ifTrue: [self proceed].!
- ctxt := interruptedProcess popTo: self selectedContext.
- noUnwindError := false.
- ctxt == self selectedContext ifTrue: [
- noUnwindError := true.
- interruptedProcess restartTop; stepToSendOrReturn].
- self resetContext: ctxt.
- (Preferences restartAlsoProceeds and: [noUnwindError]) ifTrue: [self proceed].
- !

Item was added:
+ ----- Method: Debugger>>tryRestartFrom: (in category 'context stack menu') -----
+ tryRestartFrom: context
+ "Try to restart from the initial state of the context.
+ Return whether an unwind error occurred."
+
+ | actualContext unwindError |
+ actualContext := interruptedProcess popTo: context.
+ unwindError := actualContext ~= context.
+ unwindError ifFalse: [
+ interruptedProcess restartTop; stepToSendOrReturn].
+ self resetContext: actualContext.
+ ^ unwindError!