Equivalent to pdb.set_trace()?

Is there an IntelliJ/PyCharm equivalent to pdb.set_trace() that drops me into the GUI debugger?

Sometimes I just want to type in a little bit of logic to drop me into the debugger conditionally.

I'm okay if it's an undocumented/unsupported hacky thing I could do that might break in the next release.
3
3 comments
You can use the Run -> Debug... to create and run a debug configuration for a module of your interest. You can put a breakpoint on a line by clicking on its left margin. The context menu of a breakpoint has a "Condition" field, where you can type an stop expression. When it is true the debugger will stop at the breakpoint.
0
If you can't start your app directly from PyCharm, you can use remote debug session.
http://www.jetbrains.com/pycharm/webhelp/run-debug-configuration-python-remote-debug.html
0

I think you're missing the point. What is asked for is an attach to process, but initiated from the process. 

The attach to process functionality is great, but very cumbersome to use. What the pdb functionality does is drop the current process into the debugger. The `debugger;` statement in javascript does the same in the browser. Can we please have the same in pycharm..? 

0

Please sign in to leave a comment.