rpdb icon indicating copy to clipboard operation
rpdb copied to clipboard

Premature call to OccupiedPorts.unclaim( )

Open royrwood opened this issue 7 years ago • 1 comments

If I set a breakpoint in my code, then give the 'c' command, execution proceeds to my breakpoint and stops as expected. Behind the scenes, rpdb internally calls OccupiedPorts.unclaim( ) which deletes the port reference from the self.claims dictionary.

When I then give the 'c' command to continue execution after the breakpoint and my code runs to completion, rpdb again calls OccupiedPorts.unclaim( ), resulting in a KeyError exception, since the port entry was already deleted.

I think the real bug is in Rpdb.d_continue( ), since it calls self.shutdown( ), which in turn calls OCCUPIED.unclaim( ).

royrwood avatar Jul 10 '18 19:07 royrwood

Calling shutdown sort of makes sense. When you continue, you're exiting pdb and letting Python continue as normal. The problem for us is that we don't want to drop the connection, otherwise we have to keep quitting telnet and reconnecting every time we do a continue. I'm not sure what the solution is to this but I'll keep thinking.

AWhetter avatar Mar 08 '19 02:03 AWhetter