PyDev interactive console at breakpoint

I am using Aptana Studio with Pydev 1.5.3 to debug my Django applications. I use the PyDev remote debugger and some code in manage.py, and most of the time this setting works successfully - I can set breakpoints, check variables and execute step / continue through my code.

However, I would like to execute arbitrary code at the breakpoint - what I really missed after switching from pdb to Eclipse debugging. In the debugging perspective, there is an interactive console, but it is inactive for me.

So my question is: is it possible to configure an interactive console in PyDev with a remote debugger that can "enter" the code at a breakpoint?

+4
debugging pydev
source share
4 answers

strange, I use pydev 1.5.6 for remote debugging, and I can use the interactive console - I type cmmand, press enter, after a while I return the results; check that your firewall is not blocking anything (if you are sure the interactive console is working in local mode). there are even settings in the pydev source code to set how much of stdout should be returned to the client (in characters), it should work

+1
source share

After some digging, I found that I can use the Expressions view to access the properties of variables and view the results of class methods, but this is still not a full console at the breakpoint.

+1
source share

With PyDev 1.5.5, this should be possible:

  • In the Variables view, you can right-click on a name and select "change value".
  • The console also works, although a little more complicated.
    This is only for verification and in a very strange way: you have to enter text in the "Debug server" console, and you will get the result in the "filename" console.
    Also note that you need to press the key twice, leaving an empty line.

While the "empty line" trick is documented, the problem with two different consoles for input and output is not, and I think it might be a mistake.

0
source share

In my development stack, which ran commands to enter Apache + mod_wsgi into the console, their output was redirected to the site error logs. To resolve this, you set stdoutToServer=True and sterrToServer=True to route the capture of all output to the PyDev remote debugger:

 from pydevsrc import pydevd;pydevd.settrace('192.168.2.8', stdoutToServer=True, stderrToServer=True) #clone and put on python path: https://github.com/tenXer/PyDevSrc 
0
source share

All Articles