[Ironpython-users] WDB web debugger for IronPython

Pawel Jasinski pawel.jasinski at gmail.com
Mon Nov 24 15:07:50 CET 2014


just to be sure,are you using 2.7.5RC1?
If not, please try it. There were quite a few cpython compatibility
improvements including socket module.

On Mon, Nov 24, 2014 at 1:53 PM, Kerray <kerray.cz at gmail.com> wrote:
> Hi everyone,
> We're using IronPython to script the insides of SharePoint (ASP.NET on IIS).
> For quite some time, I've been looking for a comfortable way to debug these
> scripts without having to install Visual Studio.
> I've considered using standard PDB, with console redirected over the net by
> some sort of messaging. This was the least preferable option, as the user
> comfort is quite low and we'd have to take care of the messaging layer.
> I also considered using IPython to do this, but despite using
> https://github.com/paweljasinski/ repositories, I haven't been anywhere
> close to success.
> However, recently I've re-visited https://github.com/Kozea/wdb and was
> surprised how far it has come since I've seen it for the first time. It
> looked exactly like the debugger I was looking for. I tried playing with it,
> added small IPy compatibility changes here and there, and the results are
> promising.
> I've been attacking this on two fronts:
> 1) I've tried running the server side in IronPython, but it uses Tornado,
> and while I can get it to run (using
> https://github.com/paweljasinski/tornado), on client connect the server
> fails with
> Exception in I/O handler for fd 1492
>     Traceback (most recent call last):
>       File "c:\Program Files (x86)\IronPython
> 2.7\lib\site-packages\tornado-3.1.1-py2.7.egg\tornado\iostream.py", line
> 694, in read_from_fd
>         chunk = self.socket.recv(self.read_chunk_size)
>     error: [Errno 10022] A request to send or receive data was disallowed
> because the socket is not connected and (when sending on a datagram socket
> using a sendto call) no address was supplied
> While the client reports:
> site-packages\wdb\_compat.py", line 135, in recv_bytes
>     size, = struct.unpack("!i", self._handle.recv(4))
> struct.error: unpack requires a string argument of length 4
> But seeing my added debug output, the server and the client have
> successfully communicated over the socket at least once, succesfully sending
> and receiving a guid, and then crash on the message "ServerBreaks" which
> should get server breakpoints.
> Could this be an error with how sockets are handled in IPy/Windows? I've no
> idea.
> 2) I've also tried running the server side in Python, and the client in
> IronPython (as I wouldn't mind doing it like this), but this also fails with
> File "c:\Program Files (x86)\IronPython
> 2.7\lib\site-packages\wdb-2.0.7-py2.7.egg\wdb\__init__.py", line 575, in
> get_trace
> TypeError: Unable to cast object of type
> 'System.Linq.Expressions.FieldExpression' to type
> 'System.Linq.Expressions.BlockExpression'.
> And I've been unable to get any further from here - the line 575 in question
> contains
> startlnos = dis.findlinestarts(code)
> and even when I take the dis.findlinestarts function, put it into the file
> in question, and enhance it with debug output, it seem the call doesn't come
> through to the inside of the function as none of the debug output appears.
> Both points seem to me more like IronPython issues than an issues with WDB
> directly, which is why I'm trying to ask here.
> This is far too deep in the insides for my shallow "expertise", but I'd be
> grateful for any pointers or ideas as to what to try next.
> Thanks - and have a nice day
> Jaromír Matýšek
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> https://mail.python.org/mailman/listinfo/ironpython-users

More information about the Ironpython-users mailing list