73 if passive: |
73 if passive: |
74 # set translation function |
74 # set translation function |
75 if Preferences.getDebugger("PathTranslation"): |
75 if Preferences.getDebugger("PathTranslation"): |
76 self.translateRemote = \ |
76 self.translateRemote = \ |
77 Preferences.getDebugger("PathTranslationRemote") |
77 Preferences.getDebugger("PathTranslationRemote") |
|
78 self.translateRemoteWindows = "\\" in self.translateRemote |
78 self.translateLocal = \ |
79 self.translateLocal = \ |
79 Preferences.getDebugger("PathTranslationLocal") |
80 Preferences.getDebugger("PathTranslationLocal") |
|
81 self.translateLocalWindows = "\\" in self.translateLocal |
80 self.translate = self.__remoteTranslation |
82 self.translate = self.__remoteTranslation |
81 else: |
83 else: |
82 self.translate = self.__identityTranslation |
84 self.translate = self.__identityTranslation |
83 |
85 |
84 # attribute to remember the name of the executed script |
86 # attribute to remember the name of the executed script |
102 @param fn filename to be translated (string) |
104 @param fn filename to be translated (string) |
103 @param remote2local flag indicating the direction of translation |
105 @param remote2local flag indicating the direction of translation |
104 (False = local to remote, True = remote to local [default]) |
106 (False = local to remote, True = remote to local [default]) |
105 @return translated filename (string) |
107 @return translated filename (string) |
106 """ |
108 """ |
107 # TODO: remote translation must translate os.sep as well |
|
108 if remote2local: |
109 if remote2local: |
109 return fn.replace(self.translateRemote, self.translateLocal) |
110 path = fn.replace(self.translateRemote, self.translateLocal) |
|
111 if self.translateLocalWindows: |
|
112 path = path.replace("/", "\\") |
110 else: |
113 else: |
111 return fn.replace(self.translateLocal, self.translateRemote) |
114 path = fn.replace(self.translateLocal, self.translateRemote) |
|
115 if not self.translateRemoteWindows: |
|
116 path = path.replace("\\", "/") |
|
117 |
|
118 return path |
112 |
119 |
113 def __startProcess(self, program, arguments, environment=None, |
120 def __startProcess(self, program, arguments, environment=None, |
114 workingDir=None): |
121 workingDir=None): |
115 """ |
122 """ |
116 Private method to start the debugger client process. |
123 Private method to start the debugger client process. |
234 |
241 |
235 # set translation function |
242 # set translation function |
236 if Preferences.getDebugger("PathTranslation"): |
243 if Preferences.getDebugger("PathTranslation"): |
237 self.translateRemote = \ |
244 self.translateRemote = \ |
238 Preferences.getDebugger("PathTranslationRemote") |
245 Preferences.getDebugger("PathTranslationRemote") |
|
246 self.translateRemoteWindows = "\\" in self.translateRemote |
239 self.translateLocal = \ |
247 self.translateLocal = \ |
240 Preferences.getDebugger("PathTranslationLocal") |
248 Preferences.getDebugger("PathTranslationLocal") |
241 self.translate = self.__remoteTranslation |
249 self.translate = self.__remoteTranslation |
|
250 self.translateLocalWindows = "\\" in self.translateLocal |
242 else: |
251 else: |
243 self.translate = self.__identityTranslation |
252 self.translate = self.__identityTranslation |
244 return process, self.__isNetworked, "" |
253 return process, self.__isNetworked, "" |
245 |
254 |
246 # set translation function |
255 # set translation function |
384 """ started.</p>""")) |
393 """ started.</p>""")) |
385 # set translation function |
394 # set translation function |
386 if project.getDebugProperty("PATHTRANSLATION"): |
395 if project.getDebugProperty("PATHTRANSLATION"): |
387 self.translateRemote = \ |
396 self.translateRemote = \ |
388 project.getDebugProperty("REMOTEPATH") |
397 project.getDebugProperty("REMOTEPATH") |
|
398 self.translateRemoteWindows = "\\" in self.translateRemote |
389 self.translateLocal = \ |
399 self.translateLocal = \ |
390 project.getDebugProperty("LOCALPATH") |
400 project.getDebugProperty("LOCALPATH") |
|
401 self.translateLocalWindows = "\\" in self.translateLocal |
391 self.translate = self.__remoteTranslation |
402 self.translate = self.__remoteTranslation |
392 else: |
403 else: |
393 self.translate = self.__identityTranslation |
404 self.translate = self.__identityTranslation |
394 return process, self.__isNetworked, "" |
405 return process, self.__isNetworked, "" |
395 else: |
406 else: |