[squeak-dev] The Trunk: Tools-eem.1003.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Oct 17 17:13:03 UTC 2020


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

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

Name: Tools-eem.1003
Author: eem
Time: 17 October 2020, 10:13:01.009098 am
UUID: 2da79925-8c60-44c5-a279-aac5879807cc
Ancestors: Tools-mt.1002

Add a copy stack to clipboard menu item to the process browser.

=============== Diff against Tools-mt.1002 ===============

Item was added:
+ ----- Method: ProcessBrowser>>copyProcessStackToClipboard (in category 'process list') -----
+ copyProcessStackToClipboard
+ 	| stackStream startContext |
+ 	stackStream := WriteStream on: (String new: 256).
+ 	startContext := selectedProcess == Processor activeProcess
+ 						ifTrue: [thisContext]
+ 						ifFalse: [selectedProcess suspendedContext].
+ 	startContext findContextSuchThat:
+ 		[:context|
+ 		 stackStream print: context; cr.
+ 		 false].
+ 	Clipboard clipboardText: stackStream contents!

Item was changed:
  ----- Method: ProcessBrowser>>processListMenu: (in category 'process list') -----
+ processListMenu: menu
- processListMenu: menu 
- 	| pw |
  
+ 	selectedProcess ifNotNil:
+ 		[:process|
+ 		 [:name :allowStop :allowDebug|
+ 		 menu addList: #(('inspect (i)' inspectProcess) ('explore (I)' exploreProcess) ('inspect Pointers (P)' inspectPointers)).
+ 		 (Smalltalk includesKey: #PointerFinder) ifTrue:
+ 			[menu add: 'chase pointers (c)' action: #chasePointers].
+ 		 allowStop ifTrue:
+ 			[menu add: 'terminate (t)' action: #terminateProcess.
+ 			 process isSuspended
+ 				ifTrue: [menu add: 'resume (r)' action: #resumeProcess]
+ 				ifFalse: [menu add: 'suspend (s)' action: #suspendProcess]].
+ 		allowDebug ifTrue:
+ 			[menu addList: #(('change priority (p)' changePriority) ('debug (d)' debugProcess))].
+ 		menu add: 'profile messages (m)' action: #messageTally.
+ 		(process suspendingList isKindOf: Semaphore) ifTrue:
+ 			[menu add: 'signal Semaphore (S)' action: #signalSemaphore].
+ 		menu addList: #(('full stack (k)' moreStack) ('copy stack to clipboard' copyProcessStackToClipboard)).
+ 		menu addLine] valueWithArguments: (self nameAndRulesFor: process)].
- 	selectedProcess
- 		ifNotNil: [| nameAndRules | 
- 			nameAndRules := self nameAndRulesForSelectedProcess.
- 			menu addList: {{'inspect (i)'. #inspectProcess}. {'explore (I)'. #exploreProcess}. {'inspect Pointers (P)'. #inspectPointers}}.
- 	(Smalltalk includesKey: #PointerFinder)
- 		ifTrue: [ menu add: 'chase pointers (c)' action: #chasePointers.  ].
- 			nameAndRules second
- 				ifTrue: [menu add: 'terminate (t)' action: #terminateProcess.
- 					selectedProcess isSuspended
- 						ifTrue: [menu add: 'resume (r)' action: #resumeProcess]
- 						ifFalse: [menu add: 'suspend (s)' action: #suspendProcess]].
- 			nameAndRules third
- 				ifTrue: [menu addList: {{'change priority (p)'. #changePriority}. {'debug (d)'. #debugProcess}}].
- 			menu addList: {{'profile messages (m)'. #messageTally}}.
- 			(selectedProcess suspendingList isKindOf: Semaphore)
- 				ifTrue: [menu add: 'signal Semaphore (S)' action: #signalSemaphore].
- 			menu add: 'full stack (k)' action: #moreStack.
- 			menu addLine].
  
- 	menu addList: {{'find context... (f)'. #findContext}. {'find again (g)'. #nextContext}}.
- 	menu addLine.
- 
  	menu
+ 		addList: #(#('find context... (f)' findContext) #('find again (g)' nextContext));
+ 		addLine;
  		add: (self isAutoUpdating
  				ifTrue: ['turn off auto-update (a)']
  				ifFalse: ['turn on auto-update (a)'])
+ 			action: #toggleAutoUpdate;
+ 		add: 'update list (u)' action: #updateProcessList.
- 		action: #toggleAutoUpdate.
- 	menu add: 'update list (u)' action: #updateProcessList.
  
+ 	(Smalltalk at: #CPUWatcher ifAbsent: []) ifNotNil:
+ 		[:pw|
- 	pw := Smalltalk at: #CPUWatcher ifAbsent: [].
- 	pw ifNotNil: [
  		menu addLine.
  		pw isMonitoring
+ 			ifTrue: [menu add: 'stop CPUWatcher' action: #stopCPUWatcher]
+ 			ifFalse: [menu add: 'start CPUWatcher' action: #startCPUWatcher]].
- 				ifTrue: [ menu add: 'stop CPUWatcher' action: #stopCPUWatcher ]
- 				ifFalse: [ menu add: 'start CPUWatcher' action: #startCPUWatcher  ]
- 	].
  
+ 	^menu!
- 	^ menu!



More information about the Squeak-dev mailing list