194 from .CallStackViewer import CallStackViewer |
194 from .CallStackViewer import CallStackViewer |
195 # add the call stack viewer |
195 # add the call stack viewer |
196 self.callStackViewer = CallStackViewer(self.debugServer) |
196 self.callStackViewer = CallStackViewer(self.debugServer) |
197 index = self.__tabWidget.addTab( |
197 index = self.__tabWidget.addTab( |
198 self.callStackViewer, |
198 self.callStackViewer, |
199 UI.PixmapCache.getIcon("step.png"), "") |
199 UI.PixmapCache.getIcon("step"), "") |
200 self.__tabWidget.setTabToolTip( |
200 self.__tabWidget.setTabToolTip( |
201 index, self.callStackViewer.windowTitle()) |
201 index, self.callStackViewer.windowTitle()) |
202 self.callStackViewer.sourceFile.connect(self.sourceFile) |
202 self.callStackViewer.sourceFile.connect(self.sourceFile) |
203 self.callStackViewer.frameSelected.connect( |
203 self.callStackViewer.frameSelected.connect( |
204 self.__callStackFrameSelected) |
204 self.__callStackFrameSelected) |
205 |
205 |
206 from .CallTraceViewer import CallTraceViewer |
206 from .CallTraceViewer import CallTraceViewer |
207 # add the call trace viewer |
207 # add the call trace viewer |
208 self.callTraceViewer = CallTraceViewer(self.debugServer) |
208 self.callTraceViewer = CallTraceViewer(self.debugServer, self) |
209 index = self.__tabWidget.addTab( |
209 index = self.__tabWidget.addTab( |
210 self.callTraceViewer, |
210 self.callTraceViewer, |
211 UI.PixmapCache.getIcon("callTrace.png"), "") |
211 UI.PixmapCache.getIcon("callTrace"), "") |
212 self.__tabWidget.setTabToolTip( |
212 self.__tabWidget.setTabToolTip( |
213 index, self.callTraceViewer.windowTitle()) |
213 index, self.callTraceViewer.windowTitle()) |
214 self.callTraceViewer.sourceFile.connect(self.sourceFile) |
214 self.callTraceViewer.sourceFile.connect(self.sourceFile) |
215 |
215 |
216 from .BreakPointViewer import BreakPointViewer |
216 from .BreakPointViewer import BreakPointViewer |
217 # add the breakpoint viewer |
217 # add the breakpoint viewer |
218 self.breakpointViewer = BreakPointViewer() |
218 self.breakpointViewer = BreakPointViewer() |
219 self.breakpointViewer.setModel(self.debugServer.getBreakPointModel()) |
219 self.breakpointViewer.setModel(self.debugServer.getBreakPointModel()) |
220 index = self.__tabWidget.addTab( |
220 index = self.__tabWidget.addTab( |
221 self.breakpointViewer, |
221 self.breakpointViewer, |
222 UI.PixmapCache.getIcon("breakpoints.png"), '') |
222 UI.PixmapCache.getIcon("breakpoints"), '') |
223 self.__tabWidget.setTabToolTip( |
223 self.__tabWidget.setTabToolTip( |
224 index, self.breakpointViewer.windowTitle()) |
224 index, self.breakpointViewer.windowTitle()) |
225 self.breakpointViewer.sourceFile.connect(self.sourceFile) |
225 self.breakpointViewer.sourceFile.connect(self.sourceFile) |
226 |
226 |
227 from .WatchPointViewer import WatchPointViewer |
227 from .WatchPointViewer import WatchPointViewer |
228 # add the watch expression viewer |
228 # add the watch expression viewer |
229 self.watchpointViewer = WatchPointViewer() |
229 self.watchpointViewer = WatchPointViewer() |
230 self.watchpointViewer.setModel(self.debugServer.getWatchPointModel()) |
230 self.watchpointViewer.setModel(self.debugServer.getWatchPointModel()) |
231 index = self.__tabWidget.addTab( |
231 index = self.__tabWidget.addTab( |
232 self.watchpointViewer, |
232 self.watchpointViewer, |
233 UI.PixmapCache.getIcon("watchpoints.png"), '') |
233 UI.PixmapCache.getIcon("watchpoints"), '') |
234 self.__tabWidget.setTabToolTip( |
234 self.__tabWidget.setTabToolTip( |
235 index, self.watchpointViewer.windowTitle()) |
235 index, self.watchpointViewer.windowTitle()) |
236 |
236 |
237 from .ExceptionLogger import ExceptionLogger |
237 from .ExceptionLogger import ExceptionLogger |
238 # add the exception logger |
238 # add the exception logger |
239 self.exceptionLogger = ExceptionLogger() |
239 self.exceptionLogger = ExceptionLogger() |
240 index = self.__tabWidget.addTab( |
240 index = self.__tabWidget.addTab( |
241 self.exceptionLogger, |
241 self.exceptionLogger, |
242 UI.PixmapCache.getIcon("exceptions.png"), '') |
242 UI.PixmapCache.getIcon("exceptions"), '') |
243 self.__tabWidget.setTabToolTip( |
243 self.__tabWidget.setTabToolTip( |
244 index, self.exceptionLogger.windowTitle()) |
244 index, self.exceptionLogger.windowTitle()) |
245 |
245 |
246 self.__tabWidget.setCurrentWidget(self.glvWidget) |
246 self.__tabWidget.setCurrentWidget(self.glvWidget) |
247 |
247 |
430 """ |
434 """ |
431 if debuggerId: |
435 if debuggerId: |
432 index = self.__debuggersCombo.findText(debuggerId, Qt.MatchExactly) |
436 index = self.__debuggersCombo.findText(debuggerId, Qt.MatchExactly) |
433 if index >= 0: |
437 if index >= 0: |
434 self.__debuggersCombo.setItemIcon( |
438 self.__debuggersCombo.setItemIcon( |
435 index, UI.PixmapCache.getIcon("exceptions.png")) |
439 index, UI.PixmapCache.getIcon("exceptions")) |
|
440 |
|
441 # TODO: Refactor the icon setting code into a method |
|
442 def __clientSyntaxError(self, message, filename, lineNo, characterNo, |
|
443 debuggerId): |
|
444 """ |
|
445 Private method to handle a syntax error in the debugged program. |
|
446 |
|
447 @param message message of the syntax error |
|
448 @type str |
|
449 @param filename translated filename of the syntax error position |
|
450 @type str |
|
451 @param lineNo line number of the syntax error position |
|
452 @type int |
|
453 @param characterNo character number of the syntax error position |
|
454 @type int |
|
455 @param debuggerId ID of the debugger backend |
|
456 @type str |
|
457 """ |
|
458 if debuggerId: |
|
459 index = self.__debuggersCombo.findText(debuggerId, Qt.MatchExactly) |
|
460 if index >= 0: |
|
461 self.__debuggersCombo.setItemIcon( |
|
462 index, UI.PixmapCache.getIcon("syntaxError22")) |
|
463 |
|
464 def __clientException(self, exceptionType, exceptionMessage, stackTrace, |
|
465 debuggerId): |
|
466 """ |
|
467 Private method to handle an exception of the debugged program. |
|
468 |
|
469 @param exceptionType type of exception raised |
|
470 @type str |
|
471 @param exceptionMessage message given by the exception |
|
472 @type (str |
|
473 @param stackTrace list of stack entries |
|
474 @type list of str |
|
475 @param debuggerId ID of the debugger backend |
|
476 @type str |
|
477 """ |
|
478 if debuggerId: |
|
479 index = self.__debuggersCombo.findText(debuggerId, Qt.MatchExactly) |
|
480 if index >= 0: |
|
481 self.__debuggersCombo.setItemIcon( |
|
482 index, UI.PixmapCache.getIcon("exceptions")) |
436 |
483 |
437 def setVariablesFilter(self, globalsFilter, localsFilter): |
484 def setVariablesFilter(self, globalsFilter, localsFilter): |
438 """ |
485 """ |
439 Public slot to set the local variables filter. |
486 Public slot to set the local variables filter. |
440 |
487 |
475 Public slot to set the global variable filter. |
522 Public slot to set the global variable filter. |
476 """ |
523 """ |
477 if self.debugServer.isDebugging(): |
524 if self.debugServer.isDebugging(): |
478 filterStr = self.globalsFilterEdit.text() |
525 filterStr = self.globalsFilterEdit.text() |
479 self.debugServer.remoteClientSetFilter(1, filterStr) |
526 self.debugServer.remoteClientSetFilter(1, filterStr) |
480 self.debugServer.remoteClientVariables(2, self.globalsFilter) |
527 self.debugServer.remoteClientVariables( |
|
528 self.getSelectedDebuggerId(), 2, self.globalsFilter) |
481 |
529 |
482 def setLocalsFilter(self): |
530 def setLocalsFilter(self): |
483 """ |
531 """ |
484 Public slot to set the local variable filter. |
532 Public slot to set the local variable filter. |
485 """ |
533 """ |
486 if self.debugServer.isDebugging(): |
534 if self.debugServer.isDebugging(): |
487 filterStr = self.localsFilterEdit.text() |
535 filterStr = self.localsFilterEdit.text() |
488 self.debugServer.remoteClientSetFilter(0, filterStr) |
536 self.debugServer.remoteClientSetFilter(0, filterStr) |
489 if self.currentStack: |
537 if self.currentStack: |
490 self.debugServer.remoteClientVariables( |
538 self.debugServer.remoteClientVariables( |
491 0, self.localsFilter, self.framenr) |
539 self.getSelectedDebuggerId(), 0, self.localsFilter, |
|
540 self.framenr) |
492 |
541 |
493 def handleDebuggingStarted(self): |
542 def handleDebuggingStarted(self): |
494 """ |
543 """ |
495 Public slot to handle the start of a debugging session. |
544 Public slot to handle the start of a debugging session. |
496 |
545 |
534 |
583 |
535 self.__threadList.clear() |
584 self.__threadList.clear() |
536 for thread in threadList: |
585 for thread in threadList: |
537 if thread.get('except', False): |
586 if thread.get('except', False): |
538 state = self.tr("waiting at exception") |
587 state = self.tr("waiting at exception") |
539 icon = "exceptions.png" |
588 icon = "exceptions" |
540 debugStatus = 1 |
589 debugStatus = 1 |
541 elif thread['broken']: |
590 elif thread['broken']: |
542 state = self.tr("waiting at breakpoint") |
591 state = self.tr("waiting at breakpoint") |
543 icon = "mediaPlaybackPause.png" |
592 icon = "mediaPlaybackPause" |
544 if debugStatus < 1: |
593 if debugStatus < 1: |
545 debugStatus = 0 |
594 debugStatus = 0 |
546 else: |
595 else: |
547 state = self.tr("running") |
596 state = self.tr("running") |
548 icon = "mediaPlaybackStart.png" |
597 icon = "mediaPlaybackStart" |
549 itm = QTreeWidgetItem(self.__threadList, |
598 itm = QTreeWidgetItem(self.__threadList, |
550 ["{0:d}".format(thread['id']), |
599 ["{0:d}".format(thread['id']), |
551 thread['name'], state]) |
600 thread['name'], state]) |
552 itm.setIcon(0, UI.PixmapCache.getIcon(icon)) |
601 itm.setIcon(0, UI.PixmapCache.getIcon(icon)) |
553 if thread['id'] == currentID: |
602 if thread['id'] == currentID: |