53 |
53 |
54 def __init__(self, debugServer, parent=None): |
54 def __init__(self, debugServer, parent=None): |
55 """ |
55 """ |
56 Constructor |
56 Constructor |
57 |
57 |
58 @param debugServer reference to the debug server object (DebugServer) |
58 @param debugServer reference to the debug server object |
59 @param parent parent widget (QWidget) |
59 @type DebugServer |
|
60 @param parent parent widget |
|
61 @type QWidget |
60 """ |
62 """ |
61 super(DebugViewer, self).__init__(parent) |
63 super(DebugViewer, self).__init__(parent) |
62 |
64 |
63 self.debugServer = debugServer |
65 self.debugServer = debugServer |
64 self.debugUI = None |
66 self.debugUI = None |
320 |
322 |
321 def setDebugger(self, debugUI): |
323 def setDebugger(self, debugUI): |
322 """ |
324 """ |
323 Public method to set a reference to the Debug UI. |
325 Public method to set a reference to the Debug UI. |
324 |
326 |
325 @param debugUI reference to the DebugUI object (DebugUI) |
327 @param debugUI reference to the DebugUI object |
|
328 @type DebugUI |
326 """ |
329 """ |
327 self.debugUI = debugUI |
330 self.debugUI = debugUI |
328 self.callStackViewer.setDebugger(debugUI) |
331 self.callStackViewer.setDebugger(debugUI) |
329 |
332 |
330 # connect some debugUI signals |
333 # connect some debugUI signals |
334 self.debugUI.debuggingStarted.connect( |
337 self.debugUI.debuggingStarted.connect( |
335 self.handleDebuggingStarted) |
338 self.handleDebuggingStarted) |
336 |
339 |
337 def handleResetUI(self): |
340 def handleResetUI(self): |
338 """ |
341 """ |
339 Public method to reset the SBVviewer. |
342 Public method to reset the viewer. |
340 """ |
343 """ |
341 self.globalsViewer.handleResetUI() |
344 self.globalsViewer.handleResetUI() |
342 self.localsViewer.handleResetUI() |
345 self.localsViewer.handleResetUI() |
343 self.setGlobalsFilter() |
346 self.setGlobalsFilter() |
344 self.setLocalsFilter() |
347 self.setLocalsFilter() |
353 |
356 |
354 def initCallStackViewer(self, projectMode): |
357 def initCallStackViewer(self, projectMode): |
355 """ |
358 """ |
356 Public method to initialize the call stack viewer. |
359 Public method to initialize the call stack viewer. |
357 |
360 |
358 @param projectMode flag indicating to enable the project mode (boolean) |
361 @param projectMode flag indicating to enable the project mode |
|
362 @type bool |
359 """ |
363 """ |
360 self.callStackViewer.clear() |
364 self.callStackViewer.clear() |
361 self.callStackViewer.setProjectMode(projectMode) |
365 self.callStackViewer.setProjectMode(projectMode) |
362 |
366 |
363 def isCallTraceEnabled(self): |
367 def isCallTraceEnabled(self): |
364 """ |
368 """ |
365 Public method to get the state of the call trace function. |
369 Public method to get the state of the call trace function. |
366 |
370 |
367 @return flag indicating the state of the call trace function (boolean) |
371 @return flag indicating the state of the call trace function |
|
372 @rtype bool |
368 """ |
373 """ |
369 return self.callTraceViewer.isCallTraceEnabled() |
374 return self.callTraceViewer.isCallTraceEnabled() |
370 |
375 |
371 def clearCallTrace(self): |
376 def clearCallTrace(self): |
372 """ |
377 """ |
379 Public slot to set the call trace viewer to project mode. |
384 Public slot to set the call trace viewer to project mode. |
380 |
385 |
381 In project mode the call trace info is shown with project relative |
386 In project mode the call trace info is shown with project relative |
382 path names. |
387 path names. |
383 |
388 |
384 @param enabled flag indicating to enable the project mode (boolean) |
389 @param enabled flag indicating to enable the project mode |
|
390 @type bool |
385 """ |
391 """ |
386 self.callTraceViewer.setProjectMode(enabled) |
392 self.callTraceViewer.setProjectMode(enabled) |
387 |
393 |
388 def showVariables(self, vlist, showGlobals): |
394 def showVariables(self, vlist, showGlobals): |
389 """ |
395 """ |
390 Public method to show the variables in the respective window. |
396 Public method to show the variables in the respective window. |
391 |
397 |
392 @param vlist list of variables to display |
398 @param vlist list of variables to display |
|
399 @type list |
393 @param showGlobals flag indicating global/local state |
400 @param showGlobals flag indicating global/local state |
|
401 @type bool |
394 """ |
402 """ |
395 if showGlobals: |
403 if showGlobals: |
396 self.globalsViewer.showVariables(vlist, self.framenr) |
404 self.globalsViewer.showVariables(vlist, self.framenr) |
397 else: |
405 else: |
398 self.localsViewer.showVariables(vlist, self.framenr) |
406 self.localsViewer.showVariables(vlist, self.framenr) |
400 def showVariable(self, vlist, showGlobals): |
408 def showVariable(self, vlist, showGlobals): |
401 """ |
409 """ |
402 Public method to show the variables in the respective window. |
410 Public method to show the variables in the respective window. |
403 |
411 |
404 @param vlist list of variables to display |
412 @param vlist list of variables to display |
|
413 @type list |
405 @param showGlobals flag indicating global/local state |
414 @param showGlobals flag indicating global/local state |
|
415 @type bool |
406 """ |
416 """ |
407 if showGlobals: |
417 if showGlobals: |
408 self.globalsViewer.showVariable(vlist) |
418 self.globalsViewer.showVariable(vlist) |
409 else: |
419 else: |
410 self.localsViewer.showVariable(vlist) |
420 self.localsViewer.showVariable(vlist) |
412 def showVariablesTab(self, showGlobals): |
422 def showVariablesTab(self, showGlobals): |
413 """ |
423 """ |
414 Public method to make a variables tab visible. |
424 Public method to make a variables tab visible. |
415 |
425 |
416 @param showGlobals flag indicating global/local state |
426 @param showGlobals flag indicating global/local state |
|
427 @type bool |
417 """ |
428 """ |
418 if showGlobals: |
429 if showGlobals: |
419 self.__tabWidget.setCurrentWidget(self.glvWidget) |
430 self.__tabWidget.setCurrentWidget(self.glvWidget) |
420 else: |
431 else: |
421 self.__tabWidget.setCurrentWidget(self.lvWidget) |
432 self.__tabWidget.setCurrentWidget(self.lvWidget) |
544 |
555 |
545 def __frameSelected(self, frmnr): |
556 def __frameSelected(self, frmnr): |
546 """ |
557 """ |
547 Private slot to handle the selection of a new stack frame number. |
558 Private slot to handle the selection of a new stack frame number. |
548 |
559 |
549 @param frmnr frame number (0 is the current frame) (int) |
560 @param frmnr frame number (0 is the current frame) |
|
561 @type int |
550 """ |
562 """ |
551 if frmnr >= 0: |
563 if frmnr >= 0: |
552 self.framenr = frmnr |
564 self.framenr = frmnr |
553 if self.debugServer.isDebugging(): |
565 if self.debugServer.isDebugging(): |
554 self.debugServer.remoteClientVariables( |
566 self.debugServer.remoteClientVariables( |
596 |
608 |
597 def currentWidget(self): |
609 def currentWidget(self): |
598 """ |
610 """ |
599 Public method to get a reference to the current widget. |
611 Public method to get a reference to the current widget. |
600 |
612 |
601 @return reference to the current widget (QWidget) |
613 @return reference to the current widget |
|
614 @rtype QWidget |
602 """ |
615 """ |
603 return self.__tabWidget.currentWidget() |
616 return self.__tabWidget.currentWidget() |
604 |
617 |
605 def setCurrentWidget(self, widget): |
618 def setCurrentWidget(self, widget): |
606 """ |
619 """ |
607 Public slot to set the current page based on the given widget. |
620 Public slot to set the current page based on the given widget. |
608 |
621 |
609 @param widget reference to the widget (QWidget) |
622 @param widget reference to the widget |
|
623 @type QWidget |
610 """ |
624 """ |
611 self.__tabWidget.setCurrentWidget(widget) |
625 self.__tabWidget.setCurrentWidget(widget) |
612 |
626 |
613 def showThreadList(self, currentID, threadList, debuggerId): |
627 def showThreadList(self, currentID, threadList, debuggerId): |
614 """ |
628 """ |
676 |
690 |
677 def __threadSelected(self, current, previous): |
691 def __threadSelected(self, current, previous): |
678 """ |
692 """ |
679 Private slot to handle the selection of a thread in the thread list. |
693 Private slot to handle the selection of a thread in the thread list. |
680 |
694 |
681 @param current reference to the new current item (QTreeWidgetItem) |
695 @param current reference to the new current item |
|
696 @type QTreeWidgetItem |
682 @param previous reference to the previous current item |
697 @param previous reference to the previous current item |
683 (QTreeWidgetItem) |
698 @type QTreeWidgetItem |
684 """ |
699 """ |
685 if current is not None and self.__doThreadListUpdate: |
700 if current is not None and self.__doThreadListUpdate: |
686 tid = current.data(0, self.ThreadIdRole) |
701 tid = current.data(0, self.ThreadIdRole) |
687 self.debugServer.remoteSetThread(self.getSelectedDebuggerId(), tid) |
702 self.debugServer.remoteSetThread(self.getSelectedDebuggerId(), tid) |
688 |
703 |
689 def __callStackFrameSelected(self, frameNo): |
704 def __callStackFrameSelected(self, frameNo): |
690 """ |
705 """ |
691 Private slot to handle the selection of a call stack entry of the |
706 Private slot to handle the selection of a call stack entry of the |
692 call stack viewer. |
707 call stack viewer. |
693 |
708 |
694 @param frameNo frame number (index) of the selected entry (integer) |
709 @param frameNo frame number (index) of the selected entry |
|
710 @type int |
695 """ |
711 """ |
696 if frameNo >= 0: |
712 if frameNo >= 0: |
697 self.stackComboBox.setCurrentIndex(frameNo) |
713 self.stackComboBox.setCurrentIndex(frameNo) |
698 |
714 |
699 def __debuggerSelected(self, current, previous): |
715 def __debuggerSelected(self, current, previous): |