PyDev: How to invoke debugging specific command from console (with breakpoints)?

后端 未结 1 1840
一个人的身影
一个人的身影 2020-12-10 17:55

Suppose I wrote a function, which I want to debug.

PyDev helps debugging a lot with its advanced features, like breakpoints.

After setting the breakpoints,

相关标签:
1条回答
  • 2020-12-10 18:20

    Actually, yes, you can do that in the latest PyDev versions.

    You have to enable that in the preferences as explained in:

    http://pydev.org/manual_adv_interactive_console.html#full-debug-support-in-interactive-console

    (i.e.: Connect console to a debug session)


    Edit (related to 2nd part):

    Unfortunately, the way things are, this is expected... your code is 'blocked' in a breakpoint and thus the console can't answer to you nor do any evaluation while you're in the breakpoint in this mode (you can only use the debugger watches/expressions at this point), so, the idea is that you use the console to execute things and then if you want you can add a breakpoint, but you can only use the console again when you left the breakpoint.

    Note that if you want to use the interactive console in the context of a breakpoint, a different approach would be selecting a stack frame (in the debug view) > right-clicking it > pydev > Debug Console (or you can also in the debug view create a new console view connected to the debug session for the same effect).

    0 讨论(0)
提交回复
热议问题