How do you exit PDB / and / kill the program?

How do you kill the PDB and the program it runs, like LLDB commands proc kill; exit

or exit (y)

?

Ctrl+ Ddoesn't work and all the questions I see here are how to exit while still saving the program. However, I am sitting in a PDB session and I encountered an error that causes an infinite loop, and while there are indeed other things I can do to kill the program, I figured I would ask what the PDB command should do.

+3


source to share


1 answer


The pdb command to kill the program is q

or quit

. Quoting docs :

quit)
Exit the debugger. The running program is interrupted.

When there is q

not enough to stop the loop (perhaps you have the wrong behavior, a except

block), you may need a os._exit()

low-level command that immediately exits the process. ( q

and sys.exit

work, bdb.BdbQuit

exceptions - bdb.BdbQuit

for q

and SystemExit

for sys.exit

.) will os._exit

prevent os._exit

any blocks finally

or methods __exit__

, so you might have to deal with data corruption or loss.



Example: import os; os._exit(0)

import os; os._exit(0)

( fooobar.com/questions/12249597 / ... )

+1


source







All Articles