Have you tried typing quit() or exit()
Interactive interpreter shells like that often even print out a message telling you to call those functions as the way to exit.
For a debugger they will often have a similar command you enter to do the same.
I can't give you a better answer than that right now as have limited Internet access and don't have pdb source code handy to tell you the command.
There are alao perhaps better ways of achieving what you want than pdb. Exactly what sort of problem are you trying to debug?
Graham