tamentis / rpdb

Wrapper around pdb allowing remote debugging via netcat or telnet. This is especially useful in a Tomcat/Jython environment where little debugging tools are available.
BSD 2-Clause "Simplified" License
130 stars 44 forks source link

RFE: Add support for using ipdb #13

Open bowlofeggs opened 8 years ago

bowlofeggs commented 8 years ago

Hello! ipdb is a really nice improvement on pdb, with tab completion and colors and many other nice things. Could rpdb be extended to allow me to select which debugger to use as a backend? Perhaps something like this:

import rpdb
rpdb.set_trace(debugger='ipdb')

With an API like that, pdb could remain the default debugger and ipdb could be an optional dependency. What do you think?

tamentis commented 8 years ago

I think it's worth exploring. Since rpdb is a subclass of pdb, it's not a simple replacement but others have suggested encapsulating the underlying debugging instead of subclassing it which would allow for such a change.

bowlofeggs commented 8 years ago

I thought about the interface some more, and it occurred to me that it could just use ipdb if it's present, and fall back to pdb if it is not present. This way the user doesn't need to specify which debugger to use.

I believe that @asmacdo wanted to take a crack at this so we'll see if he can come up with something awesome.

BTW, thanks for creating rpdb as Free Software! I use it often and it works well.

lebedov commented 8 years ago

@rbarlow: FYI, I combined rpdb with ipdb in a single package called ripdb. Note that since ipdb is currently licensed under the GPL, the ripdb code is as well and hence can't be directly merged into rpdb without changing the latter's license (unless a currently stalled request to relicense ipdb is realized).

bowlofeggs commented 8 years ago

@lebedov I'm not sure that is a correct assessment. rpdb is licensed under the 2-clause BSD[0] and ipdb is licensed under the GPL[1]. According to gnu.org, the GPL is compatible with the 2-clause BSD[2] so I do not believe there is any issue with combining rpdb with ipdb.

[0] https://github.com/tamentis/rpdb/blob/master/LICENSE.txt [1] https://github.com/gotcha/ipdb/blob/master/COPYING.txt [2] https://www.gnu.org/philosophy/license-list.html#FreeBSD

lebedov commented 8 years ago

@rbarlow: There isn't any issue combining GPL-compatible code with GPL code, but relicensing GPL code under a license such as 2-clause BSD that permits things disallowed by the GPL is problematic.

bowlofeggs commented 8 years ago

@lebedov oh I see, you were discussing the prospect of merging your project with this project, not with importing ipdb in this project and doing something similar to what you did.

lebedov commented 8 years ago

@rbarlow: correct.