148 debugServer.clientSyntaxError.connect(self.__clientSyntaxError) |
171 debugServer.clientSyntaxError.connect(self.__clientSyntaxError) |
149 debugServer.clientException.connect(self.__clientException) |
172 debugServer.clientException.connect(self.__clientException) |
150 debugServer.clientSignal.connect(self.__clientSignal) |
173 debugServer.clientSignal.connect(self.__clientSignal) |
151 debugServer.clientVariables.connect(self.__clientVariables) |
174 debugServer.clientVariables.connect(self.__clientVariables) |
152 debugServer.clientVariable.connect(self.__clientVariable) |
175 debugServer.clientVariable.connect(self.__clientVariable) |
153 debugServer.clientBreakConditionError.connect( |
176 debugServer.clientBreakConditionError.connect(self.__clientBreakConditionError) |
154 self.__clientBreakConditionError) |
177 debugServer.clientWatchConditionError.connect(self.__clientWatchConditionError) |
155 debugServer.clientWatchConditionError.connect( |
|
156 self.__clientWatchConditionError) |
|
157 debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted) |
178 debugServer.passiveDebugStarted.connect(self.__passiveDebugStarted) |
158 debugServer.clientThreadSet.connect(self.__clientThreadSet) |
179 debugServer.clientThreadSet.connect(self.__clientThreadSet) |
159 debugServer.clientDebuggerId.connect(self.__clientDebuggerId) |
180 debugServer.clientDebuggerId.connect(self.__clientDebuggerId) |
160 |
181 |
161 # Connect the signals emitted by the viewmanager |
182 # Connect the signals emitted by the viewmanager |
162 vm.editorOpened.connect(self.__editorOpened) |
183 vm.editorOpened.connect(self.__editorOpened) |
163 vm.lastEditorClosed.connect(self.__lastEditorClosed) |
184 vm.lastEditorClosed.connect(self.__lastEditorClosed) |
164 vm.checkActions.connect(self.__checkActions) |
185 vm.checkActions.connect(self.__checkActions) |
165 vm.cursorChanged.connect(self.__cursorChanged) |
186 vm.cursorChanged.connect(self.__cursorChanged) |
166 vm.breakpointToggled.connect(self.__cursorChanged) |
187 vm.breakpointToggled.connect(self.__cursorChanged) |
167 |
188 |
168 # Connect the signals emitted by the project |
189 # Connect the signals emitted by the project |
169 project.projectOpened.connect(self.__projectOpened) |
190 project.projectOpened.connect(self.__projectOpened) |
170 project.newProject.connect(self.__projectOpened) |
191 project.newProject.connect(self.__projectOpened) |
171 project.projectClosed.connect(self.__projectClosed) |
192 project.projectClosed.connect(self.__projectClosed) |
172 |
193 |
173 # Set a flag for the passive debug mode |
194 # Set a flag for the passive debug mode |
174 self.passive = Preferences.getDebugger("PassiveDbgEnabled") |
195 self.passive = Preferences.getDebugger("PassiveDbgEnabled") |
175 |
196 |
176 def showNotification(self, notification, |
197 def showNotification( |
177 kind=NotificationTypes.INFORMATION, timeout=None): |
198 self, notification, kind=NotificationTypes.INFORMATION, timeout=None |
|
199 ): |
178 """ |
200 """ |
179 Public method to show some notification message. |
201 Public method to show some notification message. |
180 |
202 |
181 @param notification message to be shown |
203 @param notification message to be shown |
182 @type str |
204 @type str |
183 @param kind kind of notification to be shown |
205 @param kind kind of notification to be shown |
184 @type NotificationTypes |
206 @type NotificationTypes |
185 @param timeout timeout for the notification (None = use configured |
207 @param timeout timeout for the notification (None = use configured |
186 default, 0 = indefinitely) |
208 default, 0 = indefinitely) |
187 @type int |
209 @type int |
188 """ |
210 """ |
189 self.ui.showNotification( |
211 self.ui.showNotification( |
190 UI.PixmapCache.getPixmap("debug48"), |
212 UI.PixmapCache.getPixmap("debug48"), |
191 self.tr("Notification"), notification, kind=kind, timeout=timeout) |
213 self.tr("Notification"), |
192 |
214 notification, |
|
215 kind=kind, |
|
216 timeout=timeout, |
|
217 ) |
|
218 |
193 def variablesFilter(self, scope): |
219 def variablesFilter(self, scope): |
194 """ |
220 """ |
195 Public method to get the variables filter for a scope. |
221 Public method to get the variables filter for a scope. |
196 |
222 |
197 @param scope flag indicating global (True) or local (False) scope |
223 @param scope flag indicating global (True) or local (False) scope |
198 @return filters list |
224 @return filters list |
199 @rtype list of str |
225 @rtype list of str |
200 """ |
226 """ |
201 if scope: |
227 if scope: |
202 return self.__globalsVarFilterList[:] |
228 return self.__globalsVarFilterList[:] |
203 else: |
229 else: |
204 return self.__localsVarFilterList[:] |
230 return self.__localsVarFilterList[:] |
205 |
231 |
206 def initActions(self): |
232 def initActions(self): |
207 """ |
233 """ |
208 Public method defining the user interface actions. |
234 Public method defining the user interface actions. |
209 """ |
235 """ |
210 self.actions = [] |
236 self.actions = [] |
211 |
237 |
212 self.runAct = EricAction( |
238 self.runAct = EricAction( |
213 self.tr('Run Script'), |
239 self.tr("Run Script"), |
214 UI.PixmapCache.getIcon("runScript"), |
240 UI.PixmapCache.getIcon("runScript"), |
215 self.tr('&Run Script...'), |
241 self.tr("&Run Script..."), |
216 Qt.Key.Key_F2, 0, self, 'dbg_run_script') |
242 Qt.Key.Key_F2, |
217 self.runAct.setStatusTip(self.tr('Run the current Script')) |
243 0, |
218 self.runAct.setWhatsThis(self.tr( |
244 self, |
219 """<b>Run Script</b>""" |
245 "dbg_run_script", |
220 """<p>Set the command line arguments and run the script outside""" |
246 ) |
221 """ the debugger. If the file has unsaved changes it may be""" |
247 self.runAct.setStatusTip(self.tr("Run the current Script")) |
222 """ saved first.</p>""" |
248 self.runAct.setWhatsThis( |
223 )) |
249 self.tr( |
|
250 """<b>Run Script</b>""" |
|
251 """<p>Set the command line arguments and run the script outside""" |
|
252 """ the debugger. If the file has unsaved changes it may be""" |
|
253 """ saved first.</p>""" |
|
254 ) |
|
255 ) |
224 self.runAct.triggered.connect(self.__runScript) |
256 self.runAct.triggered.connect(self.__runScript) |
225 self.actions.append(self.runAct) |
257 self.actions.append(self.runAct) |
226 |
258 |
227 self.runProjectAct = EricAction( |
259 self.runProjectAct = EricAction( |
228 self.tr('Run Project'), |
260 self.tr("Run Project"), |
229 UI.PixmapCache.getIcon("runProject"), |
261 UI.PixmapCache.getIcon("runProject"), |
230 self.tr('Run &Project...'), |
262 self.tr("Run &Project..."), |
231 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F2), |
263 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F2), |
232 0, self, 'dbg_run_project') |
264 0, |
233 self.runProjectAct.setStatusTip(self.tr('Run the current Project')) |
265 self, |
234 self.runProjectAct.setWhatsThis(self.tr( |
266 "dbg_run_project", |
235 """<b>Run Project</b>""" |
267 ) |
236 """<p>Set the command line arguments and run the current project""" |
268 self.runProjectAct.setStatusTip(self.tr("Run the current Project")) |
237 """ outside the debugger.""" |
269 self.runProjectAct.setWhatsThis( |
238 """ If files of the current project have unsaved changes they""" |
270 self.tr( |
239 """ may be saved first.</p>""" |
271 """<b>Run Project</b>""" |
240 )) |
272 """<p>Set the command line arguments and run the current project""" |
|
273 """ outside the debugger.""" |
|
274 """ If files of the current project have unsaved changes they""" |
|
275 """ may be saved first.</p>""" |
|
276 ) |
|
277 ) |
241 self.runProjectAct.triggered.connect(self.__runProject) |
278 self.runProjectAct.triggered.connect(self.__runProject) |
242 self.actions.append(self.runProjectAct) |
279 self.actions.append(self.runProjectAct) |
243 |
280 |
244 self.coverageAct = EricAction( |
281 self.coverageAct = EricAction( |
245 self.tr('Coverage run of Script'), |
282 self.tr("Coverage run of Script"), |
246 UI.PixmapCache.getIcon("coverageScript"), |
283 UI.PixmapCache.getIcon("coverageScript"), |
247 self.tr('Coverage run of Script...'), 0, 0, self, |
284 self.tr("Coverage run of Script..."), |
248 'dbg_coverage_script') |
285 0, |
|
286 0, |
|
287 self, |
|
288 "dbg_coverage_script", |
|
289 ) |
249 self.coverageAct.setStatusTip( |
290 self.coverageAct.setStatusTip( |
250 self.tr('Perform a coverage run of the current Script')) |
291 self.tr("Perform a coverage run of the current Script") |
251 self.coverageAct.setWhatsThis(self.tr( |
292 ) |
252 """<b>Coverage run of Script</b>""" |
293 self.coverageAct.setWhatsThis( |
253 """<p>Set the command line arguments and run the script under""" |
294 self.tr( |
254 """ the control of a coverage analysis tool. If the file has""" |
295 """<b>Coverage run of Script</b>""" |
255 """ unsaved changes it may be saved first.</p>""" |
296 """<p>Set the command line arguments and run the script under""" |
256 )) |
297 """ the control of a coverage analysis tool. If the file has""" |
|
298 """ unsaved changes it may be saved first.</p>""" |
|
299 ) |
|
300 ) |
257 self.coverageAct.triggered.connect(self.__coverageScript) |
301 self.coverageAct.triggered.connect(self.__coverageScript) |
258 self.actions.append(self.coverageAct) |
302 self.actions.append(self.coverageAct) |
259 |
303 |
260 self.coverageProjectAct = EricAction( |
304 self.coverageProjectAct = EricAction( |
261 self.tr('Coverage run of Project'), |
305 self.tr("Coverage run of Project"), |
262 UI.PixmapCache.getIcon("coverageProject"), |
306 UI.PixmapCache.getIcon("coverageProject"), |
263 self.tr('Coverage run of Project...'), 0, 0, self, |
307 self.tr("Coverage run of Project..."), |
264 'dbg_coverage_project') |
308 0, |
|
309 0, |
|
310 self, |
|
311 "dbg_coverage_project", |
|
312 ) |
265 self.coverageProjectAct.setStatusTip( |
313 self.coverageProjectAct.setStatusTip( |
266 self.tr('Perform a coverage run of the current Project')) |
314 self.tr("Perform a coverage run of the current Project") |
267 self.coverageProjectAct.setWhatsThis(self.tr( |
315 ) |
268 """<b>Coverage run of Project</b>""" |
316 self.coverageProjectAct.setWhatsThis( |
269 """<p>Set the command line arguments and run the current project""" |
317 self.tr( |
270 """ under the control of a coverage analysis tool.""" |
318 """<b>Coverage run of Project</b>""" |
271 """ If files of the current project have unsaved changes""" |
319 """<p>Set the command line arguments and run the current project""" |
272 """ they may be saved first.</p>""" |
320 """ under the control of a coverage analysis tool.""" |
273 )) |
321 """ If files of the current project have unsaved changes""" |
|
322 """ they may be saved first.</p>""" |
|
323 ) |
|
324 ) |
274 self.coverageProjectAct.triggered.connect(self.__coverageProject) |
325 self.coverageProjectAct.triggered.connect(self.__coverageProject) |
275 self.actions.append(self.coverageProjectAct) |
326 self.actions.append(self.coverageProjectAct) |
276 |
327 |
277 self.profileAct = EricAction( |
328 self.profileAct = EricAction( |
278 self.tr('Profile Script'), |
329 self.tr("Profile Script"), |
279 UI.PixmapCache.getIcon("profileScript"), |
330 UI.PixmapCache.getIcon("profileScript"), |
280 self.tr('Profile Script...'), 0, 0, self, 'dbg_profile_script') |
331 self.tr("Profile Script..."), |
281 self.profileAct.setStatusTip(self.tr('Profile the current Script')) |
332 0, |
282 self.profileAct.setWhatsThis(self.tr( |
333 0, |
283 """<b>Profile Script</b>""" |
334 self, |
284 """<p>Set the command line arguments and profile the script.""" |
335 "dbg_profile_script", |
285 """ If the file has unsaved changes it may be saved first.</p>""" |
336 ) |
286 )) |
337 self.profileAct.setStatusTip(self.tr("Profile the current Script")) |
|
338 self.profileAct.setWhatsThis( |
|
339 self.tr( |
|
340 """<b>Profile Script</b>""" |
|
341 """<p>Set the command line arguments and profile the script.""" |
|
342 """ If the file has unsaved changes it may be saved first.</p>""" |
|
343 ) |
|
344 ) |
287 self.profileAct.triggered.connect(self.__profileScript) |
345 self.profileAct.triggered.connect(self.__profileScript) |
288 self.actions.append(self.profileAct) |
346 self.actions.append(self.profileAct) |
289 |
347 |
290 self.profileProjectAct = EricAction( |
348 self.profileProjectAct = EricAction( |
291 self.tr('Profile Project'), |
349 self.tr("Profile Project"), |
292 UI.PixmapCache.getIcon("profileProject"), |
350 UI.PixmapCache.getIcon("profileProject"), |
293 self.tr('Profile Project...'), 0, 0, self, |
351 self.tr("Profile Project..."), |
294 'dbg_profile_project') |
352 0, |
295 self.profileProjectAct.setStatusTip( |
353 0, |
296 self.tr('Profile the current Project')) |
354 self, |
297 self.profileProjectAct.setWhatsThis(self.tr( |
355 "dbg_profile_project", |
298 """<b>Profile Project</b>""" |
356 ) |
299 """<p>Set the command line arguments and profile the current""" |
357 self.profileProjectAct.setStatusTip(self.tr("Profile the current Project")) |
300 """ project. If files of the current project have unsaved""" |
358 self.profileProjectAct.setWhatsThis( |
301 """ changes they may be saved first.</p>""" |
359 self.tr( |
302 )) |
360 """<b>Profile Project</b>""" |
|
361 """<p>Set the command line arguments and profile the current""" |
|
362 """ project. If files of the current project have unsaved""" |
|
363 """ changes they may be saved first.</p>""" |
|
364 ) |
|
365 ) |
303 self.profileProjectAct.triggered.connect(self.__profileProject) |
366 self.profileProjectAct.triggered.connect(self.__profileProject) |
304 self.actions.append(self.profileProjectAct) |
367 self.actions.append(self.profileProjectAct) |
305 |
368 |
306 self.debugAct = EricAction( |
369 self.debugAct = EricAction( |
307 self.tr('Debug Script'), |
370 self.tr("Debug Script"), |
308 UI.PixmapCache.getIcon("debugScript"), |
371 UI.PixmapCache.getIcon("debugScript"), |
309 self.tr('&Debug Script...'), Qt.Key.Key_F5, 0, self, |
372 self.tr("&Debug Script..."), |
310 'dbg_debug_script') |
373 Qt.Key.Key_F5, |
311 self.debugAct.setStatusTip(self.tr('Debug the current Script')) |
374 0, |
312 self.debugAct.setWhatsThis(self.tr( |
375 self, |
313 """<b>Debug Script</b>""" |
376 "dbg_debug_script", |
314 """<p>Set the command line arguments and set the current line""" |
377 ) |
315 """ to be the first executable Python statement of the current""" |
378 self.debugAct.setStatusTip(self.tr("Debug the current Script")) |
316 """ editor window. If the file has unsaved changes it may be""" |
379 self.debugAct.setWhatsThis( |
317 """ saved first.</p>""" |
380 self.tr( |
318 )) |
381 """<b>Debug Script</b>""" |
|
382 """<p>Set the command line arguments and set the current line""" |
|
383 """ to be the first executable Python statement of the current""" |
|
384 """ editor window. If the file has unsaved changes it may be""" |
|
385 """ saved first.</p>""" |
|
386 ) |
|
387 ) |
319 self.debugAct.triggered.connect(self.__debugScript) |
388 self.debugAct.triggered.connect(self.__debugScript) |
320 self.actions.append(self.debugAct) |
389 self.actions.append(self.debugAct) |
321 |
390 |
322 self.debugProjectAct = EricAction( |
391 self.debugProjectAct = EricAction( |
323 self.tr('Debug Project'), |
392 self.tr("Debug Project"), |
324 UI.PixmapCache.getIcon("debugProject"), |
393 UI.PixmapCache.getIcon("debugProject"), |
325 self.tr('Debug &Project...'), |
394 self.tr("Debug &Project..."), |
326 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F5), |
395 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F5), |
327 0, self, 'dbg_debug_project') |
396 0, |
328 self.debugProjectAct.setStatusTip(self.tr( |
397 self, |
329 'Debug the current Project')) |
398 "dbg_debug_project", |
330 self.debugProjectAct.setWhatsThis(self.tr( |
399 ) |
331 """<b>Debug Project</b>""" |
400 self.debugProjectAct.setStatusTip(self.tr("Debug the current Project")) |
332 """<p>Set the command line arguments and set the current line""" |
401 self.debugProjectAct.setWhatsThis( |
333 """ to be the first executable Python statement of the main""" |
402 self.tr( |
334 """ script of the current project. If files of the current""" |
403 """<b>Debug Project</b>""" |
335 """ project have unsaved changes they may be saved first.</p>""" |
404 """<p>Set the command line arguments and set the current line""" |
336 )) |
405 """ to be the first executable Python statement of the main""" |
|
406 """ script of the current project. If files of the current""" |
|
407 """ project have unsaved changes they may be saved first.</p>""" |
|
408 ) |
|
409 ) |
337 self.debugProjectAct.triggered.connect(self.__debugProject) |
410 self.debugProjectAct.triggered.connect(self.__debugProject) |
338 self.actions.append(self.debugProjectAct) |
411 self.actions.append(self.debugProjectAct) |
339 |
412 |
340 self.restartAct = EricAction( |
413 self.restartAct = EricAction( |
341 self.tr('Restart'), |
414 self.tr("Restart"), |
342 UI.PixmapCache.getIcon("debugRestart"), |
415 UI.PixmapCache.getIcon("debugRestart"), |
343 self.tr('Restart'), Qt.Key.Key_F4, 0, self, 'dbg_restart_script') |
416 self.tr("Restart"), |
344 self.restartAct.setStatusTip(self.tr( |
417 Qt.Key.Key_F4, |
345 'Restart the last debugged script')) |
418 0, |
346 self.restartAct.setWhatsThis(self.tr( |
419 self, |
347 """<b>Restart</b>""" |
420 "dbg_restart_script", |
348 """<p>Set the command line arguments and set the current line""" |
421 ) |
349 """ to be the first executable Python statement of the script""" |
422 self.restartAct.setStatusTip(self.tr("Restart the last debugged script")) |
350 """ that was debugged last. If there are unsaved changes, they""" |
423 self.restartAct.setWhatsThis( |
351 """ may be saved first.</p>""" |
424 self.tr( |
352 )) |
425 """<b>Restart</b>""" |
|
426 """<p>Set the command line arguments and set the current line""" |
|
427 """ to be the first executable Python statement of the script""" |
|
428 """ that was debugged last. If there are unsaved changes, they""" |
|
429 """ may be saved first.</p>""" |
|
430 ) |
|
431 ) |
353 self.restartAct.triggered.connect(self.__doRestart) |
432 self.restartAct.triggered.connect(self.__doRestart) |
354 self.actions.append(self.restartAct) |
433 self.actions.append(self.restartAct) |
355 |
434 |
356 self.stopAct = EricAction( |
435 self.stopAct = EricAction( |
357 self.tr('Stop'), |
436 self.tr("Stop"), |
358 UI.PixmapCache.getIcon("stopScript"), |
437 UI.PixmapCache.getIcon("stopScript"), |
359 self.tr('Stop'), |
438 self.tr("Stop"), |
360 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F10), |
439 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F10), |
361 0, |
440 0, |
362 self, 'dbg_stop_script') |
441 self, |
|
442 "dbg_stop_script", |
|
443 ) |
363 self.stopAct.setStatusTip(self.tr("""Stop the running script.""")) |
444 self.stopAct.setStatusTip(self.tr("""Stop the running script.""")) |
364 self.stopAct.setWhatsThis(self.tr( |
445 self.stopAct.setWhatsThis( |
365 """<b>Stop</b>""" |
446 self.tr( |
366 """<p>This stops the script running in the debugger backend.</p>""" |
447 """<b>Stop</b>""" |
367 )) |
448 """<p>This stops the script running in the debugger backend.</p>""" |
|
449 ) |
|
450 ) |
368 self.stopAct.triggered.connect(self.__stopScript) |
451 self.stopAct.triggered.connect(self.__stopScript) |
369 self.actions.append(self.stopAct) |
452 self.actions.append(self.stopAct) |
370 |
453 |
371 self.debugActGrp = createActionGroup(self) |
454 self.debugActGrp = createActionGroup(self) |
372 |
455 |
373 act = EricAction( |
456 act = EricAction( |
374 self.tr('Continue'), |
457 self.tr("Continue"), |
375 UI.PixmapCache.getIcon("continue"), |
458 UI.PixmapCache.getIcon("continue"), |
376 self.tr('&Continue'), Qt.Key.Key_F6, 0, |
459 self.tr("&Continue"), |
377 self.debugActGrp, 'dbg_continue') |
460 Qt.Key.Key_F6, |
378 act.setStatusTip( |
461 0, |
379 self.tr('Continue running the program from the current line')) |
462 self.debugActGrp, |
380 act.setWhatsThis(self.tr( |
463 "dbg_continue", |
381 """<b>Continue</b>""" |
464 ) |
382 """<p>Continue running the program from the current line. The""" |
465 act.setStatusTip(self.tr("Continue running the program from the current line")) |
383 """ program will stop when it terminates or when a breakpoint""" |
466 act.setWhatsThis( |
384 """ is reached.</p>""" |
467 self.tr( |
385 )) |
468 """<b>Continue</b>""" |
|
469 """<p>Continue running the program from the current line. The""" |
|
470 """ program will stop when it terminates or when a breakpoint""" |
|
471 """ is reached.</p>""" |
|
472 ) |
|
473 ) |
386 act.triggered.connect(self.__continue) |
474 act.triggered.connect(self.__continue) |
387 self.actions.append(act) |
475 self.actions.append(act) |
388 |
476 |
389 act = EricAction( |
477 act = EricAction( |
390 self.tr('Continue to Cursor'), |
478 self.tr("Continue to Cursor"), |
391 UI.PixmapCache.getIcon("continueToCursor"), |
479 UI.PixmapCache.getIcon("continueToCursor"), |
392 self.tr('Continue &To Cursor'), |
480 self.tr("Continue &To Cursor"), |
393 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F6), |
481 QKeyCombination(Qt.Modifier.SHIFT, Qt.Key.Key_F6), |
394 0, self.debugActGrp, 'dbg_continue_to_cursor') |
482 0, |
395 act.setStatusTip(self.tr( |
483 self.debugActGrp, |
396 """Continue running the program from the""" |
484 "dbg_continue_to_cursor", |
397 """ current line to the current cursor position""")) |
485 ) |
398 act.setWhatsThis(self.tr( |
486 act.setStatusTip( |
399 """<b>Continue To Cursor</b>""" |
487 self.tr( |
400 """<p>Continue running the program from the current line to the""" |
488 """Continue running the program from the""" |
401 """ current cursor position.</p>""" |
489 """ current line to the current cursor position""" |
402 )) |
490 ) |
|
491 ) |
|
492 act.setWhatsThis( |
|
493 self.tr( |
|
494 """<b>Continue To Cursor</b>""" |
|
495 """<p>Continue running the program from the current line to the""" |
|
496 """ current cursor position.</p>""" |
|
497 ) |
|
498 ) |
403 act.triggered.connect(self.__runToCursor) |
499 act.triggered.connect(self.__runToCursor) |
404 self.actions.append(act) |
500 self.actions.append(act) |
405 |
501 |
406 act = EricAction( |
502 act = EricAction( |
407 self.tr('Continue Until'), |
503 self.tr("Continue Until"), |
408 UI.PixmapCache.getIcon("continueUntil"), |
504 UI.PixmapCache.getIcon("continueUntil"), |
409 self.tr('Continue &Until'), |
505 self.tr("Continue &Until"), |
410 QKeyCombination(Qt.Modifier.CTRL, Qt.Key.Key_F6), |
506 QKeyCombination(Qt.Modifier.CTRL, Qt.Key.Key_F6), |
411 0, |
507 0, |
412 self.debugActGrp, 'dbg_continue_until') |
508 self.debugActGrp, |
413 act.setStatusTip(self.tr( |
509 "dbg_continue_until", |
414 """Continue running the program from the current line to the""" |
510 ) |
415 """ current cursor position or until leaving the current frame""")) |
511 act.setStatusTip( |
416 act.setWhatsThis(self.tr( |
512 self.tr( |
417 """<b>Continue Until</b>""" |
513 """Continue running the program from the current line to the""" |
418 """<p>Continue running the program from the current line to the""" |
514 """ current cursor position or until leaving the current frame""" |
419 """ cursor position greater than the current line or until""" |
515 ) |
420 """ leaving the current frame.</p>""" |
516 ) |
421 )) |
517 act.setWhatsThis( |
|
518 self.tr( |
|
519 """<b>Continue Until</b>""" |
|
520 """<p>Continue running the program from the current line to the""" |
|
521 """ cursor position greater than the current line or until""" |
|
522 """ leaving the current frame.</p>""" |
|
523 ) |
|
524 ) |
422 act.triggered.connect(self.__runUntil) |
525 act.triggered.connect(self.__runUntil) |
423 self.actions.append(act) |
526 self.actions.append(act) |
424 |
527 |
425 act = EricAction( |
528 act = EricAction( |
426 self.tr('Move Instruction Pointer to Cursor'), |
529 self.tr("Move Instruction Pointer to Cursor"), |
427 UI.PixmapCache.getIcon("moveInstructionPointer"), |
530 UI.PixmapCache.getIcon("moveInstructionPointer"), |
428 self.tr('&Jump To Cursor'), Qt.Key.Key_F12, 0, |
531 self.tr("&Jump To Cursor"), |
429 self.debugActGrp, 'dbg_jump_to_cursor') |
532 Qt.Key.Key_F12, |
430 act.setStatusTip(self.tr( |
533 0, |
431 """Skip the code from the""" |
534 self.debugActGrp, |
432 """ current line to the current cursor position""")) |
535 "dbg_jump_to_cursor", |
433 act.setWhatsThis(self.tr( |
536 ) |
434 """<b>Move Instruction Pointer to Cursor</b>""" |
537 act.setStatusTip( |
435 """<p>Move the Python internal instruction pointer to the""" |
538 self.tr( |
436 """ current cursor position without executing the code in""" |
539 """Skip the code from the""" |
437 """ between.</p>""" |
540 """ current line to the current cursor position""" |
438 """<p>It's not possible to jump out of a function or jump""" |
541 ) |
439 """ in a code block, e.g. a loop. In these cases, a error""" |
542 ) |
440 """ message is printed to the log window.</p>""" |
543 act.setWhatsThis( |
441 )) |
544 self.tr( |
|
545 """<b>Move Instruction Pointer to Cursor</b>""" |
|
546 """<p>Move the Python internal instruction pointer to the""" |
|
547 """ current cursor position without executing the code in""" |
|
548 """ between.</p>""" |
|
549 """<p>It's not possible to jump out of a function or jump""" |
|
550 """ in a code block, e.g. a loop. In these cases, a error""" |
|
551 """ message is printed to the log window.</p>""" |
|
552 ) |
|
553 ) |
442 act.triggered.connect(self.__moveInstructionPointer) |
554 act.triggered.connect(self.__moveInstructionPointer) |
443 self.actions.append(act) |
555 self.actions.append(act) |
444 |
556 |
445 act = EricAction( |
557 act = EricAction( |
446 self.tr('Single Step'), |
558 self.tr("Single Step"), |
447 UI.PixmapCache.getIcon("step"), |
559 UI.PixmapCache.getIcon("step"), |
448 self.tr('Sin&gle Step'), Qt.Key.Key_F7, 0, |
560 self.tr("Sin&gle Step"), |
449 self.debugActGrp, 'dbg_single_step') |
561 Qt.Key.Key_F7, |
450 act.setStatusTip(self.tr('Execute a single Python statement')) |
562 0, |
451 act.setWhatsThis(self.tr( |
563 self.debugActGrp, |
452 """<b>Single Step</b>""" |
564 "dbg_single_step", |
453 """<p>Execute a single Python statement. If the statement""" |
565 ) |
454 """ is an <tt>import</tt> statement, a class constructor, or a""" |
566 act.setStatusTip(self.tr("Execute a single Python statement")) |
455 """ method or function call then control is returned to the""" |
567 act.setWhatsThis( |
456 """ debugger at the next statement.</p>""" |
568 self.tr( |
457 )) |
569 """<b>Single Step</b>""" |
|
570 """<p>Execute a single Python statement. If the statement""" |
|
571 """ is an <tt>import</tt> statement, a class constructor, or a""" |
|
572 """ method or function call then control is returned to the""" |
|
573 """ debugger at the next statement.</p>""" |
|
574 ) |
|
575 ) |
458 act.triggered.connect(self.__step) |
576 act.triggered.connect(self.__step) |
459 self.actions.append(act) |
577 self.actions.append(act) |
460 |
578 |
461 act = EricAction( |
579 act = EricAction( |
462 self.tr('Step Over'), |
580 self.tr("Step Over"), |
463 UI.PixmapCache.getIcon("stepOver"), |
581 UI.PixmapCache.getIcon("stepOver"), |
464 self.tr('Step &Over'), Qt.Key.Key_F8, 0, |
582 self.tr("Step &Over"), |
465 self.debugActGrp, 'dbg_step_over') |
583 Qt.Key.Key_F8, |
466 act.setStatusTip(self.tr( |
584 0, |
467 """Execute a single Python statement staying""" |
585 self.debugActGrp, |
468 """ in the current frame""")) |
586 "dbg_step_over", |
469 act.setWhatsThis(self.tr( |
587 ) |
470 """<b>Step Over</b>""" |
588 act.setStatusTip( |
471 """<p>Execute a single Python statement staying in the same""" |
589 self.tr( |
472 """ frame. If the statement is an <tt>import</tt> statement,""" |
590 """Execute a single Python statement staying""" |
473 """ a class constructor, or a method or function call then""" |
591 """ in the current frame""" |
474 """ control is returned to the debugger after the statement""" |
592 ) |
475 """ has completed.</p>""" |
593 ) |
476 )) |
594 act.setWhatsThis( |
|
595 self.tr( |
|
596 """<b>Step Over</b>""" |
|
597 """<p>Execute a single Python statement staying in the same""" |
|
598 """ frame. If the statement is an <tt>import</tt> statement,""" |
|
599 """ a class constructor, or a method or function call then""" |
|
600 """ control is returned to the debugger after the statement""" |
|
601 """ has completed.</p>""" |
|
602 ) |
|
603 ) |
477 act.triggered.connect(self.__stepOver) |
604 act.triggered.connect(self.__stepOver) |
478 self.actions.append(act) |
605 self.actions.append(act) |
479 |
606 |
480 act = EricAction( |
607 act = EricAction( |
481 self.tr('Step Out'), |
608 self.tr("Step Out"), |
482 UI.PixmapCache.getIcon("stepOut"), |
609 UI.PixmapCache.getIcon("stepOut"), |
483 self.tr('Step Ou&t'), Qt.Key.Key_F9, 0, |
610 self.tr("Step Ou&t"), |
484 self.debugActGrp, 'dbg_step_out') |
611 Qt.Key.Key_F9, |
485 act.setStatusTip(self.tr( |
612 0, |
486 """Execute Python statements until leaving""" |
613 self.debugActGrp, |
487 """ the current frame""")) |
614 "dbg_step_out", |
488 act.setWhatsThis(self.tr( |
615 ) |
489 """<b>Step Out</b>""" |
616 act.setStatusTip( |
490 """<p>Execute Python statements until leaving the current""" |
617 self.tr( |
491 """ frame. If the statements are inside an <tt>import</tt>""" |
618 """Execute Python statements until leaving""" """ the current frame""" |
492 """ statement, a class constructor, or a method or function""" |
619 ) |
493 """ call then control is returned to the debugger after the""" |
620 ) |
494 """ current frame has been left.</p>""" |
621 act.setWhatsThis( |
495 )) |
622 self.tr( |
|
623 """<b>Step Out</b>""" |
|
624 """<p>Execute Python statements until leaving the current""" |
|
625 """ frame. If the statements are inside an <tt>import</tt>""" |
|
626 """ statement, a class constructor, or a method or function""" |
|
627 """ call then control is returned to the debugger after the""" |
|
628 """ current frame has been left.</p>""" |
|
629 ) |
|
630 ) |
496 act.triggered.connect(self.__stepOut) |
631 act.triggered.connect(self.__stepOut) |
497 self.actions.append(act) |
632 self.actions.append(act) |
498 |
633 |
499 act = EricAction( |
634 act = EricAction( |
500 self.tr('Stop'), |
635 self.tr("Stop"), |
501 UI.PixmapCache.getIcon("stepQuit"), |
636 UI.PixmapCache.getIcon("stepQuit"), |
502 self.tr('&Stop'), Qt.Key.Key_F10, 0, |
637 self.tr("&Stop"), |
503 self.debugActGrp, 'dbg_stop') |
638 Qt.Key.Key_F10, |
504 act.setStatusTip(self.tr('Stop debugging')) |
639 0, |
505 act.setWhatsThis(self.tr( |
640 self.debugActGrp, |
506 """<b>Stop</b>""" |
641 "dbg_stop", |
507 """<p>Stop the running debugging session.</p>""" |
642 ) |
508 )) |
643 act.setStatusTip(self.tr("Stop debugging")) |
|
644 act.setWhatsThis( |
|
645 self.tr("""<b>Stop</b>""" """<p>Stop the running debugging session.</p>""") |
|
646 ) |
509 act.triggered.connect(self.__stepQuit) |
647 act.triggered.connect(self.__stepQuit) |
510 self.actions.append(act) |
648 self.actions.append(act) |
511 |
649 |
512 self.dbgFilterAct = EricAction( |
650 self.dbgFilterAct = EricAction( |
513 self.tr('Variables Type Filter'), |
651 self.tr("Variables Type Filter"), |
514 self.tr('Varia&bles Type Filter...'), 0, 0, self, |
652 self.tr("Varia&bles Type Filter..."), |
515 'dbg_variables_filter') |
653 0, |
516 self.dbgFilterAct.setStatusTip(self.tr( |
654 0, |
517 'Configure variables type filter')) |
655 self, |
518 self.dbgFilterAct.setWhatsThis(self.tr( |
656 "dbg_variables_filter", |
519 """<b>Variables Type Filter</b>""" |
657 ) |
520 """<p>Configure the variables type filter. Only variable types""" |
658 self.dbgFilterAct.setStatusTip(self.tr("Configure variables type filter")) |
521 """ that are not selected are displayed in the global or local""" |
659 self.dbgFilterAct.setWhatsThis( |
522 """ variables window during a debugging session.</p>""" |
660 self.tr( |
523 )) |
661 """<b>Variables Type Filter</b>""" |
524 self.dbgFilterAct.triggered.connect( |
662 """<p>Configure the variables type filter. Only variable types""" |
525 self.__configureVariablesFilters) |
663 """ that are not selected are displayed in the global or local""" |
|
664 """ variables window during a debugging session.</p>""" |
|
665 ) |
|
666 ) |
|
667 self.dbgFilterAct.triggered.connect(self.__configureVariablesFilters) |
526 self.actions.append(self.dbgFilterAct) |
668 self.actions.append(self.dbgFilterAct) |
527 |
669 |
528 self.excFilterAct = EricAction( |
670 self.excFilterAct = EricAction( |
529 self.tr('Exceptions Filter'), |
671 self.tr("Exceptions Filter"), |
530 self.tr('&Exceptions Filter...'), 0, 0, self, |
672 self.tr("&Exceptions Filter..."), |
531 'dbg_exceptions_filter') |
673 0, |
532 self.excFilterAct.setStatusTip(self.tr( |
674 0, |
533 'Configure exceptions filter')) |
675 self, |
534 self.excFilterAct.setWhatsThis(self.tr( |
676 "dbg_exceptions_filter", |
535 """<b>Exceptions Filter</b>""" |
677 ) |
536 """<p>Configure the exceptions filter. Only exception types""" |
678 self.excFilterAct.setStatusTip(self.tr("Configure exceptions filter")) |
537 """ that are listed are highlighted during a debugging""" |
679 self.excFilterAct.setWhatsThis( |
538 """ session.</p><p>Please note, that all unhandled exceptions""" |
680 self.tr( |
539 """ are highlighted indepent from the filter list.</p>""" |
681 """<b>Exceptions Filter</b>""" |
540 )) |
682 """<p>Configure the exceptions filter. Only exception types""" |
541 self.excFilterAct.triggered.connect( |
683 """ that are listed are highlighted during a debugging""" |
542 self.__configureExceptionsFilter) |
684 """ session.</p><p>Please note, that all unhandled exceptions""" |
|
685 """ are highlighted indepent from the filter list.</p>""" |
|
686 ) |
|
687 ) |
|
688 self.excFilterAct.triggered.connect(self.__configureExceptionsFilter) |
543 self.actions.append(self.excFilterAct) |
689 self.actions.append(self.excFilterAct) |
544 |
690 |
545 self.excIgnoreFilterAct = EricAction( |
691 self.excIgnoreFilterAct = EricAction( |
546 self.tr('Ignored Exceptions'), |
692 self.tr("Ignored Exceptions"), |
547 self.tr('&Ignored Exceptions...'), 0, 0, |
693 self.tr("&Ignored Exceptions..."), |
548 self, 'dbg_ignored_exceptions') |
694 0, |
549 self.excIgnoreFilterAct.setStatusTip(self.tr( |
695 0, |
550 'Configure ignored exceptions')) |
696 self, |
551 self.excIgnoreFilterAct.setWhatsThis(self.tr( |
697 "dbg_ignored_exceptions", |
552 """<b>Ignored Exceptions</b>""" |
698 ) |
553 """<p>Configure the ignored exceptions. Only exception types""" |
699 self.excIgnoreFilterAct.setStatusTip(self.tr("Configure ignored exceptions")) |
554 """ that are not listed are highlighted during a debugging""" |
700 self.excIgnoreFilterAct.setWhatsThis( |
555 """ session.</p><p>Please note, that unhandled exceptions""" |
701 self.tr( |
556 """ cannot be ignored.</p>""" |
702 """<b>Ignored Exceptions</b>""" |
557 )) |
703 """<p>Configure the ignored exceptions. Only exception types""" |
558 self.excIgnoreFilterAct.triggered.connect( |
704 """ that are not listed are highlighted during a debugging""" |
559 self.__configureIgnoredExceptions) |
705 """ session.</p><p>Please note, that unhandled exceptions""" |
|
706 """ cannot be ignored.</p>""" |
|
707 ) |
|
708 ) |
|
709 self.excIgnoreFilterAct.triggered.connect(self.__configureIgnoredExceptions) |
560 self.actions.append(self.excIgnoreFilterAct) |
710 self.actions.append(self.excIgnoreFilterAct) |
561 |
711 |
562 self.dbgSetBpActGrp = createActionGroup(self) |
712 self.dbgSetBpActGrp = createActionGroup(self) |
563 |
713 |
564 self.dbgToggleBpAct = EricAction( |
714 self.dbgToggleBpAct = EricAction( |
565 self.tr('Toggle Breakpoint'), |
715 self.tr("Toggle Breakpoint"), |
566 UI.PixmapCache.getIcon("breakpointToggle"), |
716 UI.PixmapCache.getIcon("breakpointToggle"), |
567 self.tr('Toggle Breakpoint'), |
717 self.tr("Toggle Breakpoint"), |
568 QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")), |
718 QKeySequence(self.tr("Shift+F11", "Debug|Toggle Breakpoint")), |
569 0, self.dbgSetBpActGrp, 'dbg_toggle_breakpoint') |
719 0, |
570 self.dbgToggleBpAct.setStatusTip(self.tr('Toggle Breakpoint')) |
720 self.dbgSetBpActGrp, |
571 self.dbgToggleBpAct.setWhatsThis(self.tr( |
721 "dbg_toggle_breakpoint", |
572 """<b>Toggle Breakpoint</b>""" |
722 ) |
573 """<p>Toggles a breakpoint at the current line of the""" |
723 self.dbgToggleBpAct.setStatusTip(self.tr("Toggle Breakpoint")) |
574 """ current editor.</p>""" |
724 self.dbgToggleBpAct.setWhatsThis( |
575 )) |
725 self.tr( |
|
726 """<b>Toggle Breakpoint</b>""" |
|
727 """<p>Toggles a breakpoint at the current line of the""" |
|
728 """ current editor.</p>""" |
|
729 ) |
|
730 ) |
576 self.dbgToggleBpAct.triggered.connect(self.__toggleBreakpoint) |
731 self.dbgToggleBpAct.triggered.connect(self.__toggleBreakpoint) |
577 self.actions.append(self.dbgToggleBpAct) |
732 self.actions.append(self.dbgToggleBpAct) |
578 |
733 |
579 self.dbgEditBpAct = EricAction( |
734 self.dbgEditBpAct = EricAction( |
580 self.tr('Edit Breakpoint'), |
735 self.tr("Edit Breakpoint"), |
581 UI.PixmapCache.getIcon("cBreakpointToggle"), |
736 UI.PixmapCache.getIcon("cBreakpointToggle"), |
582 self.tr('Edit Breakpoint...'), |
737 self.tr("Edit Breakpoint..."), |
583 QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")), 0, |
738 QKeySequence(self.tr("Shift+F12", "Debug|Edit Breakpoint")), |
584 self.dbgSetBpActGrp, 'dbg_edit_breakpoint') |
739 0, |
585 self.dbgEditBpAct.setStatusTip(self.tr('Edit Breakpoint')) |
740 self.dbgSetBpActGrp, |
586 self.dbgEditBpAct.setWhatsThis(self.tr( |
741 "dbg_edit_breakpoint", |
587 """<b>Edit Breakpoint</b>""" |
742 ) |
588 """<p>Opens a dialog to edit the breakpoints properties.""" |
743 self.dbgEditBpAct.setStatusTip(self.tr("Edit Breakpoint")) |
589 """ It works at the current line of the current editor.</p>""" |
744 self.dbgEditBpAct.setWhatsThis( |
590 )) |
745 self.tr( |
|
746 """<b>Edit Breakpoint</b>""" |
|
747 """<p>Opens a dialog to edit the breakpoints properties.""" |
|
748 """ It works at the current line of the current editor.</p>""" |
|
749 ) |
|
750 ) |
591 self.dbgEditBpAct.triggered.connect(self.__editBreakpoint) |
751 self.dbgEditBpAct.triggered.connect(self.__editBreakpoint) |
592 self.actions.append(self.dbgEditBpAct) |
752 self.actions.append(self.dbgEditBpAct) |
593 |
753 |
594 self.dbgNextBpAct = EricAction( |
754 self.dbgNextBpAct = EricAction( |
595 self.tr('Next Breakpoint'), |
755 self.tr("Next Breakpoint"), |
596 UI.PixmapCache.getIcon("breakpointNext"), |
756 UI.PixmapCache.getIcon("breakpointNext"), |
597 self.tr('Next Breakpoint'), |
757 self.tr("Next Breakpoint"), |
598 QKeySequence( |
758 QKeySequence(self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), |
599 self.tr("Ctrl+Shift+PgDown", "Debug|Next Breakpoint")), 0, |
759 0, |
600 self.dbgSetBpActGrp, 'dbg_next_breakpoint') |
760 self.dbgSetBpActGrp, |
601 self.dbgNextBpAct.setStatusTip(self.tr('Next Breakpoint')) |
761 "dbg_next_breakpoint", |
602 self.dbgNextBpAct.setWhatsThis(self.tr( |
762 ) |
603 """<b>Next Breakpoint</b>""" |
763 self.dbgNextBpAct.setStatusTip(self.tr("Next Breakpoint")) |
604 """<p>Go to next breakpoint of the current editor.</p>""" |
764 self.dbgNextBpAct.setWhatsThis( |
605 )) |
765 self.tr( |
|
766 """<b>Next Breakpoint</b>""" |
|
767 """<p>Go to next breakpoint of the current editor.</p>""" |
|
768 ) |
|
769 ) |
606 self.dbgNextBpAct.triggered.connect(self.__nextBreakpoint) |
770 self.dbgNextBpAct.triggered.connect(self.__nextBreakpoint) |
607 self.actions.append(self.dbgNextBpAct) |
771 self.actions.append(self.dbgNextBpAct) |
608 |
772 |
609 self.dbgPrevBpAct = EricAction( |
773 self.dbgPrevBpAct = EricAction( |
610 self.tr('Previous Breakpoint'), |
774 self.tr("Previous Breakpoint"), |
611 UI.PixmapCache.getIcon("breakpointPrevious"), |
775 UI.PixmapCache.getIcon("breakpointPrevious"), |
612 self.tr('Previous Breakpoint'), |
776 self.tr("Previous Breakpoint"), |
613 QKeySequence( |
777 QKeySequence(self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")), |
614 self.tr("Ctrl+Shift+PgUp", "Debug|Previous Breakpoint")), |
778 0, |
615 0, self.dbgSetBpActGrp, 'dbg_previous_breakpoint') |
779 self.dbgSetBpActGrp, |
616 self.dbgPrevBpAct.setStatusTip(self.tr('Previous Breakpoint')) |
780 "dbg_previous_breakpoint", |
617 self.dbgPrevBpAct.setWhatsThis(self.tr( |
781 ) |
618 """<b>Previous Breakpoint</b>""" |
782 self.dbgPrevBpAct.setStatusTip(self.tr("Previous Breakpoint")) |
619 """<p>Go to previous breakpoint of the current editor.</p>""" |
783 self.dbgPrevBpAct.setWhatsThis( |
620 )) |
784 self.tr( |
|
785 """<b>Previous Breakpoint</b>""" |
|
786 """<p>Go to previous breakpoint of the current editor.</p>""" |
|
787 ) |
|
788 ) |
621 self.dbgPrevBpAct.triggered.connect(self.__previousBreakpoint) |
789 self.dbgPrevBpAct.triggered.connect(self.__previousBreakpoint) |
622 self.actions.append(self.dbgPrevBpAct) |
790 self.actions.append(self.dbgPrevBpAct) |
623 |
791 |
624 act = EricAction( |
792 act = EricAction( |
625 self.tr('Clear Breakpoints'), |
793 self.tr("Clear Breakpoints"), |
626 self.tr('Clear Breakpoints'), |
794 self.tr("Clear Breakpoints"), |
627 0, 0, |
795 0, |
628 self.dbgSetBpActGrp, 'dbg_clear_breakpoint') |
796 0, |
629 act.setStatusTip(self.tr('Clear Breakpoints')) |
797 self.dbgSetBpActGrp, |
630 act.setWhatsThis(self.tr( |
798 "dbg_clear_breakpoint", |
631 """<b>Clear Breakpoints</b>""" |
799 ) |
632 """<p>Clear breakpoints of all editors.</p>""" |
800 act.setStatusTip(self.tr("Clear Breakpoints")) |
633 )) |
801 act.setWhatsThis( |
|
802 self.tr( |
|
803 """<b>Clear Breakpoints</b>""" |
|
804 """<p>Clear breakpoints of all editors.</p>""" |
|
805 ) |
|
806 ) |
634 act.triggered.connect(self.__clearBreakpoints) |
807 act.triggered.connect(self.__clearBreakpoints) |
635 self.actions.append(act) |
808 self.actions.append(act) |
636 |
809 |
637 self.debugActGrp.setEnabled(False) |
810 self.debugActGrp.setEnabled(False) |
638 self.dbgSetBpActGrp.setEnabled(False) |
811 self.dbgSetBpActGrp.setEnabled(False) |
934 self.dbgNextBpAct.setEnabled(True) |
1105 self.dbgNextBpAct.setEnabled(True) |
935 self.dbgPrevBpAct.setEnabled(True) |
1106 self.dbgPrevBpAct.setEnabled(True) |
936 else: |
1107 else: |
937 self.dbgNextBpAct.setEnabled(False) |
1108 self.dbgNextBpAct.setEnabled(False) |
938 self.dbgPrevBpAct.setEnabled(False) |
1109 self.dbgPrevBpAct.setEnabled(False) |
939 |
1110 |
940 def __projectOpened(self): |
1111 def __projectOpened(self): |
941 """ |
1112 """ |
942 Private slot to handle the projectOpened signal. |
1113 Private slot to handle the projectOpened signal. |
943 """ |
1114 """ |
944 self.projectOpen = True |
1115 self.projectOpen = True |
945 cap = self.debugServer.getClientCapabilities( |
1116 cap = self.debugServer.getClientCapabilities(self.project.getProjectLanguage()) |
946 self.project.getProjectLanguage()) |
|
947 if not self.passive: |
1117 if not self.passive: |
948 self.debugProjectAct.setEnabled(cap & HasDebugger) |
1118 self.debugProjectAct.setEnabled(cap & HasDebugger) |
949 self.runProjectAct.setEnabled(cap & HasInterpreter) |
1119 self.runProjectAct.setEnabled(cap & HasInterpreter) |
950 self.profileProjectAct.setEnabled(cap & HasProfiler) |
1120 self.profileProjectAct.setEnabled(cap & HasProfiler) |
951 self.coverageProjectAct.setEnabled(cap & HasCoverage) |
1121 self.coverageProjectAct.setEnabled(cap & HasCoverage) |
952 |
1122 |
953 def __projectClosed(self): |
1123 def __projectClosed(self): |
954 """ |
1124 """ |
955 Private slot to handle the projectClosed signal. |
1125 Private slot to handle the projectClosed signal. |
956 """ |
1126 """ |
957 self.projectOpen = False |
1127 self.projectOpen = False |
958 self.runProjectAct.setEnabled(False) |
1128 self.runProjectAct.setEnabled(False) |
959 self.profileProjectAct.setEnabled(False) |
1129 self.profileProjectAct.setEnabled(False) |
960 self.coverageProjectAct.setEnabled(False) |
1130 self.coverageProjectAct.setEnabled(False) |
961 self.debugProjectAct.setEnabled(False) |
1131 self.debugProjectAct.setEnabled(False) |
962 |
1132 |
963 if not self.editorOpen: |
1133 if not self.editorOpen: |
964 self.restartAct.setEnabled(False) |
1134 self.restartAct.setEnabled(False) |
965 self.lastDebuggedFile = None |
1135 self.lastDebuggedFile = None |
966 self.lastStartAction = 0 |
1136 self.lastStartAction = 0 |
967 self.clientType = "" |
1137 self.clientType = "" |
968 |
1138 |
969 def clearHistories(self): |
1139 def clearHistories(self): |
970 """ |
1140 """ |
971 Public method to clear the various debug histories. |
1141 Public method to clear the various debug histories. |
972 """ |
1142 """ |
973 self.scriptsHistory = [] |
1143 self.scriptsHistory = [] |
974 self.argvHistory = [] |
1144 self.argvHistory = [] |
975 self.wdHistory = [] |
1145 self.wdHistory = [] |
976 self.envHistory = [] |
1146 self.envHistory = [] |
977 self.multiprocessNoDebugHistory = [] |
1147 self.multiprocessNoDebugHistory = [] |
978 |
1148 |
979 Preferences.getSettings().setValue( |
1149 Preferences.getSettings().setValue( |
980 'DebugInfo/ScriptsHistory', self.scriptsHistory) |
1150 "DebugInfo/ScriptsHistory", self.scriptsHistory |
|
1151 ) |
981 Preferences.getSettings().setValue( |
1152 Preferences.getSettings().setValue( |
982 'DebugInfo/ArgumentsHistory', self.argvHistory) |
1153 "DebugInfo/ArgumentsHistory", self.argvHistory |
|
1154 ) |
983 Preferences.getSettings().setValue( |
1155 Preferences.getSettings().setValue( |
984 'DebugInfo/WorkingDirectoryHistory', self.wdHistory) |
1156 "DebugInfo/WorkingDirectoryHistory", self.wdHistory |
|
1157 ) |
985 Preferences.getSettings().setValue( |
1158 Preferences.getSettings().setValue( |
986 'DebugInfo/EnvironmentHistory', self.envHistory) |
1159 "DebugInfo/EnvironmentHistory", self.envHistory |
|
1160 ) |
987 Preferences.getSettings().setValue( |
1161 Preferences.getSettings().setValue( |
988 'DebugInfo/MultiprocessNoDebugHistory', |
1162 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory |
989 self.multiprocessNoDebugHistory) |
1163 ) |
990 |
1164 |
991 self.debugViewer.breakpointViewer.clearHistories() |
1165 self.debugViewer.breakpointViewer.clearHistories() |
992 |
1166 |
993 def shutdown(self): |
1167 def shutdown(self): |
994 """ |
1168 """ |
995 Public method to perform shutdown actions. |
1169 Public method to perform shutdown actions. |
996 """ |
1170 """ |
997 # Just save the 10 most recent entries |
1171 # Just save the 10 most recent entries |
998 del self.scriptsHistory[10:] |
1172 del self.scriptsHistory[10:] |
999 del self.argvHistory[10:] |
1173 del self.argvHistory[10:] |
1000 del self.wdHistory[10:] |
1174 del self.wdHistory[10:] |
1001 del self.envHistory[10:] |
1175 del self.envHistory[10:] |
1002 |
1176 |
1003 Preferences.getSettings().setValue( |
1177 Preferences.getSettings().setValue( |
1004 'DebugInfo/VirtualEnvironment', self.lastUsedVenvName) |
1178 "DebugInfo/VirtualEnvironment", self.lastUsedVenvName |
|
1179 ) |
1005 Preferences.getSettings().setValue( |
1180 Preferences.getSettings().setValue( |
1006 'DebugInfo/ScriptsHistory', self.scriptsHistory) |
1181 "DebugInfo/ScriptsHistory", self.scriptsHistory |
|
1182 ) |
1007 Preferences.getSettings().setValue( |
1183 Preferences.getSettings().setValue( |
1008 'DebugInfo/ArgumentsHistory', self.argvHistory) |
1184 "DebugInfo/ArgumentsHistory", self.argvHistory |
|
1185 ) |
1009 Preferences.getSettings().setValue( |
1186 Preferences.getSettings().setValue( |
1010 'DebugInfo/WorkingDirectoryHistory', self.wdHistory) |
1187 "DebugInfo/WorkingDirectoryHistory", self.wdHistory |
|
1188 ) |
1011 Preferences.getSettings().setValue( |
1189 Preferences.getSettings().setValue( |
1012 'DebugInfo/EnvironmentHistory', self.envHistory) |
1190 "DebugInfo/EnvironmentHistory", self.envHistory |
|
1191 ) |
|
1192 Preferences.getSettings().setValue("DebugInfo/Exceptions", self.excList) |
1013 Preferences.getSettings().setValue( |
1193 Preferences.getSettings().setValue( |
1014 'DebugInfo/Exceptions', self.excList) |
1194 "DebugInfo/IgnoredExceptions", self.excIgnoreList |
|
1195 ) |
1015 Preferences.getSettings().setValue( |
1196 Preferences.getSettings().setValue( |
1016 'DebugInfo/IgnoredExceptions', self.excIgnoreList) |
1197 "DebugInfo/ReportExceptions", self.exceptions |
|
1198 ) |
1017 Preferences.getSettings().setValue( |
1199 Preferences.getSettings().setValue( |
1018 'DebugInfo/ReportExceptions', self.exceptions) |
1200 "DebugInfo/AutoClearShell", self.autoClearShell |
|
1201 ) |
|
1202 Preferences.getSettings().setValue("DebugInfo/TracePython", self.tracePython) |
|
1203 Preferences.getSettings().setValue("DebugInfo/AutoContinue", self.autoContinue) |
1019 Preferences.getSettings().setValue( |
1204 Preferences.getSettings().setValue( |
1020 'DebugInfo/AutoClearShell', self.autoClearShell) |
1205 "DebugInfo/EnableMultiprocess", self.enableMultiprocess |
|
1206 ) |
1021 Preferences.getSettings().setValue( |
1207 Preferences.getSettings().setValue( |
1022 'DebugInfo/TracePython', self.tracePython) |
1208 "DebugInfo/MultiprocessNoDebugHistory", self.multiprocessNoDebugHistory |
|
1209 ) |
1023 Preferences.getSettings().setValue( |
1210 Preferences.getSettings().setValue( |
1024 'DebugInfo/AutoContinue', self.autoContinue) |
1211 "DebugInfo/OverrideGlobal", self.overrideGlobalConfig["enable"] |
|
1212 ) |
1025 Preferences.getSettings().setValue( |
1213 Preferences.getSettings().setValue( |
1026 'DebugInfo/EnableMultiprocess', self.enableMultiprocess) |
1214 "DebugInfo/RedirectStdinStdout", self.overrideGlobalConfig["redirect"] |
1027 Preferences.getSettings().setValue( |
1215 ) |
1028 'DebugInfo/MultiprocessNoDebugHistory', |
1216 |
1029 self.multiprocessNoDebugHistory) |
|
1030 Preferences.getSettings().setValue( |
|
1031 'DebugInfo/OverrideGlobal', |
|
1032 self.overrideGlobalConfig["enable"]) |
|
1033 Preferences.getSettings().setValue( |
|
1034 'DebugInfo/RedirectStdinStdout', |
|
1035 self.overrideGlobalConfig["redirect"]) |
|
1036 |
|
1037 def shutdownServer(self): |
1217 def shutdownServer(self): |
1038 """ |
1218 """ |
1039 Public method to shut down the debug server. |
1219 Public method to shut down the debug server. |
1040 |
1220 |
1041 This is needed to cleanly close the sockets on Win OS. |
1221 This is needed to cleanly close the sockets on Win OS. |
1042 |
1222 |
1043 @return always true |
1223 @return always true |
1044 """ |
1224 """ |
1045 self.debugServer.shutdownServer() |
1225 self.debugServer.shutdownServer() |
1046 return True |
1226 return True |
1047 |
1227 |
1048 def __resetUI(self, fullReset=True): |
1228 def __resetUI(self, fullReset=True): |
1049 """ |
1229 """ |
1050 Private slot to reset the user interface. |
1230 Private slot to reset the user interface. |
1051 |
1231 |
1052 @param fullReset flag indicating a full reset is required |
1232 @param fullReset flag indicating a full reset is required |
1053 @type bool |
1233 @type bool |
1054 """ |
1234 """ |
1055 self.lastAction = -1 |
1235 self.lastAction = -1 |
1056 self.debugActGrp.setEnabled(False) |
1236 self.debugActGrp.setEnabled(False) |
1057 self.__clientDebuggerIds.clear() |
1237 self.__clientDebuggerIds.clear() |
1058 |
1238 |
1059 if not self.passive: |
1239 if not self.passive: |
1060 if self.editorOpen: |
1240 if self.editorOpen: |
1061 editor = self.viewmanager.activeWindow() |
1241 editor = self.viewmanager.activeWindow() |
1062 else: |
1242 else: |
1063 editor = None |
1243 editor = None |
1064 self.__checkActions(editor) |
1244 self.__checkActions(editor) |
1065 |
1245 |
1066 self.debugProjectAct.setEnabled(self.projectOpen) |
1246 self.debugProjectAct.setEnabled(self.projectOpen) |
1067 self.runProjectAct.setEnabled(self.projectOpen) |
1247 self.runProjectAct.setEnabled(self.projectOpen) |
1068 self.profileProjectAct.setEnabled(self.projectOpen) |
1248 self.profileProjectAct.setEnabled(self.projectOpen) |
1069 self.coverageProjectAct.setEnabled(self.projectOpen) |
1249 self.coverageProjectAct.setEnabled(self.projectOpen) |
1070 if ( |
1250 if self.lastDebuggedFile is not None and ( |
1071 self.lastDebuggedFile is not None and |
1251 self.editorOpen or self.projectOpen |
1072 (self.editorOpen or self.projectOpen) |
|
1073 ): |
1252 ): |
1074 self.restartAct.setEnabled(True) |
1253 self.restartAct.setEnabled(True) |
1075 else: |
1254 else: |
1076 self.restartAct.setEnabled(False) |
1255 self.restartAct.setEnabled(False) |
1077 self.stopAct.setEnabled(False) |
1256 self.stopAct.setEnabled(False) |
1078 |
1257 |
1079 self.resetUI.emit(fullReset) |
1258 self.resetUI.emit(fullReset) |
1080 |
1259 |
1081 def __clientDebuggerId(self, debuggerId): |
1260 def __clientDebuggerId(self, debuggerId): |
1082 """ |
1261 """ |
1083 Private slot to track the list of connected debuggers. |
1262 Private slot to track the list of connected debuggers. |
1084 |
1263 |
1085 @param debuggerId ID of the debugger backend |
1264 @param debuggerId ID of the debugger backend |
1086 @type str |
1265 @type str |
1087 """ |
1266 """ |
1088 self.__clientDebuggerIds.add(debuggerId) |
1267 self.__clientDebuggerIds.add(debuggerId) |
1089 |
1268 |
1090 def __clientLine(self, fn, line, debuggerId, threadName, forStack): |
1269 def __clientLine(self, fn, line, debuggerId, threadName, forStack): |
1091 """ |
1270 """ |
1092 Private method to handle a change to the current line. |
1271 Private method to handle a change to the current line. |
1093 |
1272 |
1094 @param fn filename |
1273 @param fn filename |
1095 @type str |
1274 @type str |
1096 @param line linenumber |
1275 @param line linenumber |
1097 @type int |
1276 @type int |
1098 @param debuggerId ID of the debugger backend |
1277 @param debuggerId ID of the debugger backend |
1789 else: |
2017 else: |
1790 # run current editor |
2018 # run current editor |
1791 editor = self.viewmanager.activeWindow() |
2019 editor = self.viewmanager.activeWindow() |
1792 if editor is None: |
2020 if editor is None: |
1793 return |
2021 return |
1794 |
2022 |
1795 if ( |
2023 if ( |
1796 not self.viewmanager.checkDirty( |
2024 not self.viewmanager.checkDirty( |
1797 editor, Preferences.getDebugger("Autosave")) or |
2025 editor, Preferences.getDebugger("Autosave") |
1798 editor.getFileName() is None |
2026 ) |
|
2027 or editor.getFileName() is None |
1799 ): |
2028 ): |
1800 return |
2029 return |
1801 |
2030 |
1802 fn = editor.getFileName() |
2031 fn = editor.getFileName() |
1803 self.clientType = editor.determineFileType() |
2032 self.clientType = editor.determineFileType() |
1804 self.lastStartAction = 5 |
2033 self.lastStartAction = 5 |
1805 |
2034 |
1806 # save the filename for use by the restart method |
2035 # save the filename for use by the restart method |
1807 self.lastDebuggedFile = fn |
2036 self.lastDebuggedFile = fn |
1808 self.restartAct.setEnabled(True) |
2037 self.restartAct.setEnabled(True) |
1809 |
2038 |
1810 # save the most recently used virtual environment |
2039 # save the most recently used virtual environment |
1811 self.lastUsedVenvName = lastUsedVenvName |
2040 self.lastUsedVenvName = lastUsedVenvName |
1812 |
2041 |
1813 # This moves any previous occurrence of these arguments to the head |
2042 # This moves any previous occurrence of these arguments to the head |
1814 # of the list. |
2043 # of the list. |
1815 self.setScriptsHistory(scriptName) |
2044 self.setScriptsHistory(scriptName) |
1816 self.setArgvHistory(argv) |
2045 self.setArgvHistory(argv) |
1817 self.setWdHistory(wd) |
2046 self.setWdHistory(wd) |
1818 self.setEnvHistory(env) |
2047 self.setEnvHistory(env) |
1819 |
2048 |
1820 # Save the exception flags |
2049 # Save the exception flags |
1821 self.exceptions = exceptions |
2050 self.exceptions = exceptions |
1822 |
2051 |
1823 # Save the erase coverage flag |
2052 # Save the erase coverage flag |
1824 self.eraseCoverage = eraseCoverage |
2053 self.eraseCoverage = eraseCoverage |
1825 |
2054 |
1826 # Save the clear interpreter flag |
2055 # Save the clear interpreter flag |
1827 self.autoClearShell = clearShell |
2056 self.autoClearShell = clearShell |
1828 |
2057 |
1829 # Save the run in console flag |
2058 # Save the run in console flag |
1830 self.runInConsole = console |
2059 self.runInConsole = console |
1831 |
2060 |
1832 # Save the global config override data |
2061 # Save the global config override data |
1833 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
2062 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
1834 |
2063 |
1835 # Hide all error highlights |
2064 # Hide all error highlights |
1836 self.viewmanager.unhighlight() |
2065 self.viewmanager.unhighlight() |
1837 |
2066 |
1838 if not doNotStart: |
2067 if not doNotStart: |
1839 if runProject and self.project.getProjectType() in [ |
2068 if runProject and self.project.getProjectType() in ["E7Plugin"]: |
1840 "E7Plugin"]: |
|
1841 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2069 argv = '--plugin="{0}" {1}'.format(fn, argv) |
1842 fn = os.path.join(getConfig('ericDir'), "eric7.py") |
2070 fn = os.path.join(getConfig("ericDir"), "eric7.py") |
1843 |
2071 |
1844 self.debugViewer.initCallStackViewer(runProject) |
2072 self.debugViewer.initCallStackViewer(runProject) |
1845 |
2073 |
1846 # Ask the client to open the new program. |
2074 # Ask the client to open the new program. |
1847 self.debugServer.remoteCoverage( |
2075 self.debugServer.remoteCoverage( |
1848 lastUsedVenvName, fn, argv, wd, env, |
2076 lastUsedVenvName, |
1849 autoClearShell=self.autoClearShell, erase=eraseCoverage, |
2077 fn, |
1850 forProject=runProject, runInConsole=console, |
2078 argv, |
|
2079 wd, |
|
2080 env, |
|
2081 autoClearShell=self.autoClearShell, |
|
2082 erase=eraseCoverage, |
|
2083 forProject=runProject, |
|
2084 runInConsole=console, |
1851 clientType=self.clientType, |
2085 clientType=self.clientType, |
1852 configOverride=self.overrideGlobalConfig) |
2086 configOverride=self.overrideGlobalConfig, |
1853 |
2087 ) |
|
2088 |
1854 self.stopAct.setEnabled(True) |
2089 self.stopAct.setEnabled(True) |
1855 |
2090 |
1856 if dlg.clearHistories(): |
2091 if dlg.clearHistories(): |
1857 self.setScriptsHistory("", clearHistories=True) |
2092 self.setScriptsHistory("", clearHistories=True) |
1858 self.setArgvHistory("", clearHistories=True) |
2093 self.setArgvHistory("", clearHistories=True) |
1859 self.setWdHistory("", clearHistories=True) |
2094 self.setWdHistory("", clearHistories=True) |
1860 self.setEnvHistory("", clearHistories=True) |
2095 self.setEnvHistory("", clearHistories=True) |
1861 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
2096 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
1862 elif dlg.historiesModified(): |
2097 elif dlg.historiesModified(): |
1863 (scriptsHistory, argvHistory, wdHistory, envHistory, |
2098 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories() |
1864 _) = dlg.getHistories() |
|
1865 self.setScriptsHistory("", history=scriptsHistory) |
2099 self.setScriptsHistory("", history=scriptsHistory) |
1866 self.setArgvHistory("", history=argvHistory) |
2100 self.setArgvHistory("", history=argvHistory) |
1867 self.setWdHistory("", history=wdHistory) |
2101 self.setWdHistory("", history=wdHistory) |
1868 self.setEnvHistory("", history=envHistory) |
2102 self.setEnvHistory("", history=envHistory) |
1869 |
2103 |
1870 def __profileScript(self): |
2104 def __profileScript(self): |
1871 """ |
2105 """ |
1872 Private slot to handle the profile script action. |
2106 Private slot to handle the profile script action. |
1873 """ |
2107 """ |
1874 self.doProfile(False) |
2108 self.doProfile(False) |
1875 |
2109 |
1876 def __profileProject(self): |
2110 def __profileProject(self): |
1877 """ |
2111 """ |
1878 Private slot to handle the profile project action. |
2112 Private slot to handle the profile project action. |
1879 """ |
2113 """ |
1880 self.__compileChangedProjectFiles() |
2114 self.__compileChangedProjectFiles() |
1881 self.doProfile(True) |
2115 self.doProfile(True) |
1882 |
2116 |
1883 def doProfile(self, runProject, script=""): |
2117 def doProfile(self, runProject, script=""): |
1884 """ |
2118 """ |
1885 Public method to handle the profile actions. |
2119 Public method to handle the profile actions. |
1886 |
2120 |
1887 @param runProject flag indicating profiling of the current project |
2121 @param runProject flag indicating profiling of the current project |
1888 (True) or script (False) |
2122 (True) or script (False) |
1889 @type bool |
2123 @type bool |
1890 @param script name of a script (optional) |
2124 @param script name of a script (optional) |
1891 @type str |
2125 @type str |
1892 """ |
2126 """ |
1893 from .StartDialog import StartDialog |
2127 from .StartDialog import StartDialog |
1894 |
2128 |
1895 self.__resetUI() |
2129 self.__resetUI() |
1896 doNotStart = False |
2130 doNotStart = False |
1897 |
2131 |
1898 # Get the command line arguments, the working directory and the |
2132 # Get the command line arguments, the working directory and the |
1899 # exception reporting flag. |
2133 # exception reporting flag. |
1900 cap = ( |
2134 cap = ( |
1901 self.tr("Profile of Project") |
2135 self.tr("Profile of Project") |
1902 if runProject else |
2136 if runProject |
1903 self.tr("Profile of Script") |
2137 else self.tr("Profile of Script") |
1904 ) |
2138 ) |
1905 if runProject: |
2139 if runProject: |
1906 scriptName = self.project.getMainScript(True) |
2140 scriptName = self.project.getMainScript(True) |
1907 elif script: |
2141 elif script: |
1908 scriptName = script |
2142 scriptName = script |
1909 elif self.lastDebuggedFile: |
2143 elif self.lastDebuggedFile: |
1910 scriptName = self.lastDebuggedFile |
2144 scriptName = self.lastDebuggedFile |
1911 else: |
2145 else: |
1912 scriptName = "" |
2146 scriptName = "" |
1913 dlg = StartDialog( |
2147 dlg = StartDialog( |
1914 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, |
2148 cap, |
1915 self.envHistory, self.exceptions, self.ui, 3, |
2149 self.lastUsedVenvName, |
|
2150 self.argvHistory, |
|
2151 self.wdHistory, |
|
2152 self.envHistory, |
|
2153 self.exceptions, |
|
2154 self.ui, |
|
2155 3, |
1916 autoClearShell=self.autoClearShell, |
2156 autoClearShell=self.autoClearShell, |
1917 configOverride=self.overrideGlobalConfig, |
2157 configOverride=self.overrideGlobalConfig, |
1918 forProject=runProject, scriptName=scriptName, |
2158 forProject=runProject, |
1919 scriptsList=self.scriptsHistory) |
2159 scriptName=scriptName, |
|
2160 scriptsList=self.scriptsHistory, |
|
2161 ) |
1920 if dlg.exec() == QDialog.DialogCode.Accepted: |
2162 if dlg.exec() == QDialog.DialogCode.Accepted: |
1921 (lastUsedVenvName, scriptName, argv, wd, env, exceptions, |
2163 ( |
1922 clearShell, console) = dlg.getData() |
2164 lastUsedVenvName, |
|
2165 scriptName, |
|
2166 argv, |
|
2167 wd, |
|
2168 env, |
|
2169 exceptions, |
|
2170 clearShell, |
|
2171 console, |
|
2172 ) = dlg.getData() |
1923 configOverride = dlg.getGlobalOverrideData() |
2173 configOverride = dlg.getGlobalOverrideData() |
1924 eraseTimings = dlg.getProfilingData() |
2174 eraseTimings = dlg.getProfilingData() |
1925 |
2175 |
1926 if runProject: |
2176 if runProject: |
1927 fn = self.project.getMainScript(True) |
2177 fn = self.project.getMainScript(True) |
1928 if fn is None: |
2178 if fn is None: |
1929 EricMessageBox.critical( |
2179 EricMessageBox.critical( |
1930 self.ui, |
2180 self.ui, |
1931 self.tr("Profile of Project"), |
2181 self.tr("Profile of Project"), |
1932 self.tr( |
2182 self.tr( |
1933 "There is no main script defined for the" |
2183 "There is no main script defined for the" |
1934 " current project. Aborting")) |
2184 " current project. Aborting" |
|
2185 ), |
|
2186 ) |
1935 return |
2187 return |
1936 |
2188 |
1937 if ( |
2189 if Preferences.getDebugger( |
1938 Preferences.getDebugger("Autosave") and |
2190 "Autosave" |
1939 not self.project.saveAllScripts(reportSyntaxErrors=True) |
2191 ) and not self.project.saveAllScripts(reportSyntaxErrors=True): |
1940 ): |
|
1941 doNotStart = True |
2192 doNotStart = True |
1942 |
2193 |
1943 # save the info for later use |
2194 # save the info for later use |
1944 self.project.setDbgInfo( |
2195 self.project.setDbgInfo( |
1945 lastUsedVenvName, argv, wd, env, exceptions, self.excList, |
2196 lastUsedVenvName, |
1946 self.excIgnoreList, clearShell, |
2197 argv, |
1947 configOverride=configOverride |
2198 wd, |
|
2199 env, |
|
2200 exceptions, |
|
2201 self.excList, |
|
2202 self.excIgnoreList, |
|
2203 clearShell, |
|
2204 configOverride=configOverride, |
1948 ) |
2205 ) |
1949 |
2206 |
1950 self.lastStartAction = 8 |
2207 self.lastStartAction = 8 |
1951 self.clientType = self.project.getProjectLanguage() |
2208 self.clientType = self.project.getProjectLanguage() |
1952 else: |
2209 else: |
1953 if scriptName: |
2210 if scriptName: |
1954 fn = scriptName |
2211 fn = scriptName |
1956 else: |
2213 else: |
1957 # run current editor |
2214 # run current editor |
1958 editor = self.viewmanager.activeWindow() |
2215 editor = self.viewmanager.activeWindow() |
1959 if editor is None: |
2216 if editor is None: |
1960 return |
2217 return |
1961 |
2218 |
1962 if ( |
2219 if ( |
1963 not self.viewmanager.checkDirty( |
2220 not self.viewmanager.checkDirty( |
1964 editor, Preferences.getDebugger("Autosave")) or |
2221 editor, Preferences.getDebugger("Autosave") |
1965 editor.getFileName() is None |
2222 ) |
|
2223 or editor.getFileName() is None |
1966 ): |
2224 ): |
1967 return |
2225 return |
1968 |
2226 |
1969 fn = editor.getFileName() |
2227 fn = editor.getFileName() |
1970 self.clientType = editor.determineFileType() |
2228 self.clientType = editor.determineFileType() |
1971 self.lastStartAction = 7 |
2229 self.lastStartAction = 7 |
1972 |
2230 |
1973 # save the filename for use by the restart method |
2231 # save the filename for use by the restart method |
1974 self.lastDebuggedFile = fn |
2232 self.lastDebuggedFile = fn |
1975 self.restartAct.setEnabled(True) |
2233 self.restartAct.setEnabled(True) |
1976 |
2234 |
1977 # save the most recently used virtual environment |
2235 # save the most recently used virtual environment |
1978 self.lastUsedVenvName = lastUsedVenvName |
2236 self.lastUsedVenvName = lastUsedVenvName |
1979 |
2237 |
1980 # This moves any previous occurrence of these arguments to the head |
2238 # This moves any previous occurrence of these arguments to the head |
1981 # of the list. |
2239 # of the list. |
1982 self.setScriptsHistory(scriptName) |
2240 self.setScriptsHistory(scriptName) |
1983 self.setArgvHistory(argv) |
2241 self.setArgvHistory(argv) |
1984 self.setWdHistory(wd) |
2242 self.setWdHistory(wd) |
1985 self.setEnvHistory(env) |
2243 self.setEnvHistory(env) |
1986 |
2244 |
1987 # Save the exception flags |
2245 # Save the exception flags |
1988 self.exceptions = exceptions |
2246 self.exceptions = exceptions |
1989 |
2247 |
1990 # Save the erase timing flag |
2248 # Save the erase timing flag |
1991 self.eraseTimings = eraseTimings |
2249 self.eraseTimings = eraseTimings |
1992 |
2250 |
1993 # Save the clear interpreter flag |
2251 # Save the clear interpreter flag |
1994 self.autoClearShell = clearShell |
2252 self.autoClearShell = clearShell |
1995 |
2253 |
1996 # Save the run in console flag |
2254 # Save the run in console flag |
1997 self.runInConsole = console |
2255 self.runInConsole = console |
1998 |
2256 |
1999 # Save the global config override data |
2257 # Save the global config override data |
2000 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
2258 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
2001 |
2259 |
2002 # Hide all error highlights |
2260 # Hide all error highlights |
2003 self.viewmanager.unhighlight() |
2261 self.viewmanager.unhighlight() |
2004 |
2262 |
2005 if not doNotStart: |
2263 if not doNotStart: |
2006 if runProject and self.project.getProjectType() in [ |
2264 if runProject and self.project.getProjectType() in ["E7Plugin"]: |
2007 "E7Plugin"]: |
|
2008 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2265 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2009 fn = os.path.join(getConfig('ericDir'), "eric7.py") |
2266 fn = os.path.join(getConfig("ericDir"), "eric7.py") |
2010 |
2267 |
2011 self.debugViewer.initCallStackViewer(runProject) |
2268 self.debugViewer.initCallStackViewer(runProject) |
2012 |
2269 |
2013 # Ask the client to open the new program. |
2270 # Ask the client to open the new program. |
2014 self.debugServer.remoteProfile( |
2271 self.debugServer.remoteProfile( |
2015 lastUsedVenvName, fn, argv, wd, env, |
2272 lastUsedVenvName, |
2016 autoClearShell=self.autoClearShell, erase=eraseTimings, |
2273 fn, |
2017 forProject=runProject, runInConsole=console, |
2274 argv, |
|
2275 wd, |
|
2276 env, |
|
2277 autoClearShell=self.autoClearShell, |
|
2278 erase=eraseTimings, |
|
2279 forProject=runProject, |
|
2280 runInConsole=console, |
2018 clientType=self.clientType, |
2281 clientType=self.clientType, |
2019 configOverride=self.overrideGlobalConfig) |
2282 configOverride=self.overrideGlobalConfig, |
2020 |
2283 ) |
|
2284 |
2021 self.stopAct.setEnabled(True) |
2285 self.stopAct.setEnabled(True) |
2022 |
2286 |
2023 if dlg.clearHistories(): |
2287 if dlg.clearHistories(): |
2024 self.setScriptsHistory("", clearHistories=True) |
2288 self.setScriptsHistory("", clearHistories=True) |
2025 self.setArgvHistory("", clearHistories=True) |
2289 self.setArgvHistory("", clearHistories=True) |
2026 self.setWdHistory("", clearHistories=True) |
2290 self.setWdHistory("", clearHistories=True) |
2027 self.setEnvHistory("", clearHistories=True) |
2291 self.setEnvHistory("", clearHistories=True) |
2028 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
2292 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
2029 elif dlg.historiesModified(): |
2293 elif dlg.historiesModified(): |
2030 (scriptsHistory, argvHistory, wdHistory, envHistory, |
2294 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories() |
2031 _) = dlg.getHistories() |
|
2032 self.setScriptsHistory("", history=scriptsHistory) |
2295 self.setScriptsHistory("", history=scriptsHistory) |
2033 self.setArgvHistory("", history=argvHistory) |
2296 self.setArgvHistory("", history=argvHistory) |
2034 self.setWdHistory("", history=wdHistory) |
2297 self.setWdHistory("", history=wdHistory) |
2035 self.setEnvHistory("", history=envHistory) |
2298 self.setEnvHistory("", history=envHistory) |
2036 |
2299 |
2037 def __runScript(self): |
2300 def __runScript(self): |
2038 """ |
2301 """ |
2039 Private slot to handle the run script action. |
2302 Private slot to handle the run script action. |
2040 """ |
2303 """ |
2041 self.doRun(False) |
2304 self.doRun(False) |
2042 |
2305 |
2043 def __runProject(self): |
2306 def __runProject(self): |
2044 """ |
2307 """ |
2045 Private slot to handle the run project action. |
2308 Private slot to handle the run project action. |
2046 """ |
2309 """ |
2047 self.__compileChangedProjectFiles() |
2310 self.__compileChangedProjectFiles() |
2048 self.doRun(True) |
2311 self.doRun(True) |
2049 |
2312 |
2050 def doRun(self, runProject, script=""): |
2313 def doRun(self, runProject, script=""): |
2051 """ |
2314 """ |
2052 Public method to handle the run actions. |
2315 Public method to handle the run actions. |
2053 |
2316 |
2054 @param runProject flag indicating running the current project (True) |
2317 @param runProject flag indicating running the current project (True) |
2055 or script (False) |
2318 or script (False) |
2056 @type bool |
2319 @type bool |
2057 @param script name of a script (optional) |
2320 @param script name of a script (optional) |
2058 @type str |
2321 @type str |
2059 """ |
2322 """ |
2060 from .StartDialog import StartDialog |
2323 from .StartDialog import StartDialog |
2061 |
2324 |
2062 self.__resetUI() |
2325 self.__resetUI() |
2063 doNotStart = False |
2326 doNotStart = False |
2064 |
2327 |
2065 # Get the command line arguments, the working directory and the |
2328 # Get the command line arguments, the working directory and the |
2066 # exception reporting flag. |
2329 # exception reporting flag. |
2067 cap = ( |
2330 cap = self.tr("Run Project") if runProject else self.tr("Run Script") |
2068 self.tr("Run Project") |
|
2069 if runProject else |
|
2070 self.tr("Run Script") |
|
2071 ) |
|
2072 if runProject: |
2331 if runProject: |
2073 scriptName = self.project.getMainScript(True) |
2332 scriptName = self.project.getMainScript(True) |
2074 elif script: |
2333 elif script: |
2075 scriptName = script |
2334 scriptName = script |
2076 elif self.lastDebuggedFile: |
2335 elif self.lastDebuggedFile: |
2077 scriptName = self.lastDebuggedFile |
2336 scriptName = self.lastDebuggedFile |
2078 else: |
2337 else: |
2079 scriptName = "" |
2338 scriptName = "" |
2080 dlg = StartDialog( |
2339 dlg = StartDialog( |
2081 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, |
2340 cap, |
2082 self.envHistory, self.exceptions, self.ui, 1, |
2341 self.lastUsedVenvName, |
|
2342 self.argvHistory, |
|
2343 self.wdHistory, |
|
2344 self.envHistory, |
|
2345 self.exceptions, |
|
2346 self.ui, |
|
2347 1, |
2083 autoClearShell=self.autoClearShell, |
2348 autoClearShell=self.autoClearShell, |
2084 configOverride=self.overrideGlobalConfig, |
2349 configOverride=self.overrideGlobalConfig, |
2085 forProject=runProject, scriptName=scriptName, |
2350 forProject=runProject, |
2086 scriptsList=self.scriptsHistory) |
2351 scriptName=scriptName, |
|
2352 scriptsList=self.scriptsHistory, |
|
2353 ) |
2087 if dlg.exec() == QDialog.DialogCode.Accepted: |
2354 if dlg.exec() == QDialog.DialogCode.Accepted: |
2088 (lastUsedVenvName, scriptName, argv, wd, env, exceptions, |
2355 ( |
2089 clearShell, console) = dlg.getData() |
2356 lastUsedVenvName, |
|
2357 scriptName, |
|
2358 argv, |
|
2359 wd, |
|
2360 env, |
|
2361 exceptions, |
|
2362 clearShell, |
|
2363 console, |
|
2364 ) = dlg.getData() |
2090 configOverride = dlg.getGlobalOverrideData() |
2365 configOverride = dlg.getGlobalOverrideData() |
2091 |
2366 |
2092 if runProject: |
2367 if runProject: |
2093 fn = self.project.getMainScript(True) |
2368 fn = self.project.getMainScript(True) |
2094 if fn is None: |
2369 if fn is None: |
2095 EricMessageBox.critical( |
2370 EricMessageBox.critical( |
2096 self.ui, |
2371 self.ui, |
2097 self.tr("Run Project"), |
2372 self.tr("Run Project"), |
2098 self.tr( |
2373 self.tr( |
2099 "There is no main script defined for the" |
2374 "There is no main script defined for the" |
2100 " current project. Aborting")) |
2375 " current project. Aborting" |
|
2376 ), |
|
2377 ) |
2101 return |
2378 return |
2102 |
2379 |
2103 if ( |
2380 if Preferences.getDebugger( |
2104 Preferences.getDebugger("Autosave") and |
2381 "Autosave" |
2105 not self.project.saveAllScripts(reportSyntaxErrors=True) |
2382 ) and not self.project.saveAllScripts(reportSyntaxErrors=True): |
2106 ): |
|
2107 doNotStart = True |
2383 doNotStart = True |
2108 |
2384 |
2109 # save the info for later use |
2385 # save the info for later use |
2110 self.project.setDbgInfo( |
2386 self.project.setDbgInfo( |
2111 lastUsedVenvName, argv, wd, env, exceptions, self.excList, |
2387 lastUsedVenvName, |
2112 self.excIgnoreList, clearShell, |
2388 argv, |
2113 configOverride=configOverride |
2389 wd, |
|
2390 env, |
|
2391 exceptions, |
|
2392 self.excList, |
|
2393 self.excIgnoreList, |
|
2394 clearShell, |
|
2395 configOverride=configOverride, |
2114 ) |
2396 ) |
2115 |
2397 |
2116 self.lastStartAction = 4 |
2398 self.lastStartAction = 4 |
2117 self.clientType = self.project.getProjectLanguage() |
2399 self.clientType = self.project.getProjectLanguage() |
2118 else: |
2400 else: |
2119 if scriptName: |
2401 if scriptName: |
2120 fn = scriptName |
2402 fn = scriptName |
2122 else: |
2404 else: |
2123 # run current editor |
2405 # run current editor |
2124 editor = self.viewmanager.activeWindow() |
2406 editor = self.viewmanager.activeWindow() |
2125 if editor is None: |
2407 if editor is None: |
2126 return |
2408 return |
2127 |
2409 |
2128 if ( |
2410 if ( |
2129 not self.viewmanager.checkDirty( |
2411 not self.viewmanager.checkDirty( |
2130 editor, |
2412 editor, Preferences.getDebugger("Autosave") |
2131 Preferences.getDebugger("Autosave")) or |
2413 ) |
2132 editor.getFileName() is None |
2414 or editor.getFileName() is None |
2133 ): |
2415 ): |
2134 return |
2416 return |
2135 |
2417 |
2136 fn = editor.getFileName() |
2418 fn = editor.getFileName() |
2137 self.clientType = editor.determineFileType() |
2419 self.clientType = editor.determineFileType() |
2138 self.lastStartAction = 3 |
2420 self.lastStartAction = 3 |
2139 |
2421 |
2140 # save the filename for use by the restart method |
2422 # save the filename for use by the restart method |
2141 self.lastDebuggedFile = fn |
2423 self.lastDebuggedFile = fn |
2142 self.restartAct.setEnabled(True) |
2424 self.restartAct.setEnabled(True) |
2143 |
2425 |
2144 # save the most recently used virtual environment |
2426 # save the most recently used virtual environment |
2145 self.lastUsedVenvName = lastUsedVenvName |
2427 self.lastUsedVenvName = lastUsedVenvName |
2146 |
2428 |
2147 # This moves any previous occurrence of these arguments to the head |
2429 # This moves any previous occurrence of these arguments to the head |
2148 # of the list. |
2430 # of the list. |
2149 self.setScriptsHistory(scriptName) |
2431 self.setScriptsHistory(scriptName) |
2150 self.setArgvHistory(argv) |
2432 self.setArgvHistory(argv) |
2151 self.setWdHistory(wd) |
2433 self.setWdHistory(wd) |
2152 self.setEnvHistory(env) |
2434 self.setEnvHistory(env) |
2153 |
2435 |
2154 # Save the exception flags |
2436 # Save the exception flags |
2155 self.exceptions = exceptions |
2437 self.exceptions = exceptions |
2156 |
2438 |
2157 # Save the clear interpreter flag |
2439 # Save the clear interpreter flag |
2158 self.autoClearShell = clearShell |
2440 self.autoClearShell = clearShell |
2159 |
2441 |
2160 # Save the run in console flag |
2442 # Save the run in console flag |
2161 self.runInConsole = console |
2443 self.runInConsole = console |
2162 |
2444 |
2163 # Save the global config override data |
2445 # Save the global config override data |
2164 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
2446 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
2165 |
2447 |
2166 # Hide all error highlights |
2448 # Hide all error highlights |
2167 self.viewmanager.unhighlight() |
2449 self.viewmanager.unhighlight() |
2168 |
2450 |
2169 if not doNotStart: |
2451 if not doNotStart: |
2170 if runProject and self.project.getProjectType() in [ |
2452 if runProject and self.project.getProjectType() in ["E7Plugin"]: |
2171 "E7Plugin"]: |
|
2172 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2453 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2173 fn = os.path.join(getConfig('ericDir'), "eric7.py") |
2454 fn = os.path.join(getConfig("ericDir"), "eric7.py") |
2174 |
2455 |
2175 self.debugViewer.initCallStackViewer(runProject) |
2456 self.debugViewer.initCallStackViewer(runProject) |
2176 |
2457 |
2177 # Ask the client to open the new program. |
2458 # Ask the client to open the new program. |
2178 self.debugServer.remoteRun( |
2459 self.debugServer.remoteRun( |
2179 lastUsedVenvName, fn, argv, wd, env, |
2460 lastUsedVenvName, |
2180 autoClearShell=self.autoClearShell, forProject=runProject, |
2461 fn, |
2181 runInConsole=console, clientType=self.clientType, |
2462 argv, |
2182 configOverride=self.overrideGlobalConfig) |
2463 wd, |
2183 |
2464 env, |
|
2465 autoClearShell=self.autoClearShell, |
|
2466 forProject=runProject, |
|
2467 runInConsole=console, |
|
2468 clientType=self.clientType, |
|
2469 configOverride=self.overrideGlobalConfig, |
|
2470 ) |
|
2471 |
2184 self.stopAct.setEnabled(True) |
2472 self.stopAct.setEnabled(True) |
2185 |
2473 |
2186 if dlg.clearHistories(): |
2474 if dlg.clearHistories(): |
2187 self.setScriptsHistory("", clearHistories=True) |
2475 self.setScriptsHistory("", clearHistories=True) |
2188 self.setArgvHistory("", clearHistories=True) |
2476 self.setArgvHistory("", clearHistories=True) |
2189 self.setWdHistory("", clearHistories=True) |
2477 self.setWdHistory("", clearHistories=True) |
2190 self.setEnvHistory("", clearHistories=True) |
2478 self.setEnvHistory("", clearHistories=True) |
2191 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
2479 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
2192 elif dlg.historiesModified(): |
2480 elif dlg.historiesModified(): |
2193 (scriptsHistory, argvHistory, wdHistory, envHistory, |
2481 (scriptsHistory, argvHistory, wdHistory, envHistory, _) = dlg.getHistories() |
2194 _) = dlg.getHistories() |
|
2195 self.setScriptsHistory("", history=scriptsHistory) |
2482 self.setScriptsHistory("", history=scriptsHistory) |
2196 self.setArgvHistory("", history=argvHistory) |
2483 self.setArgvHistory("", history=argvHistory) |
2197 self.setWdHistory("", history=wdHistory) |
2484 self.setWdHistory("", history=wdHistory) |
2198 self.setEnvHistory("", history=envHistory) |
2485 self.setEnvHistory("", history=envHistory) |
2199 |
2486 |
2200 def __debugScript(self): |
2487 def __debugScript(self): |
2201 """ |
2488 """ |
2202 Private slot to handle the debug script action. |
2489 Private slot to handle the debug script action. |
2203 """ |
2490 """ |
2204 self.doDebug(False) |
2491 self.doDebug(False) |
2205 |
2492 |
2206 def __debugProject(self): |
2493 def __debugProject(self): |
2207 """ |
2494 """ |
2208 Private slot to handle the debug project action. |
2495 Private slot to handle the debug project action. |
2209 """ |
2496 """ |
2210 self.__compileChangedProjectFiles() |
2497 self.__compileChangedProjectFiles() |
2211 self.doDebug(True) |
2498 self.doDebug(True) |
2212 |
2499 |
2213 def doDebug(self, debugProject, script=""): |
2500 def doDebug(self, debugProject, script=""): |
2214 """ |
2501 """ |
2215 Public method to handle the debug actions. |
2502 Public method to handle the debug actions. |
2216 |
2503 |
2217 @param debugProject flag indicating debugging the current project |
2504 @param debugProject flag indicating debugging the current project |
2218 (True) or script (False) |
2505 (True) or script (False) |
2219 @type bool |
2506 @type bool |
2220 @param script name of a script (optional) |
2507 @param script name of a script (optional) |
2221 @type str |
2508 @type str |
2222 """ |
2509 """ |
2223 from .StartDialog import StartDialog |
2510 from .StartDialog import StartDialog |
2224 |
2511 |
2225 self.__resetUI() |
2512 self.__resetUI() |
2226 doNotStart = False |
2513 doNotStart = False |
2227 |
2514 |
2228 # Get the command line arguments, the working directory and the |
2515 # Get the command line arguments, the working directory and the |
2229 # exception reporting flag. |
2516 # exception reporting flag. |
2230 cap = ( |
2517 cap = self.tr("Debug Project") if debugProject else self.tr("Debug Script") |
2231 self.tr("Debug Project") |
|
2232 if debugProject else |
|
2233 self.tr("Debug Script") |
|
2234 ) |
|
2235 if debugProject: |
2518 if debugProject: |
2236 scriptName = self.project.getMainScript(True) |
2519 scriptName = self.project.getMainScript(True) |
2237 elif script: |
2520 elif script: |
2238 scriptName = script |
2521 scriptName = script |
2239 elif self.lastDebuggedFile: |
2522 elif self.lastDebuggedFile: |
2240 scriptName = self.lastDebuggedFile |
2523 scriptName = self.lastDebuggedFile |
2241 else: |
2524 else: |
2242 scriptName = "" |
2525 scriptName = "" |
2243 dlg = StartDialog( |
2526 dlg = StartDialog( |
2244 cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory, |
2527 cap, |
2245 self.envHistory, self.exceptions, self.ui, 0, |
2528 self.lastUsedVenvName, |
2246 tracePython=self.tracePython, autoClearShell=self.autoClearShell, |
2529 self.argvHistory, |
|
2530 self.wdHistory, |
|
2531 self.envHistory, |
|
2532 self.exceptions, |
|
2533 self.ui, |
|
2534 0, |
|
2535 tracePython=self.tracePython, |
|
2536 autoClearShell=self.autoClearShell, |
2247 autoContinue=self.autoContinue, |
2537 autoContinue=self.autoContinue, |
2248 enableMultiprocess=self.enableMultiprocess, |
2538 enableMultiprocess=self.enableMultiprocess, |
2249 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory, |
2539 multiprocessNoDebugHistory=self.multiprocessNoDebugHistory, |
2250 configOverride=self.overrideGlobalConfig, |
2540 configOverride=self.overrideGlobalConfig, |
2251 forProject=debugProject, scriptName=scriptName, |
2541 forProject=debugProject, |
2252 scriptsList=self.scriptsHistory) |
2542 scriptName=scriptName, |
|
2543 scriptsList=self.scriptsHistory, |
|
2544 ) |
2253 if dlg.exec() == QDialog.DialogCode.Accepted: |
2545 if dlg.exec() == QDialog.DialogCode.Accepted: |
2254 (lastUsedVenvName, scriptName, argv, wd, env, exceptions, |
2546 ( |
2255 clearShell, console) = dlg.getData() |
2547 lastUsedVenvName, |
|
2548 scriptName, |
|
2549 argv, |
|
2550 wd, |
|
2551 env, |
|
2552 exceptions, |
|
2553 clearShell, |
|
2554 console, |
|
2555 ) = dlg.getData() |
2256 configOverride = dlg.getGlobalOverrideData() |
2556 configOverride = dlg.getGlobalOverrideData() |
2257 (tracePython, autoContinue, enableMultiprocess, |
2557 ( |
2258 multiprocessNoDebug) = dlg.getDebugData() |
2558 tracePython, |
2259 |
2559 autoContinue, |
|
2560 enableMultiprocess, |
|
2561 multiprocessNoDebug, |
|
2562 ) = dlg.getDebugData() |
|
2563 |
2260 if debugProject: |
2564 if debugProject: |
2261 fn = self.project.getMainScript(True) |
2565 fn = self.project.getMainScript(True) |
2262 if fn is None: |
2566 if fn is None: |
2263 EricMessageBox.critical( |
2567 EricMessageBox.critical( |
2264 self.ui, |
2568 self.ui, |
2265 self.tr("Debug Project"), |
2569 self.tr("Debug Project"), |
2266 self.tr( |
2570 self.tr( |
2267 "There is no main script defined for the" |
2571 "There is no main script defined for the" |
2268 " current project. No debugging possible.")) |
2572 " current project. No debugging possible." |
|
2573 ), |
|
2574 ) |
2269 return |
2575 return |
2270 |
2576 |
2271 if ( |
2577 if Preferences.getDebugger( |
2272 Preferences.getDebugger("Autosave") and |
2578 "Autosave" |
2273 not self.project.saveAllScripts(reportSyntaxErrors=True) |
2579 ) and not self.project.saveAllScripts(reportSyntaxErrors=True): |
2274 ): |
|
2275 doNotStart = True |
2580 doNotStart = True |
2276 |
2581 |
2277 # save the info for later use |
2582 # save the info for later use |
2278 self.project.setDbgInfo( |
2583 self.project.setDbgInfo( |
2279 lastUsedVenvName, argv, wd, env, exceptions, self.excList, |
2584 lastUsedVenvName, |
2280 self.excIgnoreList, clearShell, tracePython=tracePython, |
2585 argv, |
|
2586 wd, |
|
2587 env, |
|
2588 exceptions, |
|
2589 self.excList, |
|
2590 self.excIgnoreList, |
|
2591 clearShell, |
|
2592 tracePython=tracePython, |
2281 autoContinue=autoContinue, |
2593 autoContinue=autoContinue, |
2282 enableMultiprocess=enableMultiprocess, |
2594 enableMultiprocess=enableMultiprocess, |
2283 multiprocessNoDebug=multiprocessNoDebug, |
2595 multiprocessNoDebug=multiprocessNoDebug, |
2284 configOverride=configOverride |
2596 configOverride=configOverride, |
2285 ) |
2597 ) |
2286 |
2598 |
2287 self.lastStartAction = 2 |
2599 self.lastStartAction = 2 |
2288 self.clientType = self.project.getProjectLanguage() |
2600 self.clientType = self.project.getProjectLanguage() |
2289 else: |
2601 else: |
2290 if scriptName: |
2602 if scriptName: |
2291 fn = scriptName |
2603 fn = scriptName |
2293 else: |
2605 else: |
2294 # debug current editor |
2606 # debug current editor |
2295 editor = self.viewmanager.activeWindow() |
2607 editor = self.viewmanager.activeWindow() |
2296 if editor is None: |
2608 if editor is None: |
2297 return |
2609 return |
2298 |
2610 |
2299 if ( |
2611 if ( |
2300 not self.viewmanager.checkDirty( |
2612 not self.viewmanager.checkDirty( |
2301 editor, Preferences.getDebugger("Autosave")) or |
2613 editor, Preferences.getDebugger("Autosave") |
2302 editor.getFileName() is None |
2614 ) |
|
2615 or editor.getFileName() is None |
2303 ): |
2616 ): |
2304 return |
2617 return |
2305 |
2618 |
2306 fn = editor.getFileName() |
2619 fn = editor.getFileName() |
2307 self.clientType = editor.determineFileType() |
2620 self.clientType = editor.determineFileType() |
2308 self.lastStartAction = 1 |
2621 self.lastStartAction = 1 |
2309 |
2622 |
2310 # save the filename for use by the restart method |
2623 # save the filename for use by the restart method |
2311 self.lastDebuggedFile = fn |
2624 self.lastDebuggedFile = fn |
2312 self.restartAct.setEnabled(True) |
2625 self.restartAct.setEnabled(True) |
2313 |
2626 |
2314 # save the most recently used virtual environment |
2627 # save the most recently used virtual environment |
2315 self.lastUsedVenvName = lastUsedVenvName |
2628 self.lastUsedVenvName = lastUsedVenvName |
2316 |
2629 |
2317 # This moves any previous occurrence of these arguments to the head |
2630 # This moves any previous occurrence of these arguments to the head |
2318 # of the list. |
2631 # of the list. |
2319 self.setScriptsHistory(scriptName) |
2632 self.setScriptsHistory(scriptName) |
2320 self.setArgvHistory(argv) |
2633 self.setArgvHistory(argv) |
2321 self.setWdHistory(wd) |
2634 self.setWdHistory(wd) |
2322 self.setEnvHistory(env) |
2635 self.setEnvHistory(env) |
2323 |
2636 |
2324 # Save the exception flags |
2637 # Save the exception flags |
2325 self.exceptions = exceptions |
2638 self.exceptions = exceptions |
2326 |
2639 |
2327 # Save the tracePython flag |
2640 # Save the tracePython flag |
2328 self.tracePython = tracePython |
2641 self.tracePython = tracePython |
2329 |
2642 |
2330 # Save the clear interpreter flag |
2643 # Save the clear interpreter flag |
2331 self.autoClearShell = clearShell |
2644 self.autoClearShell = clearShell |
2332 |
2645 |
2333 # Save the run in console flag |
2646 # Save the run in console flag |
2334 self.runInConsole = console |
2647 self.runInConsole = console |
2335 |
2648 |
2336 # Save the auto continue flag |
2649 # Save the auto continue flag |
2337 self.autoContinue = autoContinue |
2650 self.autoContinue = autoContinue |
2338 |
2651 |
2339 # Save the multiprocess debugging data |
2652 # Save the multiprocess debugging data |
2340 self.enableMultiprocess = enableMultiprocess |
2653 self.enableMultiprocess = enableMultiprocess |
2341 self.setMultiprocessNoDebugHistory(multiprocessNoDebug) |
2654 self.setMultiprocessNoDebugHistory(multiprocessNoDebug) |
2342 |
2655 |
2343 # Save the global config override data |
2656 # Save the global config override data |
2344 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
2657 self.overrideGlobalConfig = copy.deepcopy(configOverride) |
2345 |
2658 |
2346 # Hide all error highlights |
2659 # Hide all error highlights |
2347 self.viewmanager.unhighlight() |
2660 self.viewmanager.unhighlight() |
2348 |
2661 |
2349 if not doNotStart: |
2662 if not doNotStart: |
2350 if debugProject and self.project.getProjectType() in [ |
2663 if debugProject and self.project.getProjectType() in ["E7Plugin"]: |
2351 "E7Plugin"]: |
|
2352 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2664 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2353 fn = os.path.join(getConfig('ericDir'), "eric7.py") |
2665 fn = os.path.join(getConfig("ericDir"), "eric7.py") |
2354 tracePython = True # override flag because it must be true |
2666 tracePython = True # override flag because it must be true |
2355 |
2667 |
2356 self.debugViewer.initCallStackViewer(debugProject) |
2668 self.debugViewer.initCallStackViewer(debugProject) |
2357 |
2669 |
2358 # Ask the client to send call trace info |
2670 # Ask the client to send call trace info |
2359 enableCallTrace = self.debugViewer.isCallTraceEnabled() |
2671 enableCallTrace = self.debugViewer.isCallTraceEnabled() |
2360 self.debugViewer.clearCallTrace() |
2672 self.debugViewer.clearCallTrace() |
2361 self.debugViewer.setCallTraceToProjectMode(debugProject) |
2673 self.debugViewer.setCallTraceToProjectMode(debugProject) |
2362 |
2674 |
2363 # Ask the client to open the new program. |
2675 # Ask the client to open the new program. |
2364 self.debugServer.remoteLoad( |
2676 self.debugServer.remoteLoad( |
2365 lastUsedVenvName, fn, argv, wd, env, |
2677 lastUsedVenvName, |
|
2678 fn, |
|
2679 argv, |
|
2680 wd, |
|
2681 env, |
2366 autoClearShell=self.autoClearShell, |
2682 autoClearShell=self.autoClearShell, |
2367 tracePython=tracePython, |
2683 tracePython=tracePython, |
2368 autoContinue=autoContinue, forProject=debugProject, |
2684 autoContinue=autoContinue, |
2369 runInConsole=console, clientType=self.clientType, |
2685 forProject=debugProject, |
|
2686 runInConsole=console, |
|
2687 clientType=self.clientType, |
2370 enableCallTrace=enableCallTrace, |
2688 enableCallTrace=enableCallTrace, |
2371 enableMultiprocess=enableMultiprocess, |
2689 enableMultiprocess=enableMultiprocess, |
2372 multiprocessNoDebug=multiprocessNoDebug, |
2690 multiprocessNoDebug=multiprocessNoDebug, |
2373 configOverride=self.overrideGlobalConfig) |
2691 configOverride=self.overrideGlobalConfig, |
2374 |
2692 ) |
|
2693 |
2375 if ( |
2694 if ( |
2376 self.debugServer.isClientProcessUp() and |
2695 self.debugServer.isClientProcessUp() |
2377 self.debugServer.getClientType() == self.clientType |
2696 and self.debugServer.getClientType() == self.clientType |
2378 ): |
2697 ): |
2379 # Signal that we have started a debugging session |
2698 # Signal that we have started a debugging session |
2380 self.debuggingStarted.emit(fn) |
2699 self.debuggingStarted.emit(fn) |
2381 |
2700 |
2382 self.stopAct.setEnabled(True) |
2701 self.stopAct.setEnabled(True) |
2383 |
2702 |
2384 if dlg.clearHistories(): |
2703 if dlg.clearHistories(): |
2385 self.setScriptsHistory("", clearHistories=True) |
2704 self.setScriptsHistory("", clearHistories=True) |
2386 self.setArgvHistory("", clearHistories=True) |
2705 self.setArgvHistory("", clearHistories=True) |
2387 self.setWdHistory("", clearHistories=True) |
2706 self.setWdHistory("", clearHistories=True) |
2388 self.setEnvHistory("", clearHistories=True) |
2707 self.setEnvHistory("", clearHistories=True) |
2389 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
2708 self.setMultiprocessNoDebugHistory("", clearHistories=True) |
2390 elif dlg.historiesModified(): |
2709 elif dlg.historiesModified(): |
2391 (scriptsHistory, argvHistory, wdHistory, envHistory, |
2710 ( |
2392 noDebugHistory) = dlg.getHistories() |
2711 scriptsHistory, |
|
2712 argvHistory, |
|
2713 wdHistory, |
|
2714 envHistory, |
|
2715 noDebugHistory, |
|
2716 ) = dlg.getHistories() |
2393 self.setScriptsHistory("", history=scriptsHistory) |
2717 self.setScriptsHistory("", history=scriptsHistory) |
2394 self.setArgvHistory("", history=argvHistory) |
2718 self.setArgvHistory("", history=argvHistory) |
2395 self.setWdHistory("", history=wdHistory) |
2719 self.setWdHistory("", history=wdHistory) |
2396 self.setEnvHistory("", history=envHistory) |
2720 self.setEnvHistory("", history=envHistory) |
2397 self.setMultiprocessNoDebugHistory("", history=noDebugHistory) |
2721 self.setMultiprocessNoDebugHistory("", history=noDebugHistory) |
2398 |
2722 |
2399 def __doRestart(self): |
2723 def __doRestart(self): |
2400 """ |
2724 """ |
2401 Private slot to handle the restart action to restart the last |
2725 Private slot to handle the restart action to restart the last |
2402 debugged file. |
2726 debugged file. |
2403 """ |
2727 """ |
2404 self.__resetUI() |
2728 self.__resetUI() |
2405 doNotStart = False |
2729 doNotStart = False |
2406 |
2730 |
2407 # first save any changes |
2731 # first save any changes |
2408 if self.lastStartAction in [1, 3, 5, 7, 9]: |
2732 if self.lastStartAction in [1, 3, 5, 7, 9]: |
2409 editor = self.viewmanager.getOpenEditor(self.lastDebuggedFile) |
2733 editor = self.viewmanager.getOpenEditor(self.lastDebuggedFile) |
2410 if ( |
2734 if editor and not self.viewmanager.checkDirty( |
2411 editor and |
2735 editor, Preferences.getDebugger("Autosave") |
2412 not self.viewmanager.checkDirty( |
|
2413 editor, Preferences.getDebugger("Autosave")) |
|
2414 ): |
2736 ): |
2415 return |
2737 return |
2416 forProject = False |
2738 forProject = False |
2417 elif self.lastStartAction in [2, 4, 6, 8, 10]: |
2739 elif self.lastStartAction in [2, 4, 6, 8, 10]: |
2418 if ( |
2740 if Preferences.getDebugger("Autosave") and not self.project.saveAllScripts( |
2419 Preferences.getDebugger("Autosave") and |
2741 reportSyntaxErrors=True |
2420 not self.project.saveAllScripts(reportSyntaxErrors=True) |
|
2421 ): |
2742 ): |
2422 doNotStart = True |
2743 doNotStart = True |
2423 self.__compileChangedProjectFiles() |
2744 self.__compileChangedProjectFiles() |
2424 forProject = True |
2745 forProject = True |
2425 else: |
2746 else: |
2426 return # should not happen |
2747 return # should not happen |
2427 |
2748 |
2428 # get the saved stuff |
2749 # get the saved stuff |
2429 venvName = self.lastUsedVenvName |
2750 venvName = self.lastUsedVenvName |
2430 wd = self.wdHistory[0] |
2751 wd = self.wdHistory[0] |
2431 argv = self.argvHistory[0] |
2752 argv = self.argvHistory[0] |
2432 fn = self.lastDebuggedFile |
2753 fn = self.lastDebuggedFile |
2433 env = self.envHistory[0] |
2754 env = self.envHistory[0] |
2434 |
2755 |
2435 # Hide all error highlights |
2756 # Hide all error highlights |
2436 self.viewmanager.unhighlight() |
2757 self.viewmanager.unhighlight() |
2437 |
2758 |
2438 if not doNotStart: |
2759 if not doNotStart: |
2439 if forProject and self.project.getProjectType() in [ |
2760 if forProject and self.project.getProjectType() in ["E7Plugin"]: |
2440 "E7Plugin"]: |
|
2441 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2761 argv = '--plugin="{0}" {1}'.format(fn, argv) |
2442 fn = os.path.join(getConfig('ericDir'), "eric7.py") |
2762 fn = os.path.join(getConfig("ericDir"), "eric7.py") |
2443 |
2763 |
2444 self.debugViewer.initCallStackViewer(forProject) |
2764 self.debugViewer.initCallStackViewer(forProject) |
2445 |
2765 |
2446 if self.lastStartAction in [1, 2]: |
2766 if self.lastStartAction in [1, 2]: |
2447 # Ask the client to send call trace info |
2767 # Ask the client to send call trace info |
2448 enableCallTrace = self.debugViewer.isCallTraceEnabled() |
2768 enableCallTrace = self.debugViewer.isCallTraceEnabled() |
2449 self.debugViewer.clearCallTrace() |
2769 self.debugViewer.clearCallTrace() |
2450 self.debugViewer.setCallTraceToProjectMode(forProject) |
2770 self.debugViewer.setCallTraceToProjectMode(forProject) |
2451 multiprocessNoDebug = self.multiprocessNoDebugHistory[0] |
2771 multiprocessNoDebug = self.multiprocessNoDebugHistory[0] |
2452 |
2772 |
2453 # Ask the client to debug the new program. |
2773 # Ask the client to debug the new program. |
2454 self.debugServer.remoteLoad( |
2774 self.debugServer.remoteLoad( |
2455 venvName, fn, argv, wd, env, |
2775 venvName, |
|
2776 fn, |
|
2777 argv, |
|
2778 wd, |
|
2779 env, |
2456 autoClearShell=self.autoClearShell, |
2780 autoClearShell=self.autoClearShell, |
2457 tracePython=self.tracePython, |
2781 tracePython=self.tracePython, |
2458 autoContinue=self.autoContinue, |
2782 autoContinue=self.autoContinue, |
2459 forProject=forProject, |
2783 forProject=forProject, |
2460 runInConsole=self.runInConsole, |
2784 runInConsole=self.runInConsole, |
2461 clientType=self.clientType, |
2785 clientType=self.clientType, |
2462 enableCallTrace=enableCallTrace, |
2786 enableCallTrace=enableCallTrace, |
2463 enableMultiprocess=self.enableMultiprocess, |
2787 enableMultiprocess=self.enableMultiprocess, |
2464 multiprocessNoDebug=multiprocessNoDebug, |
2788 multiprocessNoDebug=multiprocessNoDebug, |
2465 configOverride=self.overrideGlobalConfig) |
2789 configOverride=self.overrideGlobalConfig, |
2466 |
2790 ) |
|
2791 |
2467 # Signal that we have started a debugging session |
2792 # Signal that we have started a debugging session |
2468 self.debuggingStarted.emit(fn) |
2793 self.debuggingStarted.emit(fn) |
2469 |
2794 |
2470 elif self.lastStartAction in [3, 4]: |
2795 elif self.lastStartAction in [3, 4]: |
2471 # Ask the client to run the new program. |
2796 # Ask the client to run the new program. |
2472 self.debugServer.remoteRun( |
2797 self.debugServer.remoteRun( |
2473 venvName, fn, argv, wd, env, |
2798 venvName, |
|
2799 fn, |
|
2800 argv, |
|
2801 wd, |
|
2802 env, |
2474 autoClearShell=self.autoClearShell, |
2803 autoClearShell=self.autoClearShell, |
2475 forProject=forProject, |
2804 forProject=forProject, |
2476 runInConsole=self.runInConsole, |
2805 runInConsole=self.runInConsole, |
2477 clientType=self.clientType, |
2806 clientType=self.clientType, |
2478 configOverride=self.overrideGlobalConfig) |
2807 configOverride=self.overrideGlobalConfig, |
2479 |
2808 ) |
|
2809 |
2480 elif self.lastStartAction in [5, 6]: |
2810 elif self.lastStartAction in [5, 6]: |
2481 # Ask the client to coverage run the new program. |
2811 # Ask the client to coverage run the new program. |
2482 self.debugServer.remoteCoverage( |
2812 self.debugServer.remoteCoverage( |
2483 venvName, fn, argv, wd, env, |
2813 venvName, |
|
2814 fn, |
|
2815 argv, |
|
2816 wd, |
|
2817 env, |
2484 autoClearShell=self.autoClearShell, |
2818 autoClearShell=self.autoClearShell, |
2485 erase=self.eraseCoverage, |
2819 erase=self.eraseCoverage, |
2486 forProject=forProject, |
2820 forProject=forProject, |
2487 runInConsole=self.runInConsole, |
2821 runInConsole=self.runInConsole, |
2488 clientType=self.clientType, |
2822 clientType=self.clientType, |
2489 configOverride=self.overrideGlobalConfig) |
2823 configOverride=self.overrideGlobalConfig, |
2490 |
2824 ) |
|
2825 |
2491 elif self.lastStartAction in [7, 8]: |
2826 elif self.lastStartAction in [7, 8]: |
2492 # Ask the client to profile run the new program. |
2827 # Ask the client to profile run the new program. |
2493 self.debugServer.remoteProfile( |
2828 self.debugServer.remoteProfile( |
2494 venvName, fn, argv, wd, env, |
2829 venvName, |
|
2830 fn, |
|
2831 argv, |
|
2832 wd, |
|
2833 env, |
2495 autoClearShell=self.autoClearShell, |
2834 autoClearShell=self.autoClearShell, |
2496 erase=self.eraseTimings, |
2835 erase=self.eraseTimings, |
2497 forProject=forProject, |
2836 forProject=forProject, |
2498 runInConsole=self.runInConsole, |
2837 runInConsole=self.runInConsole, |
2499 clientType=self.clientType, |
2838 clientType=self.clientType, |
2500 configOverride=self.overrideGlobalConfig) |
2839 configOverride=self.overrideGlobalConfig, |
2501 |
2840 ) |
|
2841 |
2502 self.stopAct.setEnabled(True) |
2842 self.stopAct.setEnabled(True) |
2503 |
2843 |
2504 def __stopScript(self): |
2844 def __stopScript(self): |
2505 """ |
2845 """ |
2506 Private slot to stop the running script. |
2846 Private slot to stop the running script. |
2507 """ |
2847 """ |
2508 self.debugServer.startClient(False) |
2848 self.debugServer.startClient(False) |
2509 |
2849 |
2510 def __passiveDebugStarted(self, fn, exc): |
2850 def __passiveDebugStarted(self, fn, exc): |
2511 """ |
2851 """ |
2512 Private slot to handle a passive debug session start. |
2852 Private slot to handle a passive debug session start. |
2513 |
2853 |
2514 @param fn filename of the debugged script |
2854 @param fn filename of the debugged script |
2515 @param exc flag to enable exception reporting of the IDE (boolean) |
2855 @param exc flag to enable exception reporting of the IDE (boolean) |
2516 """ |
2856 """ |
2517 # Hide all error highlights |
2857 # Hide all error highlights |
2518 self.viewmanager.unhighlight() |
2858 self.viewmanager.unhighlight() |
2519 |
2859 |
2520 # Set filename of script being debugged |
2860 # Set filename of script being debugged |
2521 self.ui.currentProg = fn |
2861 self.ui.currentProg = fn |
2522 |
2862 |
2523 # Set exception reporting |
2863 # Set exception reporting |
2524 self.setExceptionReporting(exc) |
2864 self.setExceptionReporting(exc) |
2525 |
2865 |
2526 # Signal that we have started a debugging session |
2866 # Signal that we have started a debugging session |
2527 self.debuggingStarted.emit(fn) |
2867 self.debuggingStarted.emit(fn) |
2528 |
2868 |
2529 # Initialize the call stack viewer |
2869 # Initialize the call stack viewer |
2530 self.debugViewer.initCallStackViewer(False) |
2870 self.debugViewer.initCallStackViewer(False) |
2531 |
2871 |
2532 def __continue(self, debuggerId=""): |
2872 def __continue(self, debuggerId=""): |
2533 """ |
2873 """ |
2534 Private method to handle the Continue action. |
2874 Private method to handle the Continue action. |
2535 |
2875 |
2536 @param debuggerId ID of the debugger backend |
2876 @param debuggerId ID of the debugger backend |
2537 @type str |
2877 @type str |
2538 """ |
2878 """ |
2539 if not debuggerId: |
2879 if not debuggerId: |
2540 debuggerId = self.getSelectedDebuggerId() |
2880 debuggerId = self.getSelectedDebuggerId() |
2541 |
2881 |
2542 self.lastAction = 0 |
2882 self.lastAction = 0 |
2543 self.__enterRemote() |
2883 self.__enterRemote() |
2544 self.debugServer.remoteContinue(debuggerId) |
2884 self.debugServer.remoteContinue(debuggerId) |
2545 |
2885 |
2546 def __specialContinue(self, debuggerId=""): |
2886 def __specialContinue(self, debuggerId=""): |
2547 """ |
2887 """ |
2548 Private method to handle the Special Continue action. |
2888 Private method to handle the Special Continue action. |
2549 |
2889 |
2550 @param debuggerId ID of the debugger backend |
2890 @param debuggerId ID of the debugger backend |
2551 @type str |
2891 @type str |
2552 """ |
2892 """ |
2553 if not debuggerId: |
2893 if not debuggerId: |
2554 debuggerId = self.getSelectedDebuggerId() |
2894 debuggerId = self.getSelectedDebuggerId() |
2555 |
2895 |
2556 self.lastAction = 2 |
2896 self.lastAction = 2 |
2557 self.__enterRemote() |
2897 self.__enterRemote() |
2558 self.debugServer.remoteContinue(debuggerId, 1) |
2898 self.debugServer.remoteContinue(debuggerId, 1) |
2559 |
2899 |
2560 def __step(self, debuggerId=""): |
2900 def __step(self, debuggerId=""): |
2561 """ |
2901 """ |
2562 Private method to handle the Step action. |
2902 Private method to handle the Step action. |
2563 |
2903 |
2564 @param debuggerId ID of the debugger backend |
2904 @param debuggerId ID of the debugger backend |
2565 @type str |
2905 @type str |
2566 """ |
2906 """ |
2567 if not debuggerId: |
2907 if not debuggerId: |
2568 debuggerId = self.getSelectedDebuggerId() |
2908 debuggerId = self.getSelectedDebuggerId() |
2569 |
2909 |
2570 self.lastAction = 1 |
2910 self.lastAction = 1 |
2571 self.__enterRemote() |
2911 self.__enterRemote() |
2572 self.debugServer.remoteStep(debuggerId) |
2912 self.debugServer.remoteStep(debuggerId) |
2573 |
2913 |
2574 def __stepOver(self, debuggerId=""): |
2914 def __stepOver(self, debuggerId=""): |
2575 """ |
2915 """ |
2576 Private method to handle the Step Over action. |
2916 Private method to handle the Step Over action. |
2577 |
2917 |
2578 @param debuggerId ID of the debugger backend |
2918 @param debuggerId ID of the debugger backend |
2579 @type str |
2919 @type str |
2580 """ |
2920 """ |
2581 if not debuggerId: |
2921 if not debuggerId: |
2582 debuggerId = self.getSelectedDebuggerId() |
2922 debuggerId = self.getSelectedDebuggerId() |
2583 |
2923 |
2584 self.lastAction = 2 |
2924 self.lastAction = 2 |
2585 self.__enterRemote() |
2925 self.__enterRemote() |
2586 self.debugServer.remoteStepOver(debuggerId) |
2926 self.debugServer.remoteStepOver(debuggerId) |
2587 |
2927 |
2588 def __stepOut(self, debuggerId=""): |
2928 def __stepOut(self, debuggerId=""): |
2589 """ |
2929 """ |
2590 Private method to handle the Step Out action. |
2930 Private method to handle the Step Out action. |
2591 |
2931 |
2592 @param debuggerId ID of the debugger backend |
2932 @param debuggerId ID of the debugger backend |
2593 @type str |
2933 @type str |
2594 """ |
2934 """ |
2595 if not debuggerId: |
2935 if not debuggerId: |
2596 debuggerId = self.getSelectedDebuggerId() |
2936 debuggerId = self.getSelectedDebuggerId() |
2597 |
2937 |
2598 self.lastAction = 3 |
2938 self.lastAction = 3 |
2599 self.__enterRemote() |
2939 self.__enterRemote() |
2600 self.debugServer.remoteStepOut(debuggerId) |
2940 self.debugServer.remoteStepOut(debuggerId) |
2601 |
2941 |
2602 def __stepQuit(self, debuggerId=""): |
2942 def __stepQuit(self, debuggerId=""): |
2603 """ |
2943 """ |
2604 Private method to handle the Step Quit action. |
2944 Private method to handle the Step Quit action. |
2605 |
2945 |
2606 @param debuggerId ID of the debugger backend |
2946 @param debuggerId ID of the debugger backend |
2607 @type str |
2947 @type str |
2608 """ |
2948 """ |
2609 if not debuggerId: |
2949 if not debuggerId: |
2610 debuggerId = self.getSelectedDebuggerId() |
2950 debuggerId = self.getSelectedDebuggerId() |
2611 |
2951 |
2612 self.lastAction = 4 |
2952 self.lastAction = 4 |
2613 self.__enterRemote() |
2953 self.__enterRemote() |
2614 self.debugServer.remoteStepQuit(debuggerId) |
2954 self.debugServer.remoteStepQuit(debuggerId) |
2615 self.__resetUI() |
2955 self.__resetUI() |
2616 |
2956 |
2617 def __runToCursor(self, debuggerId=""): |
2957 def __runToCursor(self, debuggerId=""): |
2618 """ |
2958 """ |
2619 Private method to handle the Run to Cursor action. |
2959 Private method to handle the Run to Cursor action. |
2620 |
2960 |
2621 @param debuggerId ID of the debugger backend |
2961 @param debuggerId ID of the debugger backend |
2622 @type str |
2962 @type str |
2623 """ |
2963 """ |
2624 if not debuggerId: |
2964 if not debuggerId: |
2625 debuggerId = self.getSelectedDebuggerId() |
2965 debuggerId = self.getSelectedDebuggerId() |
2626 |
2966 |
2627 self.lastAction = 0 |
2967 self.lastAction = 0 |
2628 aw = self.viewmanager.activeWindow() |
2968 aw = self.viewmanager.activeWindow() |
2629 line = aw.getCursorPosition()[0] + 1 |
2969 line = aw.getCursorPosition()[0] + 1 |
2630 self.__enterRemote() |
2970 self.__enterRemote() |
2631 self.debugServer.remoteBreakpoint( |
2971 self.debugServer.remoteBreakpoint( |
2632 self.getSelectedDebuggerId(), |
2972 self.getSelectedDebuggerId(), aw.getFileName(), line, 1, None, 1 |
2633 aw.getFileName(), line, 1, None, 1) |
2973 ) |
2634 self.debugServer.remoteContinue(debuggerId) |
2974 self.debugServer.remoteContinue(debuggerId) |
2635 |
2975 |
2636 def __runUntil(self, debuggerId=""): |
2976 def __runUntil(self, debuggerId=""): |
2637 """ |
2977 """ |
2638 Private method to handle the Run Until action. |
2978 Private method to handle the Run Until action. |
2639 |
2979 |
2640 @param debuggerId ID of the debugger backend |
2980 @param debuggerId ID of the debugger backend |
2641 @type str |
2981 @type str |
2642 """ |
2982 """ |
2643 if not debuggerId: |
2983 if not debuggerId: |
2644 debuggerId = self.getSelectedDebuggerId() |
2984 debuggerId = self.getSelectedDebuggerId() |
2645 |
2985 |
2646 self.lastAction = 0 |
2986 self.lastAction = 0 |
2647 aw = self.viewmanager.activeWindow() |
2987 aw = self.viewmanager.activeWindow() |
2648 line = aw.getCursorPosition()[0] + 1 |
2988 line = aw.getCursorPosition()[0] + 1 |
2649 self.__enterRemote() |
2989 self.__enterRemote() |
2650 self.debugServer.remoteContinueUntil(debuggerId, line) |
2990 self.debugServer.remoteContinueUntil(debuggerId, line) |
2651 |
2991 |
2652 def __moveInstructionPointer(self, debuggerId=""): |
2992 def __moveInstructionPointer(self, debuggerId=""): |
2653 """ |
2993 """ |
2654 Private method to move the instruction pointer to a different line. |
2994 Private method to move the instruction pointer to a different line. |
2655 |
2995 |
2656 @param debuggerId ID of the debugger backend |
2996 @param debuggerId ID of the debugger backend |
2657 @type str |
2997 @type str |
2658 """ |
2998 """ |
2659 if not debuggerId: |
2999 if not debuggerId: |
2660 debuggerId = self.getSelectedDebuggerId() |
3000 debuggerId = self.getSelectedDebuggerId() |
2661 |
3001 |
2662 self.lastAction = 0 |
3002 self.lastAction = 0 |
2663 aw = self.viewmanager.activeWindow() |
3003 aw = self.viewmanager.activeWindow() |
2664 line = aw.getCursorPosition()[0] + 1 |
3004 line = aw.getCursorPosition()[0] + 1 |
2665 self.debugServer.remoteMoveIP(debuggerId, line) |
3005 self.debugServer.remoteMoveIP(debuggerId, line) |
2666 |
3006 |