eric6/DebugClients/Python/DebugClientBase.py

changeset 7707
6abcf4275d0e
parent 7639
422fd05e9c91
child 7769
c9f64088224b
diff -r 0c6d32ec64f1 -r 6abcf4275d0e eric6/DebugClients/Python/DebugClientBase.py
--- a/eric6/DebugClients/Python/DebugClientBase.py	Sun Sep 20 18:32:43 2020 +0200
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Mon Sep 21 19:03:35 2020 +0200
@@ -189,6 +189,8 @@
         
         self.callTraceEnabled = None
         
+        self.disassembly = None
+        
         self.variant = 'You should not see this'
         
         self.compile_command = codeop.CommandCompiler()
@@ -347,6 +349,12 @@
                     "stack": stack,
                 })
         
+        elif method == "RequestDisassembly":
+            if self.disassembly is not None:
+                self.sendJsonCommand("ResponseDisassembly", self.disassembly)
+            else:
+                self.sendJsonCommand("ResponseDisassembly", {})
+        
         elif method == "RequestCapabilities":
             clientType = "Python3"
             self.sendJsonCommand("ResponseCapabilities", {
@@ -389,6 +397,7 @@
         elif method == "RequestLoad":
             self._fncache = {}
             self.dircache = []
+            self.disassembly = None
             sys.argv = []
             self.__setCoding(params["filename"])
             sys.argv.append(params["filename"])
@@ -429,6 +438,7 @@
                 self.mainThread.run(code, self.debugMod.__dict__, debug=True)
 
         elif method == "RequestRun":
+            self.disassembly = None
             sys.argv = []
             self.__setCoding(params["filename"])
             sys.argv.append(params["filename"])
@@ -464,6 +474,7 @@
 
         elif method == "RequestCoverage":
             from coverage import Coverage
+            self.disassembly = None
             sys.argv = []
             self.__setCoding(params["filename"])
             sys.argv.append(params["filename"])
@@ -500,6 +511,7 @@
         elif method == "RequestProfile":
             sys.setprofile(None)
             import PyProfile
+            self.disassembly = None
             sys.argv = []
             self.__setCoding(params["filename"])
             sys.argv.append(params["filename"])
@@ -870,6 +882,7 @@
         
         elif method == "RequestUTRun":
             from DCTestResult import DCTestResult
+            self.disassembly = None
             self.testResult = DCTestResult(self, params["failfast"])
             if self.cover:
                 self.cover.start()
@@ -931,6 +944,16 @@
                     )
         return testCases
     
+    def setDisassembly(self, disassembly):
+        """
+        Public method to store a disassembly of the code object raising an
+        exception.
+        
+        @param disassembly dictionary containing the disassembly information
+        @type dict
+        """
+        self.disassembly = disassembly
+    
     def sendJsonCommand(self, method, params):
         """
         Public method to send a single command or response to the IDE.

eric ide

mercurial