179 # The list of regexp objects to filter variables against |
179 # The list of regexp objects to filter variables against |
180 self.globalsFilterObjects = [] |
180 self.globalsFilterObjects = [] |
181 self.localsFilterObjects = [] |
181 self.localsFilterObjects = [] |
182 |
182 |
183 self.pendingResponse = DebugProtocol.ResponseOK |
183 self.pendingResponse = DebugProtocol.ResponseOK |
184 self.fncache = {} |
184 self._fncache = {} |
185 self.dircache = [] |
185 self.dircache = [] |
186 self.inRawMode = False |
186 self.inRawMode = False |
187 self.mainProcStr = None # used for the passive mode |
187 self.mainProcStr = None # used for the passive mode |
188 self.passive = False # used to indicate the passive mode |
188 self.passive = False # used to indicate the passive mode |
189 self.running = None |
189 self.running = None |
1116 """ |
1116 """ |
1117 if os.path.isabs(fn): |
1117 if os.path.isabs(fn): |
1118 return fn |
1118 return fn |
1119 |
1119 |
1120 # Check the cache. |
1120 # Check the cache. |
1121 if fn in self.fncache: |
1121 if fn in self._fncache: |
1122 return self.fncache[fn] |
1122 return self._fncache[fn] |
1123 |
1123 |
1124 # Search sys.path. |
1124 # Search sys.path. |
1125 for p in sys.path: |
1125 for p in sys.path: |
1126 afn = os.path.abspath(os.path.join(p, fn)) |
1126 afn = os.path.abspath(os.path.join(p, fn)) |
1127 nafn = os.path.normcase(afn) |
1127 nafn = os.path.normcase(afn) |
1128 |
1128 |
1129 if os.path.exists(nafn): |
1129 if os.path.exists(nafn): |
1130 self.fncache[fn] = afn |
1130 self._fncache[fn] = afn |
1131 d = os.path.dirname(afn) |
1131 d = os.path.dirname(afn) |
1132 if (d not in sys.path) and (d not in self.dircache): |
1132 if (d not in sys.path) and (d not in self.dircache): |
1133 self.dircache.append(d) |
1133 self.dircache.append(d) |
1134 return afn |
1134 return afn |
1135 |
1135 |
1137 for p in self.dircache: |
1137 for p in self.dircache: |
1138 afn = os.path.abspath(os.path.join(p, fn)) |
1138 afn = os.path.abspath(os.path.join(p, fn)) |
1139 nafn = os.path.normcase(afn) |
1139 nafn = os.path.normcase(afn) |
1140 |
1140 |
1141 if os.path.exists(nafn): |
1141 if os.path.exists(nafn): |
1142 self.fncache[fn] = afn |
1142 self._fncache[fn] = afn |
1143 return afn |
1143 return afn |
1144 |
1144 |
1145 # Nothing found. |
1145 # Nothing found. |
1146 return fn |
1146 return fn |
1147 |
1147 |
1763 self.write("{0}{1}|{2:d}\n".format(DebugProtocol.PassiveStartup, |
1763 self.write("{0}{1}|{2:d}\n".format(DebugProtocol.PassiveStartup, |
1764 self.running, exceptions)) |
1764 self.running, exceptions)) |
1765 self.__interact() |
1765 self.__interact() |
1766 |
1766 |
1767 # setup the debugger variables |
1767 # setup the debugger variables |
1768 self.fncache = {} |
1768 self._fncache = {} |
1769 self.dircache = [] |
1769 self.dircache = [] |
1770 self.mainFrame = None |
1770 self.mainFrame = None |
1771 self.inRawMode = False |
1771 self.inRawMode = False |
1772 self.debugging = True |
1772 self.debugging = True |
1773 |
1773 |
1802 port = os.getenv('ERICPORT', 42424) |
1802 port = os.getenv('ERICPORT', 42424) |
1803 |
1803 |
1804 remoteAddress = self.__resolveHost(host) |
1804 remoteAddress = self.__resolveHost(host) |
1805 self.connectDebugger(port, remoteAddress, redirect) |
1805 self.connectDebugger(port, remoteAddress, redirect) |
1806 |
1806 |
1807 self.fncache = {} |
1807 self._fncache = {} |
1808 self.dircache = [] |
1808 self.dircache = [] |
1809 sys.argv = progargs[:] |
1809 sys.argv = progargs[:] |
1810 sys.argv[0] = os.path.abspath(sys.argv[0]) |
1810 sys.argv[0] = os.path.abspath(sys.argv[0]) |
1811 sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) |
1811 sys.path = self.__getSysPath(os.path.dirname(sys.argv[0])) |
1812 if wd == '': |
1812 if wd == '': |