Extended the session functionality to support the new multi process debugging.

Wed, 27 Jan 2021 10:06:09 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 27 Jan 2021 10:06:09 +0100
changeset 8008
ae9ab1e150dc
parent 8007
5b5e68ccca03
child 8010
7ce2b8bb0d9b
child 8014
efa0c52fee56

Extended the session functionality to support the new multi process debugging.

DTDs/Session-6.3.dtd file | annotate | diff | comparison | revisions
eric6/APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
eric6/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.Debugger.DebugUI.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.Project.Project.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.ViewManager.ViewManager.html file | annotate | diff | comparison | revisions
eric6/E5XML/Config.py file | annotate | diff | comparison | revisions
eric6/E5XML/SessionReader.py file | annotate | diff | comparison | revisions
eric6/E5XML/SessionWriter.py file | annotate | diff | comparison | revisions
eric6/Project/Project.py file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DTDs/Session-6.3.dtd	Wed Jan 27 10:06:09 2021 +0100
@@ -0,0 +1,131 @@
+<!-- This is the DTD for eric's (project) session file version 6.3 -->
+
+<!ELEMENT   MultiProject    (#PCDATA)>
+
+<!ELEMENT   Project         (#PCDATA)>
+
+<!ELEMENT   ViewManagerSplits   (#PCDATA)>
+<!ATTLIST   ViewManagerSplits
+    count       CDATA   #REQUIRED
+    orientation CDATA   #REQUIRED>
+
+<!ELEMENT   Filename        (#PCDATA)>
+<!ATTLIST   Filename
+    cline       CDATA   #REQUIRED
+    cindex      CDATA   #REQUIRED
+    folds       CDATA   #REQUIRED
+    zoom        CDATA   #REQUIRED
+    cloned      CDATA   #REQUIRED
+    splitindex  CDATA   #REQUIRED
+    editorindex CDATA   #REQUIRED>
+
+<!ELEMENT   Filenames       (Filename*)>
+
+<!ELEMENT   ActiveWindow    (#PCDATA)>
+<!ATTLIST   ActiveWindow
+    cline       CDATA   #REQUIRED
+    cindex      CDATA   #REQUIRED>
+
+<!ELEMENT   BpFilename      (#PCDATA)>
+<!ELEMENT   Linenumber      EMPTY>
+<!ATTLIST   Linenumber
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Condition       (#PCDATA)>
+<!ELEMENT   Temporary       EMPTY>
+<!ATTLIST   Temporary
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Enabled         EMPTY>
+<!ATTLIST   Enabled
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Count           EMPTY>
+<!ATTLIST   Count
+    value       CDATA   #REQUIRED>
+
+<!ELEMENT   Breakpoint      (BpFilename,
+                             Linenumber,
+                             Condition,
+                             Temporary,
+                             Enabled,
+                             Count)>
+
+<!ELEMENT   Breakpoints     (Breakpoint*)>
+
+<!ELEMENT   Special         (#PCDATA)>
+
+<!ELEMENT   Watchexpression (Condition,
+                             Temporary,
+                             Enabled,
+                             Count,
+                             Special)>
+
+<!ELEMENT   Watchexpressions (Watchexpression*)>
+
+<!ELEMENT   Exception       (#PCDATA)>
+
+<!ELEMENT   IgnoredException (#PCDATA)>
+
+<!ELEMENT   VirtualEnv       (#PCDATA)>
+<!ELEMENT   CommandLine      (#PCDATA)>
+<!ELEMENT   WorkingDirectory (#PCDATA)>
+<!ELEMENT   Environment      (#PCDATA)>
+<!ELEMENT   ReportExceptions EMPTY>
+<!ATTLIST   ReportExceptions
+    value       CDATA   #REQUIRED>
+<!ELEMENT   Exceptions       (Exception*)>
+<!ELEMENT   IgnoredExceptions (IgnoredException*)>
+<!ELEMENT   AutoClearShell   EMPTY>
+<!ATTLIST   AutoClearShell
+    value       CDATA   #REQUIRED>
+<!ELEMENT   TracePython      EMPTY>
+<!ATTLIST   TracePython
+    value       CDATA   #REQUIRED>
+<!ELEMENT   AutoContinue     EMPTY>
+<!ATTLIST   AutoContinue
+    value       CDATA   #REQUIRED>
+<!ELEMENT   EnableMultiprocess EMPTY>
+<!ATTLIST   EnableMultiprocess
+    value       CDATA   #REQUIRED>
+<!ELEMENT   MultiprocessNoDebug (#PCDATA)>
+<!ELEMENT   CovexcPattern    (#PCDATA)>
+
+<!ELEMENT   DebugInfo       (VirtualEnv,
+                             CommandLine,
+                             WorkingDirectory,
+                             Environment,
+                             ReportExceptions,
+                             Exceptions,
+                             IgnoredExceptions,
+                             AutoClearShell,
+                             TracePython,
+                             AutoContinue,
+                             EnableMultiprocess,
+                             MultiprocessNoDebug,
+                             CovexcPattern)>
+
+<!ELEMENT   BmFilename      (#PCDATA)>
+
+<!ELEMENT   Bookmark        (BmFilename,
+                             Linenumber)>
+
+<!ELEMENT   Bookmarks       (Bookmark*)>
+
+<!ELEMENT   ExpandedItemName     (#PCDATA)>
+
+<!ELEMENT   ProjectBrowserState  (ExpandedItemName*)>
+<!ATTLIST   ProjectBrowserState
+    name        CDATA   #REQUIRED>
+
+<!ELEMENT   ProjectBrowserStates (ProjectBrowserState*)>
+
+<!ELEMENT   Session         (MultiProject?,
+                             Project?,
+                             ViewManagerSplits?,
+                             Filenames,
+                             ActiveWindow?,
+                             Breakpoints,
+                             Watchexpressions,
+                             DebugInfo,
+                             Bookmarks,
+                             ProjectBrowserStates?)>
+<!ATTLIST   Session
+    version     CDATA   #REQUIRED>
--- a/eric6/APIs/Python3/eric6.api	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/APIs/Python3/eric6.api	Wed Jan 27 10:06:09 2021 +0100
@@ -672,6 +672,7 @@
 eric6.Debugger.DebugUI.DebugUI.setAutoClearShell?4(autoClearShell)
 eric6.Debugger.DebugUI.DebugUI.setAutoContinue?4(autoContinue)
 eric6.Debugger.DebugUI.DebugUI.setDebugActionsEnabled?4(enable)
+eric6.Debugger.DebugUI.DebugUI.setEnableMultiprocess?4(enableMultiprocess)
 eric6.Debugger.DebugUI.DebugUI.setEnvHistory?4(envStr, clearHistories=False, history=None)
 eric6.Debugger.DebugUI.DebugUI.setExcIgnoreList?4(excIgnoreList)
 eric6.Debugger.DebugUI.DebugUI.setExcList?4(excList)
@@ -7070,7 +7071,7 @@
 eric6.Project.Project.Project.saveProject?4()
 eric6.Project.Project.Project.saveProjectAs?4()
 eric6.Project.Project.Project.setData?4(category, key, data)
-eric6.Project.Project.Project.setDbgInfo?4(venvName, argv, wd, env, excReporting, excList, excIgnoreList, autoClearShell, tracePython=None, autoContinue=None)
+eric6.Project.Project.Project.setDbgInfo?4(venvName, argv, wd, env, excReporting, excList, excIgnoreList, autoClearShell, tracePython=None, autoContinue=None, enableMultiprocess=None, multiprocessNoDebug=None)
 eric6.Project.Project.Project.setDirty?4(dirty)
 eric6.Project.Project.Project.setStatusMonitorAutoUpdate?4(auto)
 eric6.Project.Project.Project.setStatusMonitorInterval?4(interval)
@@ -9855,7 +9856,7 @@
 eric6.ViewManager.ViewManager.ViewManager.setEditorName?4(editor, newName)
 eric6.ViewManager.ViewManager.ViewManager.setFileLine?4(fn, line, error=False, syntaxError=False)
 eric6.ViewManager.ViewManager.ViewManager.setReferences?4(ui, dbs)
-eric6.ViewManager.ViewManager.ViewManager.setSbInfo?4(sbLine, sbPos, sbWritable, sbEncoding, sbLanguage, sbEol, sbZoom)
+eric6.ViewManager.ViewManager.ViewManager.setSbInfo?4(sbLine: QLabel, sbPos: QLabel, sbWritable, sbEncoding, sbLanguage, sbEol, sbZoom)
 eric6.ViewManager.ViewManager.ViewManager.setSplitCount?4(count)
 eric6.ViewManager.ViewManager.ViewManager.setSplitOrientation?4(orientation)
 eric6.ViewManager.ViewManager.ViewManager.shareConnected?4(connected)
--- a/eric6/Debugger/DebugUI.py	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/Debugger/DebugUI.py	Wed Jan 27 10:06:09 2021 +0100
@@ -1714,7 +1714,8 @@
                 # save the info for later use
                 self.project.setDbgInfo(
                     lastUsedVenvName, argv, wd, env, exceptions, self.excList,
-                    self.excIgnoreList, clearShell)
+                    self.excIgnoreList, clearShell
+                )
                 
                 self.lastStartAction = 6
                 self.clientType = self.project.getProjectLanguage()
@@ -1850,7 +1851,8 @@
                 # save the info for later use
                 self.project.setDbgInfo(
                     lastUsedVenvName, argv, wd, env, exceptions, self.excList,
-                    self.excIgnoreList, clearShell)
+                    self.excIgnoreList, clearShell
+                )
                 
                 self.lastStartAction = 8
                 self.clientType = self.project.getProjectLanguage()
@@ -1985,7 +1987,8 @@
                 # save the info for later use
                 self.project.setDbgInfo(
                     lastUsedVenvName, argv, wd, env, exceptions, self.excList,
-                    self.excIgnoreList, clearShell)
+                    self.excIgnoreList, clearShell
+                )
                 
                 self.lastStartAction = 4
                 self.clientType = self.project.getProjectLanguage()
@@ -2123,7 +2126,10 @@
                 self.project.setDbgInfo(
                     lastUsedVenvName, argv, wd, env, exceptions, self.excList,
                     self.excIgnoreList, clearShell, tracePython=tracePython,
-                    autoContinue=self.autoContinue)
+                    autoContinue=autoContinue,
+                    enableMultiprocess=enableMultiprocess,
+                    multiprocessNoDebug=multiprocessNoDebug
+                )
                 
                 self.lastStartAction = 2
                 self.clientType = self.project.getProjectLanguage()
@@ -2532,7 +2538,7 @@
         """
         Public slot to initialize the no debug list history.
         
-        @param noDebugList whitespace separated list of progframs not to be
+        @param noDebugList whitespace separated list of programs not to be
             debugged
         @type str
         @param clearHistories flag indicating, that the list should be cleared
@@ -2548,3 +2554,13 @@
             if noDebugList in self.multiprocessNoDebugHistory:
                 self.multiprocessNoDebugHistory.remove(noDebugList)
             self.multiprocessNoDebugHistory.insert(0, noDebugList)
+    
+    def setEnableMultiprocess(self, enableMultiprocess):
+        """
+        Public slot to initialize the enableMultiprocess flag.
+        
+        @param enableMultiprocess flag indicating, that the debugger should be
+            run in multi process mode
+        @type bool
+        """
+        self.enableMultiprocess = enableMultiprocess
Binary file eric6/Documentation/Help/source.qch has changed
--- a/eric6/Documentation/Help/source.qhp	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/Documentation/Help/source.qhp	Wed Jan 27 10:06:09 2021 +0100
@@ -3444,6 +3444,7 @@
       <keyword name="DebugUI.setAutoClearShell" id="DebugUI.setAutoClearShell" ref="eric6.Debugger.DebugUI.html#DebugUI.setAutoClearShell" />
       <keyword name="DebugUI.setAutoContinue" id="DebugUI.setAutoContinue" ref="eric6.Debugger.DebugUI.html#DebugUI.setAutoContinue" />
       <keyword name="DebugUI.setDebugActionsEnabled" id="DebugUI.setDebugActionsEnabled" ref="eric6.Debugger.DebugUI.html#DebugUI.setDebugActionsEnabled" />
+      <keyword name="DebugUI.setEnableMultiprocess" id="DebugUI.setEnableMultiprocess" ref="eric6.Debugger.DebugUI.html#DebugUI.setEnableMultiprocess" />
       <keyword name="DebugUI.setEnvHistory" id="DebugUI.setEnvHistory" ref="eric6.Debugger.DebugUI.html#DebugUI.setEnvHistory" />
       <keyword name="DebugUI.setExcIgnoreList" id="DebugUI.setExcIgnoreList" ref="eric6.Debugger.DebugUI.html#DebugUI.setExcIgnoreList" />
       <keyword name="DebugUI.setExcList" id="DebugUI.setExcList" ref="eric6.Debugger.DebugUI.html#DebugUI.setExcList" />
--- a/eric6/Documentation/Source/eric6.Debugger.DebugUI.html	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/Documentation/Source/eric6.Debugger.DebugUI.html	Wed Jan 27 10:06:09 2021 +0100
@@ -399,6 +399,10 @@
 <td>Public method to set the enabled state of the debug actions.</td>
 </tr>
 <tr>
+<td><a href="#DebugUI.setEnableMultiprocess">setEnableMultiprocess</a></td>
+<td>Public slot to initialize the enableMultiprocess flag.</td>
+</tr>
+<tr>
 <td><a href="#DebugUI.setEnvHistory">setEnvHistory</a></td>
 <td>Public slot to initialize the env history.</td>
 </tr>
@@ -1430,6 +1434,21 @@
 enable state to be set
 </dd>
 </dl>
+<a NAME="DebugUI.setEnableMultiprocess" ID="DebugUI.setEnableMultiprocess"></a>
+<h4>DebugUI.setEnableMultiprocess</h4>
+<b>setEnableMultiprocess</b>(<i>enableMultiprocess</i>)
+
+<p>
+        Public slot to initialize the enableMultiprocess flag.
+</p>
+<dl>
+
+<dt><i>enableMultiprocess</i> (bool)</dt>
+<dd>
+flag indicating, that the debugger should be
+            run in multi process mode
+</dd>
+</dl>
 <a NAME="DebugUI.setEnvHistory" ID="DebugUI.setEnvHistory"></a>
 <h4>DebugUI.setEnvHistory</h4>
 <b>setEnvHistory</b>(<i>envStr, clearHistories=False, history=None</i>)
@@ -1506,7 +1525,7 @@
 
 <dt><i>noDebugList</i> (str)</dt>
 <dd>
-whitespace separated list of progframs not to be
+whitespace separated list of programs not to be
             debugged
 </dd>
 <dt><i>clearHistories</i> (bool)</dt>
--- a/eric6/Documentation/Source/eric6.Project.Project.html	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/Documentation/Source/eric6.Project.Project.html	Wed Jan 27 10:06:09 2021 +0100
@@ -3870,7 +3870,7 @@
 </dl>
 <a NAME="Project.setDbgInfo" ID="Project.setDbgInfo"></a>
 <h4>Project.setDbgInfo</h4>
-<b>setDbgInfo</b>(<i>venvName, argv, wd, env, excReporting, excList, excIgnoreList, autoClearShell, tracePython=None, autoContinue=None</i>)
+<b>setDbgInfo</b>(<i>venvName, argv, wd, env, excReporting, excList, excIgnoreList, autoClearShell, tracePython=None, autoContinue=None, enableMultiprocess=None, multiprocessNoDebug=None</i>)
 
 <p>
         Public method to set the debugging information.
@@ -3920,6 +3920,16 @@
 flag indicating, that the debugger should not
             stop at the first executable line
 </dd>
+<dt><i>enableMultiprocess</i> (bool)</dt>
+<dd>
+flag indicating, that the debugger should
+            run in multi process mode
+</dd>
+<dt><i>multiprocessNoDebug</i> (str)</dt>
+<dd>
+list of programs not to be debugged in
+            multi process mode
+</dd>
 </dl>
 <a NAME="Project.setDirty" ID="Project.setDirty"></a>
 <h4>Project.setDirty</h4>
--- a/eric6/Documentation/Source/eric6.ViewManager.ViewManager.html	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/Documentation/Source/eric6.ViewManager.ViewManager.html	Wed Jan 27 10:06:09 2021 +0100
@@ -4477,7 +4477,7 @@
 </dl>
 <a NAME="ViewManager.setSbInfo" ID="ViewManager.setSbInfo"></a>
 <h4>ViewManager.setSbInfo</h4>
-<b>setSbInfo</b>(<i>sbLine, sbPos, sbWritable, sbEncoding, sbLanguage, sbEol, sbZoom</i>)
+<b>setSbInfo</b>(<i>sbLine: QLabel, sbPos: QLabel, sbWritable, sbEncoding, sbLanguage, sbEol, sbZoom</i>)
 
 <p>
         Public method to transfer statusbar info from the user interface to
--- a/eric6/E5XML/Config.py	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/E5XML/Config.py	Wed Jan 27 10:06:09 2021 +0100
@@ -23,7 +23,7 @@
 userProjectFileFormatVersion = "4.0"
 
 # version number of the project session file
-sessionFileFormatVersion = "6.2"
+sessionFileFormatVersion = "6.3"
 
 # version number of the shortcuts file
 shortcutsFileFormatVersion = "3.6"
--- a/eric6/E5XML/SessionReader.py	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/E5XML/SessionReader.py	Wed Jan 27 10:06:09 2021 +0100
@@ -17,7 +17,7 @@
     """
     Class for reading an XML session file.
     """
-    supportedVersions = ["4.3", "4.4", "5.0", "6.0", "6.1", "6.2"]
+    supportedVersions = ["4.3", "4.4", "5.0", "6.0", "6.1", "6.2", "6.3"]
     
     def __init__(self, device, isGlobal):
         """
@@ -321,6 +321,16 @@
                     self.dbg.setAutoContinue(val)
                     if not self.isGlobal:
                         self.project.dbgAutoContinue = val
+                elif self.name() == "EnableMultiprocess":
+                    val = self.toBool(self.attribute("value"))
+                    self.dbg.setEnableMultiprocess(val)
+                    if not self.isGlobal:
+                        self.project.dbgEnableMultiprocess = val
+                elif self.name() == "MultiprocessNoDebug":
+                    txt = self.readElementText()
+                    self.dbg.setMultiprocessNoDebugHistory(txt)
+                    if not self.isGlobal:
+                        self.project.dbgMultiprocessNoDebug = txt
                 elif self.name() == "CovexcPattern":
                     pass    # ignore this start tag
                 else:
--- a/eric6/E5XML/SessionWriter.py	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/E5XML/SessionWriter.py	Wed Jan 27 10:06:09 2021 +0100
@@ -179,6 +179,11 @@
                 dbgEnv = self.dbg.envHistory[0]
             else:
                 dbgEnv = ""
+            if len(self.dbg.multiprocessNoDebugHistory):
+                dbgMultiprocessNoDebug = self.dbg.multiprocessNoDebugHistory[0]
+            else:
+                dbgMultiprocessNoDebug = ""
+            
             self.writeTextElement("VirtualEnv", self.dbg.lastUsedVenvName)
             self.writeTextElement("CommandLine", dbgCmdline)
             self.writeTextElement("WorkingDirectory", dbgWd)
@@ -199,6 +204,10 @@
             self.writeAttribute("value", str(self.dbg.tracePython))
             self.writeEmptyElement("AutoContinue")
             self.writeAttribute("value", str(self.dbg.autoContinue))
+            self.writeEmptyElement("EnableMultiprocess")
+            self.writeAttribute("value", str(self.dbg.enableMultiprocess))
+            self.writeTextElement("MultiprocessNoDebug",
+                                  dbgMultiprocessNoDebug)
             self.writeEmptyElement("CovexcPattern")    # kept for compatibility
         else:
             self.writeTextElement("VirtualEnv", self.project.dbgVirtualEnv)
@@ -221,6 +230,11 @@
             self.writeAttribute("value", str(self.project.dbgTracePython))
             self.writeEmptyElement("AutoContinue")
             self.writeAttribute("value", str(self.project.dbgAutoContinue))
+            self.writeEmptyElement("EnableMultiprocess")
+            self.writeAttribute("value",
+                                str(self.project.dbgEnableMultiprocess))
+            self.writeTextElement("MultiprocessNoDebug",
+                                  self.project.dbgMultiprocessNoDebug)
             self.writeEmptyElement("CovexcPattern")    # kept for compatibility
         self.writeEndElement()
         
--- a/eric6/Project/Project.py	Tue Jan 26 14:09:30 2021 +0100
+++ b/eric6/Project/Project.py	Wed Jan 27 10:06:09 2021 +0100
@@ -439,6 +439,8 @@
         self.dbgAutoClearShell = True
         self.dbgTracePython = False
         self.dbgAutoContinue = True
+        self.dbgEnableMultiprocess = True
+        self.dbgMultiprocessNoDebug = ""
         
         self.pdata = {
             "DESCRIPTION": "",
@@ -1323,7 +1325,8 @@
     
     def setDbgInfo(self, venvName, argv, wd, env, excReporting, excList,
                    excIgnoreList, autoClearShell, tracePython=None,
-                   autoContinue=None):
+                   autoContinue=None, enableMultiprocess=None,
+                   multiprocessNoDebug=None):
         """
         Public method to set the debugging information.
         
@@ -1350,6 +1353,12 @@
         @param autoContinue flag indicating, that the debugger should not
             stop at the first executable line
         @type bool
+        @param enableMultiprocess flag indicating, that the debugger should
+            run in multi process mode
+        @type bool
+        @param multiprocessNoDebug list of programs not to be debugged in
+            multi process mode
+        @type str
         """
         self.dbgVirtualEnv = venvName
         self.dbgCmdline = argv
@@ -1363,6 +1372,10 @@
             self.dbgTracePython = tracePython
         if autoContinue is not None:
             self.dbgAutoContinue = autoContinue
+        if enableMultiprocess is not None:
+            self.dbgEnableMultiprocess = enableMultiprocess
+        if multiprocessNoDebug is not None:
+            self.dbgMultiprocessNoDebug = multiprocessNoDebug
     
     def getTranslationPattern(self):
         """

eric ide

mercurial