inducer / pudb

Full-screen console debugger for Python
https://documen.tician.de/pudb/
Other
3k stars 230 forks source link

Fixed issue with closing the session in remote debugging #450

Closed mlubimow closed 3 years ago

mlubimow commented 3 years ago

Fix for https://github.com/inducer/pudb/issues/289.

inducer commented 3 years ago

LGTM! Thanks for your contribution.

mlubimow commented 3 years ago

@inducer Actually I realised recently that it's current behaviour also is not fully correct. I was focused on fixing the existing code more than the logic itself, and later I had second thoughts that on continue we probably don't want to close the session, because when in normal remote mode (reverse=False) it might be inconvenient to be required to telnet again if there is another breakpoint. Do you know if there is any hook that would allow us to run some code once the debugged process ends?

On the good side, with reverse=True its easy as its enough to add -k flag to nc (stty -echo -icanon && nc -l -p 6899 -k) to make continue to work as expected.

inducer commented 3 years ago

Do you know if there is any hook that would allow us to run some code once the debugged process ends?

Possibly atexit?

inducer commented 3 years ago

Actually I realised recently that it's current behaviour also is not fully correct.

Should we revert this in the meantime?

mlubimow commented 3 years ago

@inducer Yeah atexit seems to be a way better idea, I will create another PR fixing this.