DebugView.st
changeset 12840 6ac068e01016
parent 12839 b932ddfbdeb7
child 12862 86e6e1dd9874
--- a/DebugView.st	Wed Jun 05 13:39:03 2013 +0200
+++ b/DebugView.st	Wed Jun 05 14:50:04 2013 +0200
@@ -81,23 +81,23 @@
     This class implements a graphical debugger interface.
     The debugger usually sits on top of the faulting process,
     taking over its event processing.
+
     (this is different from other Smalltalk debuggers, which control
      the debuggee as a separate process. Consider this an historic
      leftover - the debugger was one of the first applications written for
-     ST/X; however, why should we change it without a particular need ...).
+     ST/X.
+     The whole setup might be changed, once the required process primitives
+     are available, which allow control of another processes execution
+     (i.e. single-step, restart & return). The setup will be changed then,
+     to have the debugger control the debuggee (i.e. two processes)
+     however, why should we change it without a particular need...).
 
     Only the 'stopped' debugged process is affected;
     other processes continue to respond to events.
-
-    The one exception is when an error occurs within the dispatcher process
-    or in one of the eventhandler processes - in this case, the debugger
+    The one exception to this is when an error occurs within the dispatcher process
+    or in one of the eventhandler processes. In this case, the debugger
     will sit on an exclusive display connection.
 
-    The whole debugging will be changed, once the required process primitives
-    are available, which allow control of another processes execution
-    (i.e. single-step, restart & return). The setup will be changed then,
-    to have the debugger control the debuggee (i.e. two processes)
-
     See additional information in 'doc/misc/debugger.doc'.
 
     Notice & Warning:
@@ -107,9 +107,9 @@
         In this case, close (or destroy) the broken debugView, and execute
             Debugger newDebugger
         which removes the cached debugger and forces creation of a new one the next time. 
-        This is a temporary workaround - the debugger will be fixed to avoid this problem.
-
-        You also have to remove the cached debugger, if you change the debugger's
+        This is a temporary workaround - the debugger should be fixed to avoid this situation.
+
+        You must also flush the cached debugger, if you change the debugger's
         initialization code (buttons, menu, etc.) or the debugger's class layout,
         and you want the new code to become effective.
 
@@ -804,8 +804,8 @@
 
 
     "
-     MenuEditor new openOnClass:DebugView andSelector:#classMenuSpec
-     (Menu new fromLiteralArrayEncoding:(DebugView classMenuSpec)) startUp
+     MenuEditor new openOnClass:DebugView andSelector:#receiverMenuSpec
+     (Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp
     "
 
     <resource: #menu>
@@ -820,21 +820,26 @@
           )
          (MenuItem
             enabled: canBrowseReceiversClass
-            label: 'Browse Receivers Class'
+            label: 'Browse Receiver''s Class'
             itemValue: browseReceiversClass
           )
          (MenuItem
+            enabled: canBrowseProcessesApplication
+            label: 'Browse Application Class'
+            itemValue: browseProcessesApplication
+          )
+         (MenuItem
             label: '-'
           )
          (MenuItem
             enabled: canBrowseClassHierarchy
-            label: 'Browse Receivers Class Hierarchy'
+            label: 'Browse Receiver''s Class Hierarchy'
             itemValue: browseClassHierarchy
             isVisible: false
           )
          (MenuItem
             enabled: canBrowseFullClassProtocol
-            label: 'Browse Receivers Full Protocol'
+            label: 'Browse Receiver''s Full Protocol'
             itemValue: browseFullClassProtocol
             isVisible: false
           )
@@ -843,9 +848,9 @@
             isVisible: false
           )
          (MenuItem
-            enabled: canBrowseProcessesApplication
-            label: 'Browse Application Class'
-            itemValue: browseProcessesApplication
+            enabled: canInspectWidgetHierarchy
+            label: 'Inspect Widget Hierarchy'
+            itemValue: inspectWidgetHierarchy
           )
          )
         nil
@@ -1045,7 +1050,7 @@
             submenuChannel: contextMenuSpec
           )
          (MenuItem
-            label: 'Class'
+            label: 'Receiver'
             submenuChannel: classMenuSpec
           )
          (MenuItem
@@ -1101,12 +1106,16 @@
             label: '-'
           )
          (MenuItem
-            label: 'Change Priority...'
-            itemValue: doChangeProcessPriority
+            label: 'Skip to Cursor Line'
+            itemValue: skip
           )
          (MenuItem
-            label: 'Inspect'
-            itemValue: doInspectProcess
+            label: 'Step Out (Skip until Return)'
+            itemValue: skipForReturn
+          )
+         (MenuItem
+            label: 'Skip until Entering...'
+            itemValue: skipUntilEntering
           )
          (MenuItem
             label: '-'
@@ -1124,9 +1133,25 @@
             label: '-'
           )
          (MenuItem
+            label: 'Inspect'
+            itemValue: doInspectProcess
+          )
+         (MenuItem
+            label: 'Change Priority...'
+            itemValue: doChangeProcessPriority
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
             label: 'Terminate'
             itemValue: doTerminate
           )
