mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 21:03:23 +08:00
33 lines
919 B
Python
33 lines
919 B
Python
![]() |
|
||
|
from PySide.QtCore import *
|
||
|
from PySide.QtGui import *
|
||
|
|
||
|
import pykd
|
||
|
|
||
|
|
||
|
class StackWidget( QDockWidget ):
|
||
|
|
||
|
def __init__( self, parent ):
|
||
|
QDockWidget.__init__( self )
|
||
|
self.setWindowTitle( "Stack" )
|
||
|
self.textArea = QTextEdit()
|
||
|
self.setWidget( self.textArea )
|
||
|
self.setVisible( False )
|
||
|
parent.addDockWidget( Qt.LeftDockWidgetArea, self )
|
||
|
parent.updated.connect(self.onUpdate )
|
||
|
parent.viewMenu.addAction( "Stack", self.onStackShow )
|
||
|
|
||
|
|
||
|
def onUpdate( self ):
|
||
|
s = ""
|
||
|
|
||
|
stackFrames = pykd.getCurrentStack()
|
||
|
for frame in stackFrames:
|
||
|
s += pykd.findSymbol( frame.instructionOffset ) + " (%x)" % frame.instructionOffset + "\n"
|
||
|
|
||
|
self.textArea.setPlainText( s )
|
||
|
|
||
|
|
||
|
def onStackShow( self ):
|
||
|
self.setVisible( not self.isVisible() )
|