Отладка скриптов в windbg

Для отладки можно использовать отладчик pdb.
kd> !py pdb C:\proj\pykd\snippets\cr0.py
> c:\proj\pykd\snippets\cr0.py(5)()
-> import sys
(Pdb) s
> c:\proj\pykd\snippets\cr0.py(6)()
-> from pykd import *
(Pdb) s
> c:\proj\pykd\snippets\cr0.py(8)()
-> def cr0( value = 0 ):
(Pdb) s
> c:\proj\pykd\snippets\cr0.py(23)()
-> if __name__ == "__main__":
(Pdb) s
> c:\proj\pykd\snippets\cr0.py(25)()
-> if not isSessionStart():
(Pdb) s
> c:\proj\pykd\snippets\cr0.py(29)()
-> if ( len( sys.argv ) > 1 ):
(Pdb) s
> c:\proj\pykd\snippets\cr0.py(32)()
-> cr0()
(Pdb) s
--Call--
> c:\proj\pykd\snippets\cr0.py(8)cr0()
-> def cr0( value = 0 ):
(Pdb) 


Использование pdb
(Pdb) help

Documented commands (type help ):
========================================
EOF    bt         cont      enable  jump  pp       run      unt   
a      c          continue  exit    l     q        s        until 
alias  cl         d         h       list  quit     step     up    
args   clear      debug     help    n     r        tbreak   w     
b      commands   disable   ignore  next  restart  u        whatis
break  condition  down      j       p     return   unalias  where 

Miscellaneous help topics:
==========================
exec  pdb

Undocumented commands:
======================
retval  rv



Подробности тут:
http://docs.python.org/library/pdb.html

Last edited Nov 22, 2010 at 8:32 AM by kernelnet, version 1

Comments

No comments yet.