+         (MenuItem
+            label: 'Hard Terminate (Danger)'
+            itemValue: quickTerminate
+            isVisible: false
+          )
          )
         nil
         nil
@@ -2266,7 +2291,7 @@
         s := 'Abort (unwind to eventLoop)'
     ].
     aComponent == terminateButton ifTrue:[
-        s := 'Terminate process (close view)'
+        s := 'Terminate the process (close view)'
     ].
     aComponent == continueButton ifTrue:[
         continueButton label = (resources string:'Stop') ifTrue:[
@@ -2276,10 +2301,10 @@
         ]
     ].
     aComponent == stepButton ifTrue:[
-        s := 'Step to next send (don''t enter into called methods)'
+        s := 'Step to next send in selected context (don''t enter into called methods)'
     ].
     aComponent == nextButton ifTrue:[
-        s := 'Step to next line (don''t enter into called methods)'
+        s := 'Step to next line in selected context (don''t enter into called methods)'
     ].
     aComponent == nextOverButton ifTrue:[
         s := 'Step over to cursor-line'
@@ -4836,6 +4861,24 @@
     "Modified: / 17-07-2012 / 12:52:34 / cg"
 !
 
+inspectWidgetHierarchy
+    |rcvr view|
+
+    selectedContext isNil ifTrue:[ ^ self ].
+    Tools::ViewTreeInspectorApplication isNil ifTrue:[
+        Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'.
+        ^ self.
+    ].
+
+    rcvr := selectedContext receiver.
+    rcvr isView ifTrue:[
+        view := rcvr
+    ] ifFalse:[
+        view := rcvr window
+    ].
+    Tools::ViewTreeInspectorApplication openOn:view
+!
+
 middleButtonMenu
     <resource: #programMenu >
 
@@ -4872,18 +4915,18 @@
 "
                     ('Add Breakpoint'                   addBreakpoint           )
                     ('Remove Breakpoint'                removeBreakpoint        )
-                    ('Remove all Break- && Tracepoints'  removeAllBreakpoints    )
+                    ('Remove all Break- & Tracepoints'  removeAllBreakpoints    )
                 ).
 
-        self allowBreakPointsInDebugger ifFalse:[
-            items := items , #(
-                        ('Allow Breakpoints && halt in Debugger'      doNotIgnoreBreakpoints  )
-                    ).
-        ] ifTrue:[
-            items := items , #(
-                        ('Ignore Breakpoints && halt in Debugger'     doIgnoreBreakpoints  )
-                    ).
-        ].
+"/        self allowBreakPointsInDebugger ifFalse:[
+"/            items := items , #(
+"/                        ('Allow Breakpoints & halt in Debugger'      doNotIgnoreBreakpoints  )
+"/                    ).
+"/        ] ifTrue:[
+"/            items := items , #(
+"/                        ('Ignore Breakpoints & halt in Debugger'     doIgnoreBreakpoints  )
+"/                    ).
+"/        ].
 
         items := items , #(
                     ('-'                                                        )
@@ -4903,7 +4946,7 @@
     items := items , #(
                 ('Copy WalkBack Text'               copyWalkbackText        )
                 ('-'                                                        )
-                ('QuickTerminate'                   quickTerminate          )
+                ('Hard Terminate (Danger)'          quickTerminate          )
                 ('='                                                        )).
 
     nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName.
@@ -5934,6 +5977,14 @@
     ^ defineButton isVisible
 !
 
+canInspectWidgetHierarchy
+    |rcvr|
+
+    ^ selectedContext notNil
+    and:[ (rcvr := selectedContext receiver) isView
+          or:[ rcvr isKindOf: ApplicationModel ]]
+!
+
 canRestart
     ^ restartButton isEnabled
 
@@ -8281,15 +8332,15 @@
 !DebugView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.587 2013-06-05 11:39:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.588 2013-06-05 12:50:04 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.587 2013-06-05 11:39:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.588 2013-06-05 12:50:04 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: DebugView.st,v 1.587 2013-06-05 11:39:03 cg Exp $'
+    ^ '$Id: DebugView.st,v 1.588 2013-06-05 12:50:04 cg Exp $'
 ! !