eric6/DebugClients/Python/DebugClientBase.py

branch
multi_processing
changeset 7405
bf6be3cff6cf
parent 7403
7446a7eacfc3
child 7407
a0b6acee2c20
equal deleted inserted replaced
7404:663f1c3d6f53 7405:bf6be3cff6cf
2011 except Exception: 2011 except Exception:
2012 comp = None 2012 comp = None
2013 2013
2014 def startDebugger(self, filename=None, host=None, port=None, 2014 def startDebugger(self, filename=None, host=None, port=None,
2015 enableTrace=True, exceptions=True, tracePython=False, 2015 enableTrace=True, exceptions=True, tracePython=False,
2016 redirect=True): 2016 redirect=True, passive=True):
2017 """ 2017 """
2018 Public method used to start the remote debugger. 2018 Public method used to start the remote debugger.
2019 2019
2020 @param filename the program to be debugged (string) 2020 @param filename the program to be debugged
2021 @param host hostname of the debug server (string) 2021 @type str
2022 @param port portnumber of the debug server (int) 2022 @param host hostname of the debug server
2023 @param enableTrace flag to enable the tracing function (boolean) 2023 @type str
2024 @param port portnumber of the debug server
2025 @type int
2026 @param enableTrace flag to enable the tracing function
2027 @type bool
2024 @param exceptions flag to enable exception reporting of the IDE 2028 @param exceptions flag to enable exception reporting of the IDE
2025 (boolean) 2029 @type bool
2026 @param tracePython flag to enable tracing into the Python library 2030 @param tracePython flag to enable tracing into the Python library
2027 (boolean) 2031 @type bool
2028 @param redirect flag indicating redirection of stdin, stdout and 2032 @param redirect flag indicating redirection of stdin, stdout and
2029 stderr (boolean) 2033 stderr
2034 @type bool
2035 @param passive flag indicating a passive debugging session
2036 @type bool
2030 """ 2037 """
2031 if host is None: 2038 if host is None:
2032 host = os.getenv('ERICHOST', 'localhost') 2039 host = os.getenv('ERICHOST', 'localhost')
2033 if port is None: 2040 if port is None:
2034 port = os.getenv('ERICPORT', 42424) 2041 port = os.getenv('ERICPORT', 42424)
2042 self.running = os.path.abspath(sys.argv[0]) 2049 self.running = os.path.abspath(sys.argv[0])
2043 except IndexError: 2050 except IndexError:
2044 self.running = None 2051 self.running = None
2045 if self.running: 2052 if self.running:
2046 self.__setCoding(self.running) 2053 self.__setCoding(self.running)
2047 self.passive = True 2054 self.passive = passive
2048 self.sendPassiveStartup(self.running, exceptions) 2055 if passive:
2056 self.sendPassiveStartup(self.running, exceptions)
2049 self.__interact() 2057 self.__interact()
2050 2058
2051 # setup the debugger variables 2059 # setup the debugger variables
2052 self._fncache = {} 2060 self._fncache = {}
2053 self.dircache = [] 2061 self.dircache = []
2302 # child 2310 # child
2303 if not self.fork_child: 2311 if not self.fork_child:
2304 sys.settrace(None) 2312 sys.settrace(None)
2305 sys.setprofile(None) 2313 sys.setprofile(None)
2306 self.sessionClose(False) 2314 self.sessionClose(False)
2315 ## (wd, host, port, exceptions, tracePython, redirect,
2316 ## noencoding, fork_auto, fork_child) = self.startOptions
2317 ## self.startDebugger(sys.argv[0], host, port,
2318 ## exceptions=exceptions,
2319 ## tracePython=tracePython,
2320 ## redirect=redirect,
2321 ## passive=False)
2307 else: 2322 else:
2308 # parent 2323 # parent
2309 if self.fork_child: 2324 if self.fork_child:
2310 sys.settrace(None) 2325 sys.settrace(None)
2311 sys.setprofile(None) 2326 sys.setprofile(None)

eric ide

mercurial