How to exit pdb and allow program to continue?

后端 未结 5 720
你的背包
你的背包 2020-12-22 20:53

I\'m using the pdb module to debug a program. I\'d like to understand how I can exit pdb and allow the program to continue onward to completion. The program is computational

5条回答
  •  星月不相逢
    2020-12-22 21:32

    continue should "Continue execution, only stop when a breakpoint is encountered", so you've got a breakpoint set somewhere. To remove the breakpoint (if you inserted it manually):

    (Pdb) break
    Num Type         Disp Enb   Where
    1   breakpoint   keep yes   at /path/to/test.py:5
    (Pdb) clear 1
    Deleted breakpoint 1
    (Pdb) continue
    

    Or, if you're using pdb.set_trace(), you can try this (although if you're using pdb in more fancy ways, this may break things...)

    (Pdb) pdb.set_trace = lambda: None  # This replaces the set_trace() function!
    (Pdb) continue
    # No more breaks!
    

提交回复
热议问题