Sun, 03 Mar 2024 10:39:29 +0100
Merged with branch 'eric7' in order to prepare a new release.
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
10439
21c28b0f9e41
Updated copyright for 2024.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
3 | # Copyright (c) 2009 - 2024 Detlev Offenbach <detlev@die-offenbachs.de> |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the Python3 debugger interface for the debug server. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9448
diff
changeset
|
10 | import contextlib |
9482
a2bc06a54d9d
Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9473
diff
changeset
|
11 | import json |
6584
33ea6f430eb8
DebuggerInterfacePython: added a logging statement to see, what is sent by the debug backend. Activate it with '--debug'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6581
diff
changeset
|
12 | import logging |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9448
diff
changeset
|
13 | import os |
8075 | 14 | import shlex |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
15 | import struct |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
16 | import zlib |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
18 | from PyQt6.QtCore import QObject, QProcess, QProcessEnvironment, QTimer |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
20 | from eric7 import Preferences, Utilities |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9448
diff
changeset
|
21 | from eric7.EricWidgets import EricMessageBox |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9407
diff
changeset
|
22 | from eric7.EricWidgets.EricApplication import ericApp |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9448
diff
changeset
|
23 | from eric7.Globals import getConfig |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
24 | from eric7.SystemUtilities import FileSystemUtilities, OSUtilities, PythonUtilities |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | |
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
26 | from . import DebugClientCapabilities |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | |
27
1018a0347ae9
Set the Python3 debugger to have all capabilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
15
diff
changeset
|
28 | ClientDefaultCapabilities = DebugClientCapabilities.HasAll |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
859
diff
changeset
|
30 | |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
31 | class DebuggerInterfacePython(QObject): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | """ |
7635
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
33 | Class implementing the debugger interface for the debug server for |
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
34 | Python 3. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
36 | |
7635
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
37 | def __init__(self, debugServer, passive): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | Constructor |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
40 | |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
41 | @param debugServer reference to the debug server |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
42 | @type DebugServer |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
43 | @param passive flag indicating passive connection mode |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
44 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8163
diff
changeset
|
46 | super().__init__() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
47 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | self.__isNetworked = True |
3640
2bf828881e86
Fixed stop at sys.breakpoint() in run mode under Python3 and on first run (Py2 and 3).
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
3484
diff
changeset
|
49 | self.__autoContinue = False |
7407
a0b6acee2c20
Continued with the multiprocess debugger. Started with QProcess support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7394
diff
changeset
|
50 | self.__autoContinued = [] |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
51 | self.__isStepCommand = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
52 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | self.debugServer = debugServer |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | self.passive = passive |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | self.process = None |
6576
ea60ea85067a
VitualEnv Manager:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6503
diff
changeset
|
56 | self.__startedVenv = "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
57 | |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
58 | self.__commandQueue = [] |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
59 | self.__mainDebugger = None |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
60 | self.__connections = {} |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
61 | self.__pendingConnections = [] |
8073
6b1c43d49dbd
DebuggerInterfacePython: added code to cope with a specific shutdown situation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7986
diff
changeset
|
62 | self.__inShutdown = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
63 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | # set default values for capabilities of clients |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | self.clientCapabilities = ClientDefaultCapabilities |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
66 | |
3926
6492acd0a352
Fixed an issue in the debugger interfaces setting an initial translate function. and changed the Python default extensions '.py' and '.pyw' depending on used interpreter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3670
diff
changeset
|
67 | # set translation function |
6492acd0a352
Fixed an issue in the debugger interfaces setting an initial translate function. and changed the Python default extensions '.py' and '.pyw' depending on used interpreter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3670
diff
changeset
|
68 | self.translate = self.__identityTranslation |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
69 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | if passive: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | # set translation function |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | if Preferences.getDebugger("PathTranslation"): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
73 | self.translateRemote = Preferences.getDebugger("PathTranslationRemote") |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
74 | self.translateRemoteWindows = "\\" in self.translateRemote |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
75 | self.translateLocal = Preferences.getDebugger("PathTranslationLocal") |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
76 | self.translateLocalWindows = "\\" in self.translateLocal |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | self.translate = self.__remoteTranslation |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | self.translate = self.__identityTranslation |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
80 | |
1171
1ffefa5ca226
Improved handling of debugger sending "<string>".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1166
diff
changeset
|
81 | # attribute to remember the name of the executed script |
1ffefa5ca226
Improved handling of debugger sending "<string>".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1166
diff
changeset
|
82 | self.__scriptName = "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
83 | |
10065
de4ae767b0e3
Corrected and checked some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9972
diff
changeset
|
84 | def __identityTranslation(self, fn, remote2local=True): # noqa: U100 |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | Private method to perform the identity path translation. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
87 | |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
88 | @param fn filename to be translated |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
89 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | @param remote2local flag indicating the direction of translation |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | (False = local to remote, True = remote to local [default]) |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
92 | @type bool |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
93 | @return translated filename |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
94 | @rtype str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
95 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
96 | return fn |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
97 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
859
diff
changeset
|
98 | def __remoteTranslation(self, fn, remote2local=True): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | Private method to perform the path translation. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
101 | |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
102 | @param fn filename to be translated |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
103 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
104 | @param remote2local flag indicating the direction of translation |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | (False = local to remote, True = remote to local [default]) |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
106 | @type bool |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
107 | @return translated filename |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
108 | @rtype str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
109 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | if remote2local: |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
111 | path = fn.replace(self.translateRemote, self.translateLocal) |
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
112 | if self.translateLocalWindows: |
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
113 | path = path.replace("/", "\\") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | else: |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
115 | path = fn.replace(self.translateLocal, self.translateRemote) |
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
116 | if not self.translateRemoteWindows: |
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
117 | path = path.replace("\\", "/") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
118 | |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
119 | return path |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
120 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
121 | def __startProcess(self, program, arguments, environment=None, workingDir=None): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | Private method to start the debugger client process. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
124 | |
6633
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
125 | @param program name of the executable to start |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
126 | @type str |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
127 | @param arguments arguments to be passed to the program |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
128 | @type list of str |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
129 | @param environment dictionary of environment settings to pass |
6633
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
130 | @type dict of str |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
131 | @param workingDir directory to start the debugger client in |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
132 | @type str |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
133 | @return the process object |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
134 | @rtype QProcess or None |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | """ |
8954
c8b027c654bc
Some changes to make the code clearer and a bit more robust.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8953
diff
changeset
|
136 | proc = QProcess(self) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | if environment is not None: |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3640
diff
changeset
|
138 | env = QProcessEnvironment() |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
139 | for key, value in environment.items(): |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3640
diff
changeset
|
140 | env.insert(key, value) |
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3640
diff
changeset
|
141 | proc.setProcessEnvironment(env) |
6576
ea60ea85067a
VitualEnv Manager:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6503
diff
changeset
|
142 | args = arguments[:] |
6633
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
143 | if workingDir: |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
144 | proc.setWorkingDirectory(workingDir) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
145 | proc.start(program, args) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
146 | if not proc.waitForStarted(10000): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
147 | proc = None |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
148 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
149 | return proc |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
150 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
151 | def startRemote( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
152 | self, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
153 | port, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
154 | runInConsole, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
155 | venvName, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
156 | originalPathString, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
157 | workingDir=None, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
158 | configOverride=None, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
159 | ): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
161 | Public method to start a remote Python interpreter. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
162 | |
6352
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
163 | @param port port number the debug server is listening on |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
164 | @type int |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
859
diff
changeset
|
165 | @param runInConsole flag indicating to start the debugger in a |
6352
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
166 | console window |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
167 | @type bool |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
168 | @param venvName name of the virtual environment to be used |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
169 | @type str |
6581
8eb6220f2bb7
Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6576
diff
changeset
|
170 | @param originalPathString original PATH environment variable |
8eb6220f2bb7
Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6576
diff
changeset
|
171 | @type str |
6633
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
172 | @param workingDir directory to start the debugger client in |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
173 | @type str |
8163 | 174 | @param configOverride dictionary containing the global config override |
175 | data | |
176 | @type dict | |
6352
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
177 | @return client process object, a flag to indicate a network connection |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
178 | and the name of the interpreter in case of a local execution |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
179 | @rtype tuple of (QProcess, bool, str) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
180 | """ |
6581
8eb6220f2bb7
Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6576
diff
changeset
|
181 | global origPathEnv |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
182 | |
6352
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
183 | if not venvName: |
7635
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
184 | venvName = Preferences.getDebugger("Python3VirtualEnv") |
9388
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
185 | if venvName == self.debugServer.getProjectEnvironmentString(): |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
186 | project = ericApp().getObject("Project") |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
187 | venvName = project.getProjectVenv() |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
188 | execPath = project.getProjectExecPath() |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
189 | interpreter = project.getProjectInterpreter() |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
190 | else: |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
191 | venvManager = ericApp().getObject("VirtualEnvManager") |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
192 | interpreter = venvManager.getVirtualenvInterpreter(venvName) |
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
193 | execPath = venvManager.getVirtualenvExecPath(venvName) |
7635
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
194 | if interpreter == "": |
6376
201067699041
Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6352
diff
changeset
|
195 | # use the interpreter used to run eric for identical variants |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
196 | interpreter = PythonUtilities.getPythonExecutable() |
2573
71837b5366d5
Search for interpreter on startup, avoid 'not found' message and switch to opposite interpreter.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2525
diff
changeset
|
197 | if interpreter == "": |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8322
diff
changeset
|
198 | EricMessageBox.critical( |
3065
070b35dde35e
Fixed a bunch of indentation issues.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
3060
diff
changeset
|
199 | None, |
3484 | 200 | self.tr("Start Debugger"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
201 | self.tr("""<p>No suitable Python3 environment configured.</p>"""), |
7635
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
202 | ) |
3484 | 203 | return None, False, "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
204 | |
8073
6b1c43d49dbd
DebuggerInterfacePython: added code to cope with a specific shutdown situation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7986
diff
changeset
|
205 | self.__inShutdown = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
206 | |
8257
28146736bbfc
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
207 | redirect = ( |
28146736bbfc
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
208 | str(configOverride["redirect"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
209 | if configOverride and configOverride["enable"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
210 | else str(Preferences.getDebugger("Python3Redirect")) |
8257
28146736bbfc
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
211 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
212 | noencoding = ( |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
213 | "--no-encoding" if Preferences.getDebugger("Python3NoEncoding") else "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
214 | ) |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
215 | multiprocessEnabled = ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
216 | "--multiprocess" if Preferences.getDebugger("MultiProcessEnabled") else "" |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
217 | ) |
10289 | 218 | callTraceOptimization = ( |
219 | "--call-trace-optimization" | |
220 | if Preferences.getDebugger("PythonCallTraceOptimization") | |
221 | else "" | |
222 | ) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
223 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
224 | if Preferences.getDebugger("RemoteDbgEnabled"): |
10311 | 225 | # remote debugging code |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | ipaddr = self.debugServer.getHostAddress(False) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
227 | rexec = Preferences.getDebugger("RemoteExecution") |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | rhost = Preferences.getDebugger("RemoteHost") |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
229 | if rhost == "": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
230 | rhost = "localhost" |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
231 | if rexec: |
10311 | 232 | rdebugClient = Preferences.getDebugger("RemoteDebugClient") |
233 | if not rdebugClient and rhost == "localhost": | |
234 | # it is a remote debugging session on the same host | |
235 | rdebugClient = self.__determineDebugClient() | |
7251
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7249
diff
changeset
|
236 | args = Utilities.parseOptionString(rexec) + [ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
237 | rhost, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
238 | interpreter, |
10311 | 239 | rdebugClient, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
240 | ] |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
241 | if noencoding: |
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
242 | args.append(noencoding) |
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
243 | if multiprocessEnabled: |
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
244 | args.append(multiprocessEnabled) |
10289 | 245 | if callTraceOptimization: |
246 | args.append(callTraceOptimization) | |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
247 | args.extend([str(port), redirect, ipaddr]) |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
248 | if OSUtilities.isWindowsPlatform(): |
6848
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
249 | if not os.path.splitext(args[0])[1]: |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
250 | for ext in [".exe", ".com", ".cmd", ".bat"]: |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
251 | prog = FileSystemUtilities.getExecutablePath(args[0] + ext) |
6848
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
252 | if prog: |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
253 | args[0] = prog |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
254 | break |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
255 | else: |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
256 | args[0] = FileSystemUtilities.getExecutablePath(args[0]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
257 | process = self.__startProcess(args[0], args[1:], workingDir=workingDir) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
258 | if process is None: |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8322
diff
changeset
|
259 | EricMessageBox.critical( |
3020
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2988
diff
changeset
|
260 | None, |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
261 | self.tr("Start Debugger"), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
262 | self.tr( |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
263 | """<p>The debugger backend could not be""" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
264 | """ started.</p>""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
265 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
266 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
267 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
268 | # set translation function |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
269 | if Preferences.getDebugger("PathTranslation"): |
7251
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7249
diff
changeset
|
270 | self.translateRemote = Preferences.getDebugger( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
271 | "PathTranslationRemote" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
272 | ) |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
273 | self.translateRemoteWindows = "\\" in self.translateRemote |
7251
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7249
diff
changeset
|
274 | self.translateLocal = Preferences.getDebugger( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
275 | "PathTranslationLocal" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
276 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
277 | self.translate = self.__remoteTranslation |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
278 | self.translateLocalWindows = "\\" in self.translateLocal |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
279 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
280 | self.translate = self.__identityTranslation |
3357
2390df6f42ba
Started to change the file browser model such, that the sys.path entry is dependent on the running interpreter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3345
diff
changeset
|
281 | return process, self.__isNetworked, "" |
10321 | 282 | else: |
283 | EricMessageBox.critical( | |
284 | None, | |
285 | self.tr("Start Debugger"), | |
286 | self.tr( | |
287 | "<p>Remote debugging is configured but no command for remote" | |
288 | " login was given.</p>" | |
289 | ), | |
290 | ) | |
291 | return None, False, "" | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
292 | |
10311 | 293 | else: |
294 | # local debugging code below | |
295 | debugClient = self.__determineDebugClient() | |
296 | ||
297 | # set translation function | |
298 | self.translate = self.__identityTranslation | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
299 | |
10311 | 300 | # setup the environment for the debugger |
301 | if Preferences.getDebugger("DebugEnvironmentReplace"): | |
302 | clientEnv = {} | |
6576
ea60ea85067a
VitualEnv Manager:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6503
diff
changeset
|
303 | else: |
10311 | 304 | clientEnv = os.environ.copy() |
305 | if originalPathString: | |
306 | clientEnv["PATH"] = originalPathString | |
307 | envlist = shlex.split(Preferences.getDebugger("DebugEnvironment")) | |
308 | for el in envlist: | |
309 | with contextlib.suppress(ValueError): | |
310 | key, value = el.split("=", 1) | |
311 | clientEnv[str(key)] = str(value) | |
312 | if execPath: | |
313 | if "PATH" in clientEnv: | |
314 | clientEnv["PATH"] = os.pathsep.join([execPath, clientEnv["PATH"]]) | |
315 | else: | |
316 | clientEnv["PATH"] = execPath | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
317 | |
10311 | 318 | ipaddr = self.debugServer.getHostAddress(True) |
319 | if runInConsole or Preferences.getDebugger("ConsoleDbgEnabled"): | |
320 | ccmd = Preferences.getDebugger("ConsoleDbgCommand") | |
321 | if ccmd: | |
322 | args = Utilities.parseOptionString(ccmd) + [ | |
323 | interpreter, | |
324 | os.path.abspath(debugClient), | |
325 | ] | |
326 | if noencoding: | |
327 | args.append(noencoding) | |
328 | if multiprocessEnabled: | |
329 | args.append(multiprocessEnabled) | |
330 | if callTraceOptimization: | |
331 | args.append(callTraceOptimization) | |
332 | args.extend([str(port), "0", ipaddr]) | |
333 | args[0] = FileSystemUtilities.getExecutablePath(args[0]) | |
334 | process = self.__startProcess( | |
335 | args[0], args[1:], clientEnv, workingDir=workingDir | |
336 | ) | |
337 | if process is None: | |
338 | EricMessageBox.critical( | |
339 | None, | |
340 | self.tr("Start Debugger"), | |
341 | self.tr( | |
342 | """<p>The debugger backend could not be""" | |
343 | """ started.</p>""" | |
344 | ), | |
345 | ) | |
346 | return process, self.__isNetworked, interpreter | |
347 | ||
348 | args = [debugClient] | |
349 | if noencoding: | |
350 | args.append(noencoding) | |
351 | if multiprocessEnabled: | |
352 | args.append(multiprocessEnabled) | |
353 | if callTraceOptimization: | |
354 | args.append(callTraceOptimization) | |
355 | args.extend([str(port), redirect, ipaddr]) | |
356 | process = self.__startProcess( | |
357 | interpreter, args, clientEnv, workingDir=workingDir | |
358 | ) | |
359 | if process is None: | |
360 | self.__startedVenv = "" | |
361 | EricMessageBox.critical( | |
362 | None, | |
363 | self.tr("Start Debugger"), | |
364 | self.tr("""<p>The debugger backend could not be started.</p>"""), | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
365 | ) |
10311 | 366 | else: |
367 | self.__startedVenv = venvName | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
368 | |
10311 | 369 | return process, self.__isNetworked, interpreter |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
370 | |
9407
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
371 | def __determineDebugClient(self): |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
372 | """ |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
373 | Private method to determine the debug client to be started. |
9414
6c12e2954ec2
Reformatted the source code using the Black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
374 | |
9407
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
375 | @return path of the debug client |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
376 | @rtype str |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
377 | """ |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
378 | debugClientType = Preferences.getDebugger("DebugClientType3") |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
379 | if debugClientType == "standard": |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
380 | debugClient = os.path.join( |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
381 | getConfig("ericDir"), "DebugClients", "Python", "DebugClient.py" |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
382 | ) |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
383 | else: |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
384 | debugClient = Preferences.getDebugger("DebugClient3") |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
385 | if debugClient == "": |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
386 | # use the 'standard' debug client if no custom one was configured |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
387 | debugClient = os.path.join( |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
388 | getConfig("ericDir"), "DebugClients", "Python", "DebugClient.py" |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
389 | ) |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
390 | |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
391 | return debugClient |
2ff21ac23957
Made the Python debug interface a bit more fault tolerant in case a wrong debug client is configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9389
diff
changeset
|
392 | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
393 | def startRemoteForProject( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
394 | self, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
395 | port, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
396 | runInConsole, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
397 | venvName, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
398 | originalPathString, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
399 | workingDir=None, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
400 | configOverride=None, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
401 | ): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
402 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
403 | Public method to start a remote Python interpreter for a project. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
404 | |
6352
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
405 | @param port port number the debug server is listening on |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
406 | @type int |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
859
diff
changeset
|
407 | @param runInConsole flag indicating to start the debugger in a |
6352
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
408 | console window |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
409 | @type bool |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
410 | @param venvName name of the virtual environment to be used |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
411 | @type str |
6581
8eb6220f2bb7
Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6576
diff
changeset
|
412 | @param originalPathString original PATH environment variable |
8eb6220f2bb7
Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6576
diff
changeset
|
413 | @type str |
6633
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
414 | @param workingDir directory to start the debugger client in |
c5aab2ede19a
Debugger, Shell: start the shell in the project directory if one is open ([issue290]).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6631
diff
changeset
|
415 | @type str |
8163 | 416 | @param configOverride dictionary containing the global config override |
417 | data | |
418 | @type dict | |
6352
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
419 | @return client process object, a flag to indicate a network connection |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
420 | and the name of the interpreter in case of a local execution |
4bdc6503df81
Continued to remove all explicit references to Python interpreters and replace them by references to virtual environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6348
diff
changeset
|
421 | @rtype tuple of (QProcess, bool, str) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
422 | """ |
6581
8eb6220f2bb7
Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6576
diff
changeset
|
423 | global origPathEnv |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
424 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8322
diff
changeset
|
425 | project = ericApp().getObject("Project") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
426 | if not project.isDebugPropertiesLoaded(): |
3357
2390df6f42ba
Started to change the file browser model such, that the sys.path entry is dependent on the running interpreter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3345
diff
changeset
|
427 | return None, self.__isNetworked, "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
428 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
429 | # start debugger with project specific settings |
8257
28146736bbfc
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
430 | redirect = ( |
28146736bbfc
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
431 | str(configOverride["redirect"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
432 | if configOverride and configOverride["enable"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
433 | else str(project.getDebugProperty("REDIRECT")) |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
434 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
435 | noencoding = "--no-encoding" if project.getDebugProperty("NOENCODING") else "" |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
436 | multiprocessEnabled = ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
437 | "--multiprocess" if Preferences.getDebugger("MultiProcessEnabled") else "" |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
438 | ) |
10289 | 439 | callTraceOptimization = ( |
440 | "--call-trace-optimization" | |
441 | if Preferences.getDebugger("PythonCallTraceOptimization") | |
442 | else "" | |
443 | ) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
444 | |
9388
bfe7ea6599a3
Added support for project embedded environments to the Testing framework and the Start dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9320
diff
changeset
|
445 | if venvName and venvName != self.debugServer.getProjectEnvironmentString(): |
9168
0c3e506eddf6
Changed the debugger start procedure for project to be able to override the project defined environment via the Start... dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9074
diff
changeset
|
446 | venvManager = ericApp().getObject("VirtualEnvManager") |
0c3e506eddf6
Changed the debugger start procedure for project to be able to override the project defined environment via the Start... dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9074
diff
changeset
|
447 | interpreter = venvManager.getVirtualenvInterpreter(venvName) |
0c3e506eddf6
Changed the debugger start procedure for project to be able to override the project defined environment via the Start... dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9074
diff
changeset
|
448 | execPath = venvManager.getVirtualenvExecPath(venvName) |
0c3e506eddf6
Changed the debugger start procedure for project to be able to override the project defined environment via the Start... dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9074
diff
changeset
|
449 | else: |
0c3e506eddf6
Changed the debugger start procedure for project to be able to override the project defined environment via the Start... dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9074
diff
changeset
|
450 | venvName = project.getProjectVenv() |
0c3e506eddf6
Changed the debugger start procedure for project to be able to override the project defined environment via the Start... dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9074
diff
changeset
|
451 | execPath = project.getProjectExecPath() |
0c3e506eddf6
Changed the debugger start procedure for project to be able to override the project defined environment via the Start... dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9074
diff
changeset
|
452 | interpreter = project.getProjectInterpreter() |
6376
201067699041
Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6352
diff
changeset
|
453 | if interpreter == "": |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8322
diff
changeset
|
454 | EricMessageBox.critical( |
6376
201067699041
Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6352
diff
changeset
|
455 | None, |
201067699041
Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6352
diff
changeset
|
456 | self.tr("Start Debugger"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
457 | self.tr("""<p>No suitable Python3 environment configured.</p>"""), |
7635
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
458 | ) |
6376
201067699041
Debugger: fixed some more cases, where the debugger is not supported or configured.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6352
diff
changeset
|
459 | return None, self.__isNetworked, "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
460 | |
8073
6b1c43d49dbd
DebuggerInterfacePython: added code to cope with a specific shutdown situation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7986
diff
changeset
|
461 | self.__inShutdown = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
462 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
463 | if project.getDebugProperty("REMOTEDEBUGGER"): |
10311 | 464 | # remote debugging code |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
465 | ipaddr = self.debugServer.getHostAddress(False) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
466 | rexec = project.getDebugProperty("REMOTECOMMAND") |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
467 | rhost = project.getDebugProperty("REMOTEHOST") |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
468 | if rhost == "": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
469 | rhost = "localhost" |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
470 | if rexec: |
10311 | 471 | rdebugClient = project.getDebugProperty("REMOTEDEBUGCLIENT") |
472 | if not rdebugClient and rhost == "localhost": | |
473 | # it is a remote debugging session on the same host | |
474 | rdebugClient = self.__determineDebugClient() | |
7251
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7249
diff
changeset
|
475 | args = Utilities.parseOptionString(rexec) + [ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
476 | rhost, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
477 | interpreter, |
10311 | 478 | rdebugClient, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
479 | ] |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
480 | if noencoding: |
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
481 | args.append(noencoding) |
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
482 | if multiprocessEnabled: |
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
483 | args.append(multiprocessEnabled) |
10289 | 484 | if callTraceOptimization: |
485 | args.append(callTraceOptimization) | |
7422
9a008ab4811b
Started implementing the patching of the os module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7421
diff
changeset
|
486 | args.extend([str(port), redirect, ipaddr]) |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
487 | if OSUtilities.isWindowsPlatform(): |
6848
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
488 | if not os.path.splitext(args[0])[1]: |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
489 | for ext in [".exe", ".com", ".cmd", ".bat"]: |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
490 | prog = FileSystemUtilities.getExecutablePath(args[0] + ext) |
6848
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
491 | if prog: |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
492 | args[0] = prog |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
493 | break |
7682182a0f0f
DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6822
diff
changeset
|
494 | else: |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
495 | args[0] = FileSystemUtilities.getExecutablePath(args[0]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
496 | process = self.__startProcess(args[0], args[1:], workingDir=workingDir) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
497 | if process is None: |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8322
diff
changeset
|
498 | EricMessageBox.critical( |
3020
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2988
diff
changeset
|
499 | None, |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
500 | self.tr("Start Debugger"), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
501 | self.tr( |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
502 | """<p>The debugger backend could not be""" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
503 | """ started.</p>""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
504 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
505 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
506 | # set translation function |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
507 | if project.getDebugProperty("PATHTRANSLATION"): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
508 | self.translateRemote = project.getDebugProperty("REMOTEPATH") |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
509 | self.translateRemoteWindows = "\\" in self.translateRemote |
7251
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7249
diff
changeset
|
510 | self.translateLocal = project.getDebugProperty("LOCALPATH") |
6822
f34e48fdfd92
DebuggerInterfacePython: amended the path translation function to cope with situation where local and remote machine has different path separators.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6821
diff
changeset
|
511 | self.translateLocalWindows = "\\" in self.translateLocal |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
512 | self.translate = self.__remoteTranslation |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
513 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
514 | self.translate = self.__identityTranslation |
3357
2390df6f42ba
Started to change the file browser model such, that the sys.path entry is dependent on the running interpreter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3345
diff
changeset
|
515 | return process, self.__isNetworked, "" |
6716
1c9d3b369ea8
VirtualEnv Manager: extended the environment definition by a flag indicating a remotely accessed environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6645
diff
changeset
|
516 | else: |
1c9d3b369ea8
VirtualEnv Manager: extended the environment definition by a flag indicating a remotely accessed environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6645
diff
changeset
|
517 | # remote shell command is missing |
1c9d3b369ea8
VirtualEnv Manager: extended the environment definition by a flag indicating a remotely accessed environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6645
diff
changeset
|
518 | return None, self.__isNetworked, "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
519 | |
10311 | 520 | else: |
521 | # local debugging code below | |
522 | debugClient = project.getDebugProperty("DEBUGCLIENT") | |
523 | if not bool(debugClient) or not os.path.exists(debugClient): | |
524 | debugClient = self.__determineDebugClient() | |
525 | ||
526 | # set translation function | |
527 | self.translate = self.__identityTranslation | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
528 | |
10311 | 529 | # setup the environment for the debugger |
530 | if project.getDebugProperty("ENVIRONMENTOVERRIDE"): | |
531 | clientEnv = {} | |
6576
ea60ea85067a
VitualEnv Manager:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6503
diff
changeset
|
532 | else: |
10311 | 533 | clientEnv = os.environ.copy() |
534 | if originalPathString: | |
535 | clientEnv["PATH"] = originalPathString | |
536 | envlist = shlex.split(project.getDebugProperty("ENVIRONMENTSTRING")) | |
537 | for el in envlist: | |
538 | with contextlib.suppress(ValueError): | |
539 | key, value = el.split("=", 1) | |
540 | clientEnv[str(key)] = str(value) | |
541 | if execPath: | |
542 | if "PATH" in clientEnv: | |
543 | clientEnv["PATH"] = os.pathsep.join([execPath, clientEnv["PATH"]]) | |
544 | else: | |
545 | clientEnv["PATH"] = execPath | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
546 | |
10311 | 547 | ipaddr = self.debugServer.getHostAddress(True) |
548 | if runInConsole or project.getDebugProperty("CONSOLEDEBUGGER"): | |
549 | ccmd = project.getDebugProperty( | |
550 | "CONSOLECOMMAND" | |
551 | ) or Preferences.getDebugger("ConsoleDbgCommand") | |
552 | if ccmd: | |
553 | args = Utilities.parseOptionString(ccmd) + [ | |
554 | interpreter, | |
555 | os.path.abspath(debugClient), | |
556 | ] | |
557 | if noencoding: | |
558 | args.append(noencoding) | |
559 | if multiprocessEnabled: | |
560 | args.append(multiprocessEnabled) | |
561 | if callTraceOptimization: | |
562 | args.append(callTraceOptimization) | |
563 | args.extend([str(port), "0", ipaddr]) | |
564 | args[0] = FileSystemUtilities.getExecutablePath(args[0]) | |
565 | process = self.__startProcess( | |
566 | args[0], args[1:], clientEnv, workingDir=workingDir | |
567 | ) | |
568 | if process is None: | |
569 | EricMessageBox.critical( | |
570 | None, | |
571 | self.tr("Start Debugger"), | |
572 | self.tr( | |
573 | """<p>The debugger backend could not be""" | |
574 | """ started.</p>""" | |
575 | ), | |
576 | ) | |
577 | return process, self.__isNetworked, interpreter | |
578 | ||
579 | args = [debugClient] | |
580 | if noencoding: | |
581 | args.append(noencoding) | |
582 | if multiprocessEnabled: | |
583 | args.append(multiprocessEnabled) | |
584 | if callTraceOptimization: | |
585 | args.append(callTraceOptimization) | |
586 | args.extend([str(port), redirect, ipaddr]) | |
587 | process = self.__startProcess( | |
588 | interpreter, args, clientEnv, workingDir=workingDir | |
589 | ) | |
590 | if process is None: | |
591 | self.__startedVenv = "" | |
592 | EricMessageBox.critical( | |
593 | None, | |
594 | self.tr("Start Debugger"), | |
595 | self.tr("""<p>The debugger backend could not be started.</p>"""), | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
596 | ) |
10311 | 597 | else: |
598 | self.__startedVenv = venvName | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
599 | |
10311 | 600 | return process, self.__isNetworked, interpreter |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
601 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
602 | def getClientCapabilities(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
603 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
604 | Public method to retrieve the debug clients capabilities. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
605 | |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
606 | @return debug client capabilities |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
607 | @rtype int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
608 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
609 | return self.clientCapabilities |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
610 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
611 | def newConnection(self, sock): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
612 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
613 | Public slot to handle a new connection. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
614 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
615 | @param sock reference to the socket object |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
616 | @type QTcpSocket |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
617 | @return flag indicating success |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
618 | @rtype bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
619 | """ |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
620 | self.__pendingConnections.append(sock) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
621 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
622 | sock.readyRead.connect(lambda: self.__parseClientLine(sock)) |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
623 | sock.disconnected.connect(lambda: self.__socketDisconnected(sock)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
624 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
625 | return True |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
626 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
627 | def __assignDebuggerId(self, sock, debuggerId): |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
628 | """ |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
629 | Private method to set the debugger id for a recent debugger connection |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
630 | attempt. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
631 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
632 | @param sock reference to the socket object |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
633 | @type QTcpSocket |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
634 | @param debuggerId id of the connected debug client |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
635 | @type str |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
636 | """ |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
637 | if sock in self.__pendingConnections: |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
638 | self.__connections[debuggerId] = sock |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
639 | self.__pendingConnections.remove(sock) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
640 | |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
641 | if self.__mainDebugger is None: |
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
642 | self.__mainDebugger = debuggerId |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
643 | # Get the remote clients capabilities |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
644 | self.remoteCapabilities(debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
645 | |
7412
0a995393d2ba
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7411
diff
changeset
|
646 | self.debugServer.signalClientDebuggerId(debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
647 | |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
648 | if debuggerId == self.__mainDebugger: |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
649 | self.__flush() |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
650 | self.debugServer.mainClientConnected() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
651 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
652 | self.debugServer.initializeClient(debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
653 | |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
654 | # perform auto-continue except for main |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
655 | if ( |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
656 | debuggerId != self.__mainDebugger |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
657 | and self.__autoContinue |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
658 | and not self.__isStepCommand |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
659 | ): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
660 | QTimer.singleShot(0, lambda: self.remoteContinue(debuggerId)) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
661 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
662 | def __socketDisconnected(self, sock): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
663 | """ |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
664 | Private slot handling a socket disconnecting. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
665 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
666 | @param sock reference to the disconnected socket |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
667 | @type QTcpSocket |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
668 | """ |
10517
aecd5a8c958c
Corrected some code style and formatting issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10464
diff
changeset
|
669 | for debuggerId in list(self.__connections): |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
670 | if self.__connections[debuggerId] is sock: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
671 | del self.__connections[debuggerId] |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
672 | if debuggerId == self.__mainDebugger: |
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
673 | self.__mainDebugger = None |
7409
1413bfe73d41
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7408
diff
changeset
|
674 | if debuggerId in self.__autoContinued: |
1413bfe73d41
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7408
diff
changeset
|
675 | self.__autoContinued.remove(debuggerId) |
8073
6b1c43d49dbd
DebuggerInterfacePython: added code to cope with a specific shutdown situation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7986
diff
changeset
|
676 | if not self.__inShutdown: |
9207
c0b4ca34de2f
DebuggerInterfacePython: introduced an additional safeguard against meaningless error records during shutdown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9168
diff
changeset
|
677 | with contextlib.suppress(RuntimeError): |
c0b4ca34de2f
DebuggerInterfacePython: introduced an additional safeguard against meaningless error records during shutdown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9168
diff
changeset
|
678 | # can be ignored during a shutdown |
c0b4ca34de2f
DebuggerInterfacePython: introduced an additional safeguard against meaningless error records during shutdown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9168
diff
changeset
|
679 | self.debugServer.signalClientDisconnected(debuggerId) |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
680 | break |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
681 | else: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
682 | if sock in self.__pendingConnections: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
683 | self.__pendingConnections.remove(sock) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
684 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
685 | if not self.__connections: |
7392
b6674724612a
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7390
diff
changeset
|
686 | # no active connections anymore |
8240
93b8a353c4bf
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8230
diff
changeset
|
687 | with contextlib.suppress(RuntimeError): |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7875
diff
changeset
|
688 | # debug server object might have been deleted already |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7875
diff
changeset
|
689 | # ignore this |
9428
615d367f0140
Modified the Python debugger interface to better cope with situations during shutdown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9414
diff
changeset
|
690 | self.debugServer.signalLastClientExited() |
615d367f0140
Modified the Python debugger interface to better cope with situations during shutdown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9414
diff
changeset
|
691 | self.__autoContinued.clear() |
615d367f0140
Modified the Python debugger interface to better cope with situations during shutdown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9414
diff
changeset
|
692 | if not self.__inShutdown: |
615d367f0140
Modified the Python debugger interface to better cope with situations during shutdown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9414
diff
changeset
|
693 | self.debugServer.startClient() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
694 | |
7374
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
695 | def getDebuggerIds(self): |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
696 | """ |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
697 | Public method to return the IDs of the connected debugger backends. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
698 | |
7374
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
699 | @return list of connected debugger backend IDs |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
700 | @rtype list of str |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
701 | """ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
702 | return sorted(self.__connections) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
703 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
704 | def __flush(self): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
705 | """ |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
706 | Private slot to flush the queue. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
707 | """ |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
708 | if self.__mainDebugger: |
7429
6983c461550f
DebuggerInterfacePython: added a check to handle a situation where flush() is called while the socket is still unknown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
709 | # Send commands that were waiting for the connection. |
10464
30de2b1bee37
Fixed an issue in the debugger interface causing an exception in some rare situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
710 | conn = self.__connections[self.__mainDebugger] |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
711 | for jsonStr in self.__commandQueue: |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
712 | self.__writeJsonCommandToSocket(jsonStr, conn) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
713 | |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
714 | self.__commandQueue.clear() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
715 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
716 | def shutdown(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
717 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
718 | Public method to cleanly shut down. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
719 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
720 | It closes our sockets and shuts down the debug clients. |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
721 | (Needed on Win OS) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
722 | """ |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
723 | if not self.__mainDebugger: |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
724 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
725 | |
8073
6b1c43d49dbd
DebuggerInterfacePython: added code to cope with a specific shutdown situation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7986
diff
changeset
|
726 | self.__inShutdown = True |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
727 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
728 | while self.__connections: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
729 | debuggerId, sock = self.__connections.popitem() |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
730 | self.__shutdownSocket(sock) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
731 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
732 | while self.__pendingConnections: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
733 | sock = self.__pendingConnections.pop() |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
734 | self.__shutdownSocket(sock) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
735 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
736 | # reinitialize |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
737 | self.__commandQueue.clear() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
738 | |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
739 | self.__mainDebugger = None |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
740 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
741 | def __shutdownSocket(self, sock): |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
742 | """ |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
743 | Private slot to shut down a socket. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
744 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
745 | @param sock reference to the socket |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
746 | @type QTcpSocket |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
747 | """ |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
748 | # do not want any slots called during shutdown |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
749 | sock.readyRead.disconnect() |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
750 | sock.disconnected.disconnect() |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
751 | |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
752 | # close down socket, and shut down client as well. |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
753 | self.__sendJsonCommand("RequestShutdown", {}, sock=sock) |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
754 | sock.flush() |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
755 | sock.close() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
756 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
757 | sock.setParent(None) |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
758 | sock.deleteLater() |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
759 | del sock |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
760 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
761 | def isConnected(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
762 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
763 | Public method to test, if a debug client has connected. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
764 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
765 | @return flag indicating the connection status |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
766 | @rtype bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
767 | """ |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
768 | return bool(self.__connections) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
769 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
770 | def remoteEnvironment(self, env): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
771 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
772 | Public method to set the environment for a program to debug, run, ... |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
773 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7875
diff
changeset
|
774 | @param env environment settings |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7875
diff
changeset
|
775 | @type dict |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
776 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
777 | self.__sendJsonCommand( |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
778 | "RequestEnvironment", {"environment": env}, self.__mainDebugger |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
779 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
780 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
781 | def remoteLoad( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
782 | self, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
783 | fn, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
784 | argv, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
785 | wd, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
786 | traceInterpreter=False, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
787 | autoContinue=True, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
788 | enableMultiprocess=False, |
10321 | 789 | reportAllExceptions=False, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
790 | ): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
791 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
792 | Public method to load a new program to debug. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
793 | |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
794 | @param fn filename to debug |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
795 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
796 | @param argv list of command line arguments to pass to the program |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
797 | @type list of str |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
798 | @param wd working directory for the program |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
799 | @type str |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
800 | @param traceInterpreter flag indicating if the interpreter library |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
801 | should be traced as well |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
802 | @type bool |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
803 | @param autoContinue flag indicating, that the debugger should not |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
804 | stop at the first executable line |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
805 | @type bool |
7409
1413bfe73d41
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7408
diff
changeset
|
806 | @param enableMultiprocess flag indicating to perform multiprocess |
1413bfe73d41
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7408
diff
changeset
|
807 | debugging |
1413bfe73d41
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7408
diff
changeset
|
808 | @type bool |
10321 | 809 | @param reportAllExceptions flag indicating to report all exceptions |
810 | instead of unhandled exceptions only | |
811 | @type bool | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
812 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
813 | self.__autoContinue = autoContinue |
1171
1ffefa5ca226
Improved handling of debugger sending "<string>".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1166
diff
changeset
|
814 | self.__scriptName = os.path.abspath(fn) |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
815 | self.__isStepCommand = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
816 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
817 | wd = self.translate(wd, False) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
818 | fn = self.translate(os.path.abspath(fn), False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
819 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
820 | "RequestLoad", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
821 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
822 | "workdir": wd, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
823 | "filename": fn, |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
824 | "argv": argv, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
825 | "traceInterpreter": traceInterpreter, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
826 | "multiprocess": enableMultiprocess, |
10321 | 827 | "reportAllExceptions": reportAllExceptions, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
828 | }, |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
829 | self.__mainDebugger, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
830 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
831 | |
7874
8dcb77600690
Debugger: removed the 'fork' options for the Run and Debug start options because they are obsolete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7872
diff
changeset
|
832 | def remoteRun(self, fn, argv, wd): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
833 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
834 | Public method to load a new program to run. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
835 | |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
836 | @param fn filename to run |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
837 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
838 | @param argv list of command line arguments to pass to the program |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
839 | @type list of str |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
840 | @param wd working directory for the program |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
841 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
842 | """ |
1171
1ffefa5ca226
Improved handling of debugger sending "<string>".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1166
diff
changeset
|
843 | self.__scriptName = os.path.abspath(fn) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
844 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
845 | wd = self.translate(wd, False) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
846 | fn = self.translate(os.path.abspath(fn), False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
847 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
848 | "RequestRun", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
849 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
850 | "workdir": wd, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
851 | "filename": fn, |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
852 | "argv": argv, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
853 | }, |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
854 | self.__mainDebugger, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
855 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
856 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
859
diff
changeset
|
857 | def remoteCoverage(self, fn, argv, wd, erase=False): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
858 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
859 | Public method to load a new program to collect coverage data. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
860 | |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
861 | @param fn filename to run |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
862 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
863 | @param argv list of command line arguments to pass to the program |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
864 | @type list of str |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
865 | @param wd working directory for the program |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
866 | @type str |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
867 | @param erase flag indicating that coverage info should be |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
868 | cleared first |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
869 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
870 | """ |
1171
1ffefa5ca226
Improved handling of debugger sending "<string>".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1166
diff
changeset
|
871 | self.__scriptName = os.path.abspath(fn) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
872 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
873 | wd = self.translate(wd, False) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
874 | fn = self.translate(os.path.abspath(fn), False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
875 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
876 | "RequestCoverage", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
877 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
878 | "workdir": wd, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
879 | "filename": fn, |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
880 | "argv": argv, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
881 | "erase": erase, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
882 | }, |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
883 | self.__mainDebugger, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
884 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
885 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
859
diff
changeset
|
886 | def remoteProfile(self, fn, argv, wd, erase=False): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
887 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
888 | Public method to load a new program to collect profiling data. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
889 | |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
890 | @param fn filename to run |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
891 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
892 | @param argv list of command line arguments to pass to the program |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
893 | @type list of str |
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
894 | @param wd working directory for the program |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
895 | @type str |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
896 | @param erase flag indicating that timing info should be cleared |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
897 | first |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
898 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
899 | """ |
1171
1ffefa5ca226
Improved handling of debugger sending "<string>".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1166
diff
changeset
|
900 | self.__scriptName = os.path.abspath(fn) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
901 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
902 | wd = self.translate(wd, False) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
903 | fn = self.translate(os.path.abspath(fn), False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
904 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
905 | "RequestProfile", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
906 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
907 | "workdir": wd, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
908 | "filename": fn, |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
909 | "argv": argv, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
910 | "erase": erase, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
911 | }, |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
912 | self.__mainDebugger, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
913 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
914 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
915 | def remoteStatement(self, debuggerId, stmt): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
916 | """ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
859
diff
changeset
|
917 | Public method to execute a Python statement. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
918 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
919 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
920 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
921 | @param stmt Python statement to execute. |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
922 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
923 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
924 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
925 | "ExecuteStatement", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
926 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
927 | "statement": stmt, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
928 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
929 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
930 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
931 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
932 | def remoteStep(self, debuggerId): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
933 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
934 | Public method to single step the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
935 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
936 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
937 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
938 | """ |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
939 | self.__isStepCommand = True |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
940 | self.__sendJsonCommand("RequestStep", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
941 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
942 | def remoteStepOver(self, debuggerId): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
943 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
944 | Public method to step over the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
945 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
946 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
947 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
948 | """ |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
949 | self.__isStepCommand = True |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
950 | self.__sendJsonCommand("RequestStepOver", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
951 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
952 | def remoteStepOut(self, debuggerId): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
953 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
954 | Public method to step out the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
955 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
956 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
957 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
958 | """ |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
959 | self.__isStepCommand = True |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
960 | self.__sendJsonCommand("RequestStepOut", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
961 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
962 | def remoteStepQuit(self, debuggerId): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
963 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
964 | Public method to stop the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
965 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
966 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
967 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
968 | """ |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
969 | self.__isStepCommand = True |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
970 | self.__sendJsonCommand("RequestStepQuit", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
971 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
972 | def remoteContinue(self, debuggerId, special=False): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
973 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
974 | Public method to continue the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
975 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
976 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
977 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
978 | @param special flag indicating a special continue operation |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
979 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
980 | """ |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
981 | self.__isStepCommand = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
982 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
983 | "RequestContinue", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
984 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
985 | "special": special, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
986 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
987 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
988 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
989 | |
7897
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
990 | def remoteContinueUntil(self, debuggerId, line): |
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
991 | """ |
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
992 | Public method to continue the debugged program to the given line |
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
993 | or until returning from the current frame. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
994 | |
7897
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
995 | @param debuggerId ID of the debugger backend |
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
996 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
997 | @param line new line, where execution should be continued to |
7897
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
998 | @type int |
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
999 | """ |
9acc015ea443
Debugger: added support for the "Continue Until" debug action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7882
diff
changeset
|
1000 | self.__isStepCommand = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1001 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1002 | "RequestContinueUntil", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1003 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1004 | "newLine": line, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1005 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1006 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1007 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1008 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1009 | def remoteMoveIP(self, debuggerId, line): |
5658
e5f6fe5855fd
move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
5587
diff
changeset
|
1010 | """ |
e5f6fe5855fd
move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
5587
diff
changeset
|
1011 | Public method to move the instruction pointer to a different line. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1012 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1013 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1014 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1015 | @param line new line, where execution should be continued |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1016 | @type int |
5658
e5f6fe5855fd
move the instruction pointer within the current function (Hotkey: F12)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
5587
diff
changeset
|
1017 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1018 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1019 | "RequestMoveIP", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1020 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1021 | "newLine": line, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1022 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1023 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1024 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1025 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1026 | def remoteBreakpoint( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1027 | self, debuggerId, fn, line, setBreakpoint, cond=None, temp=False |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1028 | ): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1029 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1030 | Public method to set or clear a breakpoint. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1031 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1032 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1033 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1034 | @param fn filename the breakpoint belongs to |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1035 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1036 | @param line line number of the breakpoint |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1037 | @type int |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1038 | @param setBreakpoint flag indicating setting or resetting a breakpoint |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1039 | @type bool |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1040 | @param cond condition of the breakpoint |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1041 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1042 | @param temp flag indicating a temporary breakpoint |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1043 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1044 | """ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
1045 | debuggerList = [debuggerId] if debuggerId else list(self.__connections) |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1046 | for debuggerId in debuggerList: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1047 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1048 | "RequestBreakpoint", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1049 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1050 | "filename": self.translate(fn, False), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1051 | "line": line, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1052 | "temporary": temp, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1053 | "setBreakpoint": setBreakpoint, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1054 | "condition": cond, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1055 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1056 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1057 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1058 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1059 | def remoteBreakpointEnable(self, debuggerId, fn, line, enable): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1060 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1061 | Public method to enable or disable a breakpoint. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1062 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1063 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1064 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1065 | @param fn filename the breakpoint belongs to |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1066 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1067 | @param line line number of the breakpoint |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1068 | @type int |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
1069 | @param enable flag indicating enabling or disabling a breakpoint |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1070 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1071 | """ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
1072 | debuggerList = [debuggerId] if debuggerId else list(self.__connections) |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1073 | for debuggerId in debuggerList: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1074 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1075 | "RequestBreakpointEnable", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1076 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1077 | "filename": self.translate(fn, False), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1078 | "line": line, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1079 | "enable": enable, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1080 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1081 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1082 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1083 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1084 | def remoteBreakpointIgnore(self, debuggerId, fn, line, count): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1085 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1086 | Public method to ignore a breakpoint the next couple of occurrences. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1087 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1088 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1089 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1090 | @param fn filename the breakpoint belongs to |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1091 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1092 | @param line line number of the breakpoint |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1093 | @type int |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1094 | @param count number of occurrences to ignore |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1095 | @type int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1096 | """ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
1097 | debuggerList = [debuggerId] if debuggerId else list(self.__connections) |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1098 | for debuggerId in debuggerList: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1099 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1100 | "RequestBreakpointIgnore", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1101 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1102 | "filename": self.translate(fn, False), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1103 | "line": line, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1104 | "count": count, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1105 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1106 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1107 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1108 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1109 | def remoteWatchpoint(self, debuggerId, cond, setWatch, temp=False): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1110 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1111 | Public method to set or clear a watch expression. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1112 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1113 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1114 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1115 | @param cond expression of the watch expression |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1116 | @type str |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1117 | @param setWatch flag indicating setting or resetting a watch expression |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1118 | @type bool |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1119 | @param temp flag indicating a temporary watch expression |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1120 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1121 | """ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
1122 | debuggerList = [debuggerId] if debuggerId else list(self.__connections) |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1123 | for debuggerId in debuggerList: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1124 | # cond is combination of cond and special (s. watch expression |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1125 | # viewer) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1126 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1127 | "RequestWatch", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1128 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1129 | "temporary": temp, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1130 | "setWatch": setWatch, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1131 | "condition": cond, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1132 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1133 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1134 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1135 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1136 | def remoteWatchpointEnable(self, debuggerId, cond, enable): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1137 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1138 | Public method to enable or disable a watch expression. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1139 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1140 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1141 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1142 | @param cond expression of the watch expression |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1143 | @type str |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
1144 | @param enable flag indicating enabling or disabling a watch expression |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1145 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1146 | """ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
1147 | debuggerList = [debuggerId] if debuggerId else list(self.__connections) |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1148 | for debuggerId in debuggerList: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1149 | # cond is combination of cond and special (s. watch expression |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1150 | # viewer) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1151 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1152 | "RequestWatchEnable", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1153 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1154 | "condition": cond, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1155 | "enable": enable, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1156 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1157 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1158 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1159 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1160 | def remoteWatchpointIgnore(self, debuggerId, cond, count): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1161 | """ |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
1162 | Public method to ignore a watch expression the next couple of |
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
1163 | occurrences. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1164 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1165 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1166 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1167 | @param cond expression of the watch expression |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1168 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1169 | @param count number of occurrences to ignore |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1170 | @type int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1171 | """ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10321
diff
changeset
|
1172 | debuggerList = [debuggerId] if debuggerId else list(self.__connections) |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1173 | for debuggerId in debuggerList: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1174 | # cond is combination of cond and special (s. watch expression |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1175 | # viewer) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1176 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1177 | "RequestWatchIgnore", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1178 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1179 | "condition": cond, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1180 | "count": count, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1181 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1182 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1183 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1184 | |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1185 | def remoteRawInput(self, debuggerId, inputString): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1186 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1187 | Public method to send the raw input to the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1188 | |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1189 | @param debuggerId ID of the debugger backend |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1190 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1191 | @param inputString raw input |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1192 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1193 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1194 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1195 | "RawInput", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1196 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1197 | "input": inputString, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1198 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1199 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1200 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1201 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1202 | def remoteThreadList(self, debuggerId): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1203 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1204 | Public method to request the list of threads from the client. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1205 | |
7374
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1206 | @param debuggerId ID of the debugger backend |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1207 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1208 | """ |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1209 | self.__sendJsonCommand("RequestThreadList", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1210 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1211 | def remoteSetThread(self, debuggerId, tid): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1212 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1213 | Public method to request to set the given thread as current thread. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1214 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1215 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1216 | @type str |
7374
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1217 | @param tid id of the thread |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1218 | @type int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1219 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1220 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1221 | "RequestThreadSet", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1222 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1223 | "threadID": tid, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1224 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1225 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1226 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1227 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1228 | def remoteClientStack(self, debuggerId): |
7374
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1229 | """ |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1230 | Public method to request the stack of the main thread. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1231 | |
7374
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1232 | @param debuggerId ID of the debugger backend |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1233 | @type str |
5401ae8ddaa1
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7373
diff
changeset
|
1234 | """ |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1235 | self.__sendJsonCommand("RequestStack", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1236 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1237 | def remoteClientVariables( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1238 | self, debuggerId, scope, filterList, framenr=0, maxSize=0 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1239 | ): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1240 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1241 | Public method to request the variables of the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1242 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1243 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1244 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1245 | @param scope scope of the variables (0 = local, 1 = global) |
5964
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1246 | @type int |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1247 | @param filterList list of variable types to filter out |
7862
817ef8e0fa66
Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7840
diff
changeset
|
1248 | @type list of str |
5964
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1249 | @param framenr framenumber of the variables to retrieve |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1250 | @type int |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1251 | @param maxSize maximum size the formatted value of a variable will |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1252 | be shown. If it is bigger than that, a 'too big' indication will |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1253 | be given (@@TOO_BIG_TO_SHOW@@). |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1254 | @type int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1255 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1256 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1257 | "RequestVariables", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1258 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1259 | "frameNumber": framenr, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1260 | "scope": scope, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1261 | "filters": filterList, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1262 | "maxSize": maxSize, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1263 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1264 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1265 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1266 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1267 | def remoteClientVariable( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1268 | self, debuggerId, scope, filterList, var, framenr=0, maxSize=0 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1269 | ): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1270 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1271 | Public method to request the variables of the debugged program. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1272 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1273 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1274 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1275 | @param scope scope of the variables (0 = local, 1 = global) |
5964
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1276 | @type int |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1277 | @param filterList list of variable types to filter out |
7862
817ef8e0fa66
Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7840
diff
changeset
|
1278 | @type list of str |
5964
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1279 | @param var list encoded name of variable to retrieve |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1280 | @type list of str |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1281 | @param framenr framenumber of the variables to retrieve |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1282 | @type int |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1283 | @param maxSize maximum size the formatted value of a variable will |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1284 | be shown. If it is bigger than that, a 'too big' indication will |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1285 | be given (@@TOO_BIG_TO_SHOW@@). |
066e6c78a367
Introduced a configuration option for the debugger variables viewers to limit the variables shown by the variables viewers depending on their size (in order to avoid overload situations on low power or low memory machines).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5899
diff
changeset
|
1286 | @type int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1287 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1288 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1289 | "RequestVariable", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1290 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1291 | "variable": var, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1292 | "frameNumber": framenr, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1293 | "scope": scope, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1294 | "filters": filterList, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1295 | "maxSize": maxSize, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1296 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1297 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1298 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1299 | |
7802 | 1300 | def remoteClientDisassembly(self, debuggerId): |
7707
6abcf4275d0e
Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7639
diff
changeset
|
1301 | """ |
6abcf4275d0e
Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7639
diff
changeset
|
1302 | Public method to ask the client for the latest traceback disassembly. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1303 | |
7802 | 1304 | @param debuggerId ID of the debugger backend |
1305 | @type str | |
7707
6abcf4275d0e
Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7639
diff
changeset
|
1306 | """ |
7802 | 1307 | self.__sendJsonCommand("RequestDisassembly", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1308 | |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1309 | def remoteClientSetFilter(self, debuggerId, scope, filterStr): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1310 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1311 | Public method to set a variables filter list. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1312 | |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1313 | @param debuggerId ID of the debugger backend |
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1314 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1315 | @param scope scope of the variables (0 = local, 1 = global) |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1316 | @type int |
5587
ea526b78ee6c
Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
1317 | @param filterStr regexp string for variable names to filter out |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1318 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1319 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1320 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1321 | "RequestSetFilter", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1322 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1323 | "scope": scope, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1324 | "filter": filterStr, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1325 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1326 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1327 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1328 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1329 | def setCallTraceEnabled(self, debuggerId, on): |
2170
f4e0f6133ace
Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1509
diff
changeset
|
1330 | """ |
f4e0f6133ace
Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1509
diff
changeset
|
1331 | Public method to set the call trace state. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1332 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1333 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1334 | @type str |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1335 | @param on flag indicating to enable the call trace function |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1336 | @type bool |
2170
f4e0f6133ace
Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1509
diff
changeset
|
1337 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1338 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1339 | "RequestCallTrace", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1340 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1341 | "enable": on, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1342 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1343 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1344 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1345 | |
7411
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1346 | def remoteNoDebugList(self, debuggerId, noDebugList): |
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1347 | """ |
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1348 | Public method to set a list of programs not to be debugged. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1349 | |
7411
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1350 | The programs given in the list will not be run under the control |
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1351 | of the multi process debugger. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1352 | |
7411
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1353 | @param debuggerId ID of the debugger backend |
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1354 | @type str |
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1355 | @param noDebugList list of Python programs not to be debugged |
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1356 | @type list of str |
6d8dcb3551b3
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7410
diff
changeset
|
1357 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1358 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1359 | "RequestSetNoDebugList", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1360 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1361 | "noDebug": noDebugList, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1362 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1363 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1364 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1365 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1366 | def remoteBanner(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1367 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1368 | Public slot to get the banner info of the remote client. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1369 | """ |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1370 | self.__sendJsonCommand("RequestBanner", {}) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1371 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1372 | def remoteCapabilities(self, debuggerId): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1373 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1374 | Public slot to get the debug clients capabilities. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1375 | |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1376 | @param debuggerId ID of the debugger backend |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1377 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1378 | """ |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1379 | self.__sendJsonCommand("RequestCapabilities", {}, debuggerId) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1380 | |
7408
0d58e708f57b
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7407
diff
changeset
|
1381 | def remoteCompletion(self, debuggerId, text): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1382 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1383 | Public slot to get the a list of possible commandline completions |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1384 | from the remote client. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1385 | |
7408
0d58e708f57b
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7407
diff
changeset
|
1386 | @param debuggerId ID of the debugger backend |
0d58e708f57b
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7407
diff
changeset
|
1387 | @type str |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
1388 | @param text text to be completed |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1389 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1390 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1391 | self.__sendJsonCommand( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1392 | "RequestCompletion", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1393 | { |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1394 | "text": text, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1395 | }, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1396 | debuggerId, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1397 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1398 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1399 | def __parseClientLine(self, sock): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1400 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1401 | Private method to handle data from the client. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1402 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1403 | @param sock reference to the socket to read data from |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1404 | @type QTcpSocket |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1405 | """ |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1406 | while sock and sock.bytesAvailable(): |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1407 | header = sock.read(struct.calcsize(b"!II")) |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1408 | length, datahash = struct.unpack(b"!II", header) |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1409 | |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1410 | data = bytearray() |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1411 | while len(data) < length: |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1412 | maxSize = length - len(data) |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1413 | if sock.bytesAvailable() < maxSize: |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1414 | sock.waitForReadyRead(50) |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1415 | data += sock.read(maxSize) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1416 | |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1417 | if zlib.adler32(data) & 0xFFFFFFFF != datahash: |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1418 | # corrupted data -> discard and continue |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1419 | continue |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1420 | |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1421 | jsonStr = data.decode("utf-8", "backslashreplace") |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1422 | |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1423 | logging.debug("<Debug-Server> %s", jsonStr) |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1424 | ##print("Server: ", jsonStr) ## debug # __IGNORE_WARNING_M891__ |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1425 | |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1426 | self.__handleJsonCommand(jsonStr, sock) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1427 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1428 | def __handleJsonCommand(self, jsonStr, sock): |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1429 | """ |
5129
e4ab234cf071
Cleaned up the modified code for the modernized debugger interface (Python3 variant).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5128
diff
changeset
|
1430 | Private method to handle a command or response serialized as a |
e4ab234cf071
Cleaned up the modified code for the modernized debugger interface (Python3 variant).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5128
diff
changeset
|
1431 | JSON string. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1432 | |
5129
e4ab234cf071
Cleaned up the modified code for the modernized debugger interface (Python3 variant).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5128
diff
changeset
|
1433 | @param jsonStr string containing the command or response received |
e4ab234cf071
Cleaned up the modified code for the modernized debugger interface (Python3 variant).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5128
diff
changeset
|
1434 | from the debug backend |
e4ab234cf071
Cleaned up the modified code for the modernized debugger interface (Python3 variant).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5128
diff
changeset
|
1435 | @type str |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1436 | @param sock reference to the socket the data was received from |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1437 | @type QTcpSocket |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1438 | """ |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1439 | try: |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1440 | commandDict = json.loads(jsonStr.strip()) |
5162
bbf2bb2d533c
Fixed an issue in the new debugger protocol because JSONDecodeError is defined for Python 3.5 and newer only.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5140
diff
changeset
|
1441 | except (TypeError, ValueError) as err: |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8322
diff
changeset
|
1442 | EricMessageBox.critical( |
5137
089401c122c5
Added reporting for JSON decoding errors in the debugger interfaces and updated translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5136
diff
changeset
|
1443 | None, |
089401c122c5
Added reporting for JSON decoding errors in the debugger interfaces and updated translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5136
diff
changeset
|
1444 | self.tr("Debug Protocol Error"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1445 | self.tr( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1446 | """<p>The response received from the debugger""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1447 | """ backend could not be decoded. Please report""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1448 | """ this issue with the received data to the""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1449 | """ eric bugs email address.</p>""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1450 | """<p>Error: {0}</p>""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1451 | """<p>Data:<br/>{1}</p>""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1452 | ).format(str(err), Utilities.html_encode(jsonStr.strip())), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1453 | EricMessageBox.Ok, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1454 | ) |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1455 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1456 | |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1457 | method = commandDict["method"] |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1458 | params = commandDict["params"] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1459 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1460 | if method == "DebuggerId": |
7373
d036d72f457c
Changed 'id' to 'debuggerId'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7372
diff
changeset
|
1461 | self.__assignDebuggerId(sock, params["debuggerId"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1462 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1463 | elif method == "ClientOutput": |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1464 | self.debugServer.signalClientOutput(params["text"], params["debuggerId"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1465 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1466 | elif method in ["ResponseLine", "ResponseStack"]: |
7872
433dacbfa456
Python debug client: added the multi process extension for the process creation functions in the 'os', '_posixsubprocess' and Windows '_subprocess' or '_winapi' modules.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7871
diff
changeset
|
1467 | # Check if obsolete thread was clicked |
5269
0e96e1557c45
Fix for PyPy showing no local variables and suppress exception on old frames.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
5247
diff
changeset
|
1468 | if params["stack"] == []: |
0e96e1557c45
Fix for PyPy showing no local variables and suppress exception on old frames.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
5247
diff
changeset
|
1469 | # Request updated list |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1470 | self.remoteThreadList(params["debuggerId"]) |
5269
0e96e1557c45
Fix for PyPy showing no local variables and suppress exception on old frames.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
5247
diff
changeset
|
1471 | return |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1472 | for s in params["stack"]: |
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1473 | s[0] = self.translate(s[0], True) |
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1474 | cf = params["stack"][0] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1475 | if self.__autoContinue and params["debuggerId"] not in self.__autoContinued: |
7407
a0b6acee2c20
Continued with the multiprocess debugger. Started with QProcess support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7394
diff
changeset
|
1476 | self.__autoContinued.append(params["debuggerId"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1477 | QTimer.singleShot(0, lambda: self.remoteContinue(params["debuggerId"])) |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1478 | else: |
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1479 | self.debugServer.signalClientLine( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1480 | cf[0], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1481 | int(cf[1]), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1482 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1483 | method == "ResponseStack", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1484 | threadName=params["threadName"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1485 | ) |
7377
cc920e534ac0
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7376
diff
changeset
|
1486 | self.debugServer.signalClientStack( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1487 | params["stack"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1488 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1489 | threadName=params["threadName"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1490 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1491 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1492 | elif method == "CallTrace": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1493 | isCall = params["event"].lower() == "c" |
5140
01484c0afbc6
Worked on the last TODOs for the modernized debugger protocol.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5137
diff
changeset
|
1494 | fromInfo = params["from"] |
01484c0afbc6
Worked on the last TODOs for the modernized debugger protocol.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5137
diff
changeset
|
1495 | toInfo = params["to"] |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1496 | self.debugServer.signalClientCallTrace( |
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1497 | isCall, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1498 | fromInfo["filename"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1499 | str(fromInfo["linenumber"]), |
5140
01484c0afbc6
Worked on the last TODOs for the modernized debugger protocol.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5137
diff
changeset
|
1500 | fromInfo["codename"], |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1501 | toInfo["filename"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1502 | str(toInfo["linenumber"]), |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1503 | toInfo["codename"], |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1504 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1505 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1506 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1507 | elif method == "ResponseVariables": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1508 | self.debugServer.signalClientVariables( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1509 | params["scope"], params["variables"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1510 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1511 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1512 | elif method == "ResponseVariable": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1513 | self.debugServer.signalClientVariable( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1514 | params["scope"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1515 | [params["variable"]] + params["variables"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1516 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1517 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1518 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1519 | elif method == "ResponseThreadList": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1520 | self.debugServer.signalClientThreadList( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1521 | params["currentID"], params["threadList"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1522 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1523 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1524 | elif method == "ResponseThreadSet": |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1525 | self.debugServer.signalClientThreadSet(params["debuggerId"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1526 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1527 | elif method == "ResponseCapabilities": |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1528 | self.clientCapabilities = params["capabilities"] |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
1529 | if params["debuggerId"] == self.__mainDebugger: |
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
1530 | # signal only for the main connection |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1531 | self.debugServer.signalClientCapabilities( |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1532 | params["capabilities"], |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1533 | params["clientType"], |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1534 | self.__startedVenv, |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1535 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1536 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1537 | elif method == "ResponseBanner": |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
1538 | if params["debuggerId"] == self.__mainDebugger: |
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
1539 | # signal only for the main connection |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1540 | self.debugServer.signalClientBanner( |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1541 | params["version"], |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1542 | params["platform"], |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1543 | self.__startedVenv, |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1544 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1545 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1546 | elif method == "ResponseOK": |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1547 | self.debugServer.signalClientStatement(False, params["debuggerId"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1548 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1549 | elif method == "ResponseContinue": |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1550 | self.debugServer.signalClientStatement(True, params["debuggerId"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1551 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1552 | elif method == "RequestRaw": |
5120
c5189d404cc7
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5119
diff
changeset
|
1553 | self.debugServer.signalClientRawInput( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1554 | params["prompt"], params["echo"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1555 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1556 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1557 | elif method == "ResponseBPConditionError": |
5131
889ed5ff7a68
Fixed a few issues in the modernized Python 3 debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5129
diff
changeset
|
1558 | fn = self.translate(params["filename"], True) |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1559 | self.debugServer.signalClientBreakConditionError( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1560 | fn, params["line"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1561 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1562 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1563 | elif method == "ResponseClearBreakpoint": |
5131
889ed5ff7a68
Fixed a few issues in the modernized Python 3 debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5129
diff
changeset
|
1564 | fn = self.translate(params["filename"], True) |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1565 | self.debugServer.signalClientClearBreak( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1566 | fn, params["line"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1567 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1568 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1569 | elif method == "ResponseWatchConditionError": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1570 | self.debugServer.signalClientWatchConditionError( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1571 | params["condition"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1572 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1573 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1574 | elif method == "ResponseClearWatch": |
7389
770ffcb88be5
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7379
diff
changeset
|
1575 | self.debugServer.signalClientClearWatch( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1576 | params["condition"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1577 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1578 | |
7707
6abcf4275d0e
Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7639
diff
changeset
|
1579 | elif method == "ResponseDisassembly": |
7802 | 1580 | self.debugServer.signalClientDisassembly( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1581 | params["disassembly"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1582 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1583 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1584 | elif method == "ResponseException": |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1585 | exctype = params["type"] |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1586 | excmessage = params["message"] |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1587 | stack = params["stack"] |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1588 | if stack: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1589 | for stackEntry in stack: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1590 | stackEntry[0] = self.translate(stackEntry[0], True) |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1591 | if stack[0] and stack[0][0] == "<string>": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1592 | for stackEntry in stack: |
7379
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1593 | if stackEntry[0] == "<string>": |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1594 | stackEntry[0] = self.__scriptName |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1595 | else: |
72a72fd56494
Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7377
diff
changeset
|
1596 | break |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1597 | |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1598 | self.debugServer.signalClientException( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1599 | exctype, excmessage, stack, params["debuggerId"], params["threadName"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1600 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1601 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1602 | elif method == "ResponseSyntax": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1603 | self.debugServer.signalClientSyntaxError( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1604 | params["message"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1605 | self.translate(params["filename"], True), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1606 | params["linenumber"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1607 | params["characternumber"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1608 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1609 | params["threadName"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1610 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1611 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1612 | elif method == "ResponseSignal": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1613 | self.debugServer.signalClientSignal( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1614 | params["message"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1615 | self.translate(params["filename"], True), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1616 | params["linenumber"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1617 | params["function"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1618 | params["arguments"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1619 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1620 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1621 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1622 | elif method == "ResponseExit": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1623 | self.__scriptName = "" |
5136
b1dde2dc14bd
Improved the handling of debug client exits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5131
diff
changeset
|
1624 | self.debugServer.signalClientExit( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1625 | params["program"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1626 | params["status"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1627 | params["message"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1628 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1629 | ) |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
1630 | if params["debuggerId"] == self.__mainDebugger: |
8138
169e65a6787c
Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8075
diff
changeset
|
1631 | self.debugServer.signalMainClientExit() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1632 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1633 | elif method == "PassiveStartup": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1634 | self.debugServer.passiveStartUp( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1635 | self.translate(params["filename"], True), |
10321 | 1636 | params["reportAllExceptions"], |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1637 | params["debuggerId"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1638 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1639 | |
5128
b6cbdba69967
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5125
diff
changeset
|
1640 | elif method == "ResponseCompletion": |
5124
1ba8ee313b57
Continued modernizing the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5120
diff
changeset
|
1641 | self.debugServer.signalClientCompletionList( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1642 | params["completions"], params["text"], params["debuggerId"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1643 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1644 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1645 | def __sendJsonCommand(self, command, params, debuggerId="", sock=None): |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1646 | """ |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1647 | Private method to send a single command to the client. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1648 | |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1649 | @param command command name to be sent |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1650 | @type str |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1651 | @param params dictionary of named parameters for the command |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1652 | @type dict |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1653 | @param debuggerId id of the debug client to send the command to |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1654 | @type str |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1655 | @param sock reference to the socket object to be used (only used if |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1656 | debuggerId is not given) |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1657 | @type QTcpSocket |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1658 | """ |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1659 | commandDict = { |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1660 | "jsonrpc": "2.0", |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1661 | "method": command, |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1662 | "params": params, |
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1663 | } |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1664 | jsonStr = json.dumps(commandDict) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1665 | |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1666 | if debuggerId and debuggerId in self.__connections: |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1667 | sock = self.__connections[debuggerId] |
9971
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
1668 | elif sock is None and self.__mainDebugger is not None: |
773ad1f1ed22
Performed some 'ethical' changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
1669 | sock = self.__connections[self.__mainDebugger] |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1670 | if sock is not None: |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1671 | self.__writeJsonCommandToSocket(jsonStr, sock) |
5119
80bd41498eef
Started with the modernization of the debugger interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5059
diff
changeset
|
1672 | else: |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1673 | self.__commandQueue.append(jsonStr) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1674 | |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1675 | def __writeJsonCommandToSocket(self, jsonCommand, sock): |
5966
3325ecd87c7c
Fixed an issue in the debugger backend related to debugging threads.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5964
diff
changeset
|
1676 | """ |
3325ecd87c7c
Fixed an issue in the debugger backend related to debugging threads.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5964
diff
changeset
|
1677 | Private method to write a JSON command to the socket. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1678 | |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1679 | @param jsonCommand JSON encoded command to be sent |
5966
3325ecd87c7c
Fixed an issue in the debugger backend related to debugging threads.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5964
diff
changeset
|
1680 | @type str |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1681 | @param sock reference to the socket to write to |
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1682 | @type QTcpSocket |
5966
3325ecd87c7c
Fixed an issue in the debugger backend related to debugging threads.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5964
diff
changeset
|
1683 | """ |
10552
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1684 | data = jsonCommand.encode("utf8", "backslashreplace") |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1685 | header = struct.pack(b"!II", len(data), zlib.adler32(data) & 0xFFFFFFFF) |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1686 | sock.write(header) |
c5b0c8a5fa7d
Changed the interface to the debug client to make it a bit more robust and harmonize it with other such interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10517
diff
changeset
|
1687 | sock.write(data) |
7372
021f0252afac
Started the attempt to implement a multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1688 | sock.flush() |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1689 | |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1690 | |
4553
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1691 | def createDebuggerInterfacePython3(debugServer, passive): |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1692 | """ |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1693 | Module function to create a debugger interface instance. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1694 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1695 | |
4553
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1696 | @param debugServer reference to the debug server |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1697 | @type DebugServer |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1698 | @param passive flag indicating passive connection mode |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1699 | @type bool |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1700 | @return instantiated debugger interface |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1701 | @rtype DebuggerInterfacePython |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1702 | """ |
7635
0cdead130a81
Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7429
diff
changeset
|
1703 | return DebuggerInterfacePython(debugServer, passive) |
4553
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1704 | |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1705 | |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1706 | def getRegistryData(): |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1707 | """ |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1708 | Module function to get characterizing data for the supported debugger |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1709 | interfaces. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1710 | |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1711 | @return list of tuples containing the client type, the client capabilities, |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1712 | the client file type associations and a reference to the creation |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1713 | function |
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1714 | @rtype list of tuple of (str, int, list of str, function) |
4553
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1715 | """ |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1716 | py3Exts = [] |
4553
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1717 | for ext in Preferences.getDebugger("Python3Extensions").split(): |
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1718 | if ext.startswith("."): |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1719 | py3Exts.append(ext) |
4553
a6b2acd1a355
Added a debugger interface registry to allow debuggers being implemented as plug-ins and removed the defunct Ruby debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4366
diff
changeset
|
1720 | else: |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1721 | py3Exts.append(".{0}".format(ext)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1722 | |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1723 | registryData = [] |
7637
c878e8255972
Removed some more Python2 related code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7635
diff
changeset
|
1724 | if py3Exts: |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1725 | registryData.append( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1726 | ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1727 | "Python3", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1728 | ClientDefaultCapabilities, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1729 | py3Exts, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1730 | createDebuggerInterfacePython3, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1731 | ) |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1732 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1733 | |
5850
7fae79975686
Unified the Python2 and Python3 debugger interfaces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5848
diff
changeset
|
1734 | return registryData |