2013-10-17 21:34:07 +08:00
|
|
|
|
|
|
|
from IPython.core.magic import Magics, magics_class, line_magic, cell_magic, line_cell_magic
|
|
|
|
import pykd
|
|
|
|
|
|
|
|
@magics_class
|
|
|
|
class PykdMagic (Magics):
|
|
|
|
|
|
|
|
@line_magic
|
|
|
|
def kd(self,line):
|
2013-10-31 16:10:01 +08:00
|
|
|
"magic for calling any windbg command"
|
2013-10-17 21:34:07 +08:00
|
|
|
try:
|
|
|
|
pykd.dprintln( pykd.dbgCommand(line) )
|
|
|
|
except pykd.BaseException:
|
|
|
|
pykd.dprintln("invalid windbg syntax")
|
|
|
|
return None
|
|
|
|
|
|
|
|
def load_ipython_extension(ipython):
|
|
|
|
ipython.register_magics(PykdMagic)
|
|
|
|
|
|
|
|
def unload_ipython_extension(ipython):
|
2013-10-31 16:10:01 +08:00
|
|
|
pass
|
2013-10-17 21:34:07 +08:00
|
|
|
|