Debugger/DebugUI.py

branch
debugger fine grinding
changeset 5658
e5f6fe5855fd
parent 5590
40e18a10d837
child 5663
52a91f9a7a76
--- a/Debugger/DebugUI.py	Thu Mar 23 20:27:21 2017 +0100
+++ b/Debugger/DebugUI.py	Thu Mar 23 20:30:49 2017 +0100
@@ -109,7 +109,7 @@
         self.lastAction = -1
         self.debugActions = [
             self.__continue, self.__step, self.__stepOver, self.__stepOut,
-            self.__stepQuit, self.__runToCursor
+            self.__stepQuit, self.__runToCursor, self.__moveInstructionPointer
         ]
         self.localsVarFilter, self.globalsVarFilter = \
             Preferences.getVarFilters()
@@ -357,6 +357,26 @@
         ))
         act.triggered.connect(self.__runToCursor)
         self.actions.append(act)
+        
+        act = E5Action(
+            self.tr('Move Instruction Pointer to Cursor'),
+            UI.PixmapCache.getIcon("moveInstructionPointer.png"),
+            self.tr('&Jump To Cursor'), Qt.Key_F12, 0,
+            self.debugActGrp, 'dbg_jump_to_cursor')
+        act.setStatusTip(self.tr(
+            """Skip the code from the"""
+            """ current line to the current cursor position"""))
+        act.setWhatsThis(self.tr(
+            """<b>Move Instruction Pointer to Cursor</b>"""
+            """<p>Move the Python internal instruction pointer to the"""
+            """ current cursor position without executing the code in"""
+            """ between.</p>"""
+            """<p>It's not possible to jump out of a function or jump"""
+            """ in a code block, e.g. a loop. In these cases, a error"""
+            """ message is printed to the log window.<p>"""
+        ))
+        act.triggered.connect(self.__moveInstructionPointer)
+        self.actions.append(act)
 
         act = E5Action(
             self.tr('Single Step'),
@@ -2215,7 +2235,16 @@
         self.debugServer.remoteBreakpoint(
             aw.getFileName(), line, 1, None, 1)
         self.debugServer.remoteContinue()
-    
+
+    def __moveInstructionPointer(self):
+        """
+        Private method to move the instruction pointer to a different line.
+        """
+        self.lastAction = 0
+        aw = self.viewmanager.activeWindow()
+        line = aw.getCursorPosition()[0] + 1
+        self.debugServer.remoteMoveIP(line)
+
     def __enterRemote(self):
         """
         Private method to update the user interface.

eric ide

mercurial