zoukankan      html  css  js  c++  java
  • python--pdb

    pdb 常用命令

    命令             解释
    
    break 或 b 设置断点       设置断点
    
    continue 或 c        继续执行程序
    
    list 或 l           查看当前行的代码段
    
    step 或 s          进入函数
    
    return 或 r           执行代码直到从当前函数返回
    
    exit 或 q           中止并退出
    
    next 或 n          执行下一行 pp 打印变量的值
    
    help            帮助
    (Pdb) s
    --Call--
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(3)pdb_test()
    -> def pdb_test(arg):
    (Pdb) l
      1   import pdb
      2   
      3  -> def pdb_test(arg):
      4       pdb.set_trace()
      5       for i in range(arg):
      6           print(i)
      7       return arg
    [EOF]
    (Pdb) b 6
    Breakpoint 1 at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:6
    (Pdb) b 3
    Breakpoint 2 at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:3
    (Pdb) b
    Num Type         Disp Enb   Where
    1   breakpoint   keep yes   at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:6
    2   breakpoint   keep yes   at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:3
    (Pdb) c
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(5)pdb_test()
    -> for i in range(arg):
    (Pdb) l
      1   import pdb
      2   
      3   def pdb_test(arg):
      4       pdb.set_trace()
      5  ->     for i in range(arg):
      6           print(i)
      7       return arg
    [EOF]
    (Pdb) n
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(6)pdb_test()
    -> print(i)
    (Pdb) 
    0
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(5)pdb_test()
    -> for i in range(arg):
    (Pdb) 
    *** SyntaxError: invalid syntax (<stdin>, line 1)
    (Pdb) 
    *** SyntaxError: invalid syntax (<stdin>, line 1)
    (Pdb) n
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(6)pdb_test()
    -> print(i)
    (Pdb) 
    1
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(5)pdb_test()
    -> for i in range(arg):
    (Pdb) n
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(6)pdb_test()
    -> print(i)
    (Pdb) 
    2
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(5)pdb_test()
    -> for i in range(arg):
    (Pdb) l
      1   import pdb
      2   
      3   def pdb_test(arg):
      4       pdb.set_trace()
      5  ->     for i in range(arg):
      6           print(i)
      7       return arg
    [EOF]
    (Pdb) a
    arg = 5
    (Pdb) p i
    2
    (Pdb) s
    > c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py(6)pdb_test()
    -> print(i)
    (Pdb) b
    (Pdb) l
      1   import pdb
      2   
      3   def pdb_test(arg):
      4       pdb.set_trace()
      5       for i in range(arg):
      6  ->         print(i)
      7       return arg
    [EOF]
    (Pdb) b 5
    Breakpoint 3 at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:5
    (Pdb) condition 2 i==3
    (Pdb) b
    Num Type         Disp Enb   Where
    1   breakpoint   keep yes   at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:6
    2   breakpoint   keep yes   at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:3
     stop only if i==3
    3   breakpoint   keep yes   at c:userswuchan4xdesktopeilingeunit_tests_dumppbd_test02.py:5
    (Pdb) a
    arg = 5
  • 相关阅读:
    第 五 课 golang语言变量
    【托业】【新托业TOEIC新题型真题】学习笔记9-题库七+八--P4-5
    【托业】【语法题】笔记
    【托业】【新托业TOEIC新题型真题】学习笔记8-题库五->P7
    【托业】【金山词霸】1-42待巩固词汇(包含首次背诵措词)
    【托业】【新托业TOEIC新题型真题】学习笔记7-题库二->P1~4
    【托业】【新托业TOEIC新题型真题】学习笔记5-题库二->P7
    【托业】【新托业TOEIC新题型真题】学习笔记4-题库一->P7
    【托业】【新托业TOEIC新题型真题】学习笔记3-题库二->P5-6
    【托业】【新托业TOEIC新题型真题】学习笔记2-题库一-->P5-6
  • 原文地址:https://www.cnblogs.com/eilinge/p/9239143.html
Copyright © 2011-2022 走看看