Menu

pydevd.settrace() doesn't work right

bluelou
2010-09-04
2013-03-15
  • bluelou

    bluelou - 2010-09-04

    i've installed PyDev 1.6.1 using Jython 2.1 into Eclipse 3.5 (Galileo) under Ubuntu 10. Everything seems to work as advertised, except for remote debugging using settrace(). I start the remote debugging server on the default port (5678). I Run my Jython module. The first time the Jython code encounters a settrace() statement, it takes the breakpoint, but stops in module weakref at line 80, here:

    80    def __setitem__(self, key, value):  <== Stops here
                 self.data = KeyedRef(value, self._remove, key)

    If I step (F6), it steps out of this method and returns to line 97 of module threading

    Stepping out of that, it never stops at the line following settrace() in my Jython code.

    However, if I add a second settrace() statement, it does stop at the line following that statement in the Jython code. For example,

        import pydevd; settrace()  <===  Stops at weakref:80
        print 'Breakpoint 1'              <=== Does NOT stop here
        settrace()
        print 'Breakpoint 2'              <=== Stops here

    Can someone tell me what's going on and/or what I'm doing wrong?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-09-07

    Strange, that does not happen for me… are you testing in a module with just that content or do you have more code there to reproduce it?

    Cheers,

    Fabio

     
  • bluelou

    bluelou - 2010-09-07

    Thanks, Fabio. Here's my test Jython code, in its entirety:

    1   import pydevd
    2   pydevd.settrace()
    4   print 'Breakpoint 1'
    6   pydevd.settrace()
    8   print 'Breakpoint 2'
    9   print 'Line 3'
    10 print 'Line 4'
    11 print 'Line 5'
    

    If I run this in Eclipse (using Run as Jython), it appears to stop at line 80 of a module named weakref, and described as, "Weak reference support for Python.":

    <snip>
    80    def __setitem__(self, key, value):    <== Stops here???
    81          self.data[key] = KeyedRef(value, self._remove, key)
    </snip>
    

    If I then click Continue, the second breakpoint is correctly taken and I can Step (F6) through the remaining Jython statements:

    8   print 'Breakpoint 2'   <=== Stops here
    

    Pretty simple. I just don't understand why it appears to stop in weakref at all, instead of at the first breakpoint, following the first settrace() statement.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.