VDBDebuggerApplication.st
changeset 10 a618018a2dab
parent 5 fac6e83fd5c0
child 12 b17ffe0604f0
--- a/VDBDebuggerApplication.st	Wed Jun 11 23:18:34 2014 +0100
+++ b/VDBDebuggerApplication.st	Thu Jun 12 08:45:26 2014 +0100
@@ -7,6 +7,7 @@
 	category:'VGB-UI'
 !
 
+
 !VDBDebuggerApplication class methodsFor:'interface specs'!
 
 windowSpec
@@ -33,6 +34,7 @@
          name: 'Visual Debugger'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 718 390)
+         menu: mainMenu
        )
        component: 
       (SpecCollection
@@ -61,6 +63,83 @@
      )
 ! !
 
+!VDBDebuggerApplication class methodsFor:'menu specs'!
+
+mainMenu
+    "This resource specification was automatically generated
+     by the MenuEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the MenuEditor may not be able to read the specification."
+
+
+    "
+     MenuEditor new openOnClass:VDBDebuggerApplication andSelector:#mainMenu
+     (Menu new fromLiteralArrayEncoding:(VDBDebuggerApplication mainMenu)) startUp
+    "
+
+    <resource: #menu>
+
+    ^ 
+     #(Menu
+        (
+         (MenuItem
+            label: 'File'
+            submenu: 
+           (Menu
+              (
+               (MenuItem
+                  label: 'Open Executable'
+                  itemValue: doOpenExecutable
+                )
+               (MenuItem
+                  label: '-'
+                )
+               (MenuItem
+                  label: 'Quit'
+                  itemValue: doQuit
+                )
+               )
+              nil
+              nil
+            )
+          )
+         (MenuItem
+            label: 'Execution'
+            submenu: 
+           (Menu
+              (
+               (MenuItem
+                  enabled: canRunOrContinueHolder
+                  label: 'Run / Continue'
+                  itemValue: doRunOrContinue
+                )
+               (MenuItem
+                  enabled: canStepIntoHolder
+                  label: 'Step Into'
+                  itemValue: doStepIn
+                )
+               (MenuItem
+                  enabled: canStepOverHolder
+                  label: 'Step Over'
+                  itemValue: doStepOver
+                )
+               (MenuItem
+                  enabled: canStepOutHolder
+                  label: 'Step Out'
+                  itemValue: doStepOut
+                )
+               )
+              nil
+              nil
+            )
+          )
+         )
+        nil
+        nil
+      )
+! !
+
 !VDBDebuggerApplication class methodsFor:'plugIn spec'!
 
 aspectSelectors
@@ -94,3 +173,142 @@
     "Created: / 10-06-2014 / 17:29:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!VDBDebuggerApplication methodsFor:'menu actions'!
+
+doOpenExecutable
+    | file |
+
+    file := Dialog requestFileName:'Selected executable to debug' pattern:'*'.
+    file isNil ifTrue:[ ^ self ].
+    file := file asFilename.
+    debugger send: (GDBMI_file_exec_and_symbols arguments: { file asString }) wait: false.
+
+    "Modified: / 12-06-2014 / 01:12:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doQuit
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #doQuit ...'.
+!
+
+doRunOrContinue
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #doRunOrContinue ...'.
+!
+
+doStepIn
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #doStepIn ...'.
+!
+
+doStepOut
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #doStepOut ...'.
+!
+
+doStepOver
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #doStepOver ...'.
+! !
+
+!VDBDebuggerApplication methodsFor:'menu queries'!
+
+canRunOrContinueHolder
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #canRunOrContinueHolder ...'.
+!
+
+canStepIntoHolder
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #canStepIntoHolder ...'.
+!
+
+canStepOutHolder
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #canStepOutHolder ...'.
+!
+
+canStepOverHolder
+    "automatically generated by UIEditor ..."
+
+    "*** the code below performs no action"
+    "*** (except for some feedback on the Transcript)"
+    "*** Please change as required and accept in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    "action to be added ..."
+
+    Transcript showCR:self class name, ': action for #canStepOverHolder ...'.
+! !
+
+!VDBDebuggerApplication class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+