David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.129.mcz ==================== Summary ==================== Name: Tools-dtl.129 Author: dtl Time: 23 September 2009, 9:31:10 am UUID: 2ca49a59-5ced-472d-b3cb-cffd5f985b78 Ancestors: Tools-dtl.128 Reinitialize each instance of ProcessBrowser on image restart if its autoUpdateProcess is running. Fix implemented for both MVC and Morphic. Reference Mantis 1578. =============== Diff against Tools-dtl.128 =============== Item was changed: ----- Method: ProcessBrowser>>openAsMVC (in category 'views') ----- openAsMVC "Create a pluggable version of me, answer a window" | window processListView stackListView methodTextView | + window := StandardSystemView new model: self controller: StandardSystemController new. - window := StandardSystemView new model: self controller: (deferredMessageRecipient := DeferredActionStandardSystemController new). window borderWidth: 1. processListView := PluggableListView on: self list: #processNameList selected: #processListIndex changeSelected: #processListIndex: menu: #processListMenu: keystroke: #processListKey:from:. processListView window: (0 @ 0 extent: 300 @ 200). window addSubView: processListView. stackListView := PluggableListView on: self list: #stackNameList selected: #stackListIndex changeSelected: #stackListIndex: menu: #stackListMenu: keystroke: #stackListKey:from:. stackListView window: (300 @ 0 extent: 300 @ 200). window addSubView: stackListView toRightOf: processListView. methodTextView := PluggableTextView on: self text: #selectedMethod accept: nil readSelection: nil menu: nil. methodTextView askBeforeDiscardingEdits: false. methodTextView window: (0 @ 200 corner: 600 @ 400). window addSubView: methodTextView below: processListView. window setUpdatablePanesFrom: #(#processNameList #stackNameList ). window label: 'Process Browser'. window minimumSize: 300 @ 200. window subViews do: [:each | each controller]. window controller open. startedCPUWatcher ifTrue: [ self setUpdateCallbackAfter: 7 ]. ^ window! Item was changed: ----- Method: ProcessBrowser>>openAsMorph (in category 'views') ----- openAsMorph "Create a pluggable version of me, answer a window" | window aTextMorph | window := (SystemWindow labelled: 'later') model: self. - deferredMessageRecipient := WorldState. window addMorph: ((PluggableListMorph on: self list: #processNameList selected: #processListIndex changeSelected: #processListIndex: menu: #processListMenu: keystroke: #processListKey:from:) enableDragNDrop: false) frame: (0 @ 0 extent: 0.5 @ 0.5). window addMorph: ((PluggableListMorph on: self list: #stackNameList selected: #stackListIndex changeSelected: #stackListIndex: menu: #stackListMenu: keystroke: #stackListKey:from:) enableDragNDrop: false) frame: (0.5 @ 0.0 extent: 0.5 @ 0.5). aTextMorph := PluggableTextMorph on: self text: #selectedMethod accept: nil readSelection: nil menu: nil. aTextMorph askBeforeDiscardingEdits: false. window addMorph: aTextMorph frame: (0 @ 0.5 corner: 1 @ 1). window setUpdatablePanesFrom: #(#processNameList #stackNameList ). (window setLabel: 'Process Browser') openInWorld. startedCPUWatcher ifTrue: [ self setUpdateCallbackAfter: 7 ]. ^ window! Item was changed: + ----- Method: ProcessBrowser class>>shutDown (in category 'system startup') ----- - ----- Method: ProcessBrowser class>>shutDown (in category 'as yet unclassified') ----- shutDown Browsers do: [ :ea | ea isAutoUpdating ifTrue: [ ea pauseAutoUpdate ]]! Item was changed: + ----- Method: ProcessBrowser class>>startUp (in category 'system startup') ----- - ----- Method: ProcessBrowser class>>startUp (in category 'as yet unclassified') ----- startUp + Browsers + do: [:ea | | paused | ea isAutoUpdatingPaused + ifTrue: [ea initialize; startAutoUpdate]]! - Browsers do: [ :ea | ea isAutoUpdatingPaused ifTrue: [ ea startAutoUpdate ]]! Item was changed: ----- Method: ProcessBrowser>>setUpdateCallbackAfter: (in category 'updating') ----- + setUpdateCallbackAfter: seconds - setUpdateCallbackAfter: seconds + | d | + d := Delay forSeconds: seconds. + [d wait. + d := nil. + Project current addDeferredUIMessage: [self updateProcessList]] fork! - deferredMessageRecipient ifNotNil: [ | d | - d := Delay forSeconds: seconds. - [ d wait. - d := nil. - deferredMessageRecipient addDeferredUIMessage: [self updateProcessList] - ] fork - ]! Item was changed: ----- Method: ProcessBrowser>>initialize (in category 'initialize-release') ----- initialize methodText := ''. stackListIndex := 0. searchString := ''. lastUpdate := 0. startedCPUWatcher := Preferences cpuWatcherEnabled and: [ self startCPUWatcher ]. + self updateProcessList; processListIndex: 1. + Browsers add: self! - self updateProcessList; processListIndex: 1! Item was changed: ----- Method: ProcessBrowser class>>tallyCPUUsageFor:every: (in category 'CPU utilization') ----- tallyCPUUsageFor: seconds every: msec "Compute CPU usage using a msec millisecond sample for the given number of seconds, then dump the usage statistics on the Transcript. The UI is free to continue, meanwhile" "ProcessBrowser tallyCPUUsageFor: 10 every: 100" | promise | promise := Processor tallyCPUUsageFor: seconds every: msec. [ | tally | tally := promise value. Smalltalk isMorphic + ifTrue: [ Project current addDeferredUIMessage: [ self dumpTallyOnTranscript: tally ] ] - ifTrue: [ WorldState addDeferredUIMessage: [ self dumpTallyOnTranscript: tally ] ] ifFalse: [ [ Transcript open ] forkAt: Processor userSchedulingPriority. [ (Delay forSeconds: 1) wait. self dumpTallyOnTranscript: tally ] forkAt: Processor userSchedulingPriority.] ] fork.! Item was changed: ----- Method: ProcessBrowser>>startAutoUpdate (in category 'updating') ----- startAutoUpdate + self isAutoUpdatingPaused + ifTrue: [^ autoUpdateProcess resume]. - self isAutoUpdatingPaused ifTrue: [ ^autoUpdateProcess resume ]. self isAutoUpdating + ifFalse: [autoUpdateProcess := [[self hasView] + whileTrue: [(Delay forSeconds: 2) wait. + Project current addDeferredUIMessage: [self updateProcessList]]. - ifFalse: [| delay | - delay := Delay forSeconds: 2. - autoUpdateProcess := [[self hasView] - whileTrue: [delay wait. - deferredMessageRecipient ifNotNil: [ - deferredMessageRecipient addDeferredUIMessage: [self updateProcessList]] - ifNil: [ self updateProcessList ]]. autoUpdateProcess := nil] fork]. + self updateProcessList + ! - self updateProcessList! Item was changed: Model subclass: #ProcessBrowser + instanceVariableNames: 'selectedProcess selectedContext methodText processList processListIndex stackList stackListIndex sourceMap selectedClass selectedSelector searchString autoUpdateProcess lastUpdate startedCPUWatcher' - instanceVariableNames: 'selectedProcess selectedContext methodText processList processListIndex stackList stackListIndex sourceMap selectedClass selectedSelector searchString autoUpdateProcess deferredMessageRecipient lastUpdate startedCPUWatcher' classVariableNames: 'Browsers SuspendedProcesses WellKnownProcesses' poolDictionaries: '' category: 'Tools-Process Browser'! !ProcessBrowser commentStamp: '<historical>' prior: 0! Change Set: ProcessBrowser Date: 14 March 2000 Author: Ned Konz email: [hidden email] This is distributed under the Squeak License. Added 14 March: CPUWatcher integration automatically start and stop CPUWatcher added CPUWatcher to process list menu Added 29 October: MVC version 2.8, 2.7 compatibility rearranged menus added pointer inspection and chasing added suspend/resume recognized more well-known processes misc. bug fixes Added 26 October: highlight pc in source code Added 27 October: added 'signal semaphore' added 'inspect receiver', 'explore receiver', 'message tally' to stack list menu added 'find context', 'next context' to process list menu added 'change priority' and 'debug' choices to process list menu 27 October mods by Bob Arning: alters process display in Ned's ProcessBrowser to - show process priority - drop 'a Process in' that appears on each line - show in priority order - prettier names for known processes - fix to Utilities to forget update downloading process when it ends (1 less dead process) - correct stack dump for the active process ! |
Free forum by Nabble | Edit this page |