pdbpp / pdbpp

pdb++, a drop-in replacement for pdb (the Python debugger)
BSD 3-Clause "New" or "Revised" License
1.3k stars 66 forks source link

Pdbpp for remote debugging/ debugging daemons #351

Open TheMeaningfulEngineer opened 4 years ago

TheMeaningfulEngineer commented 4 years ago

Is far as python debuggers that can be used from the cli, pdbpp has for me enhanced the debugging experience significantly.

One major feature I'm finding missing and which has been implemented in other projects (epdb, python-remote-pdb) which attempt to extend pdb is the possibility to debug daemons.

In other words they allow for a mechanism to attach into a process that isn't connected to a tty.

I'm mostly using one of them for these functions:

Are plans to extend pdbpp with this functionality?

blueyed commented 4 years ago

I think it would be good to improve the integration with e.g. python-remote-pdb then. Is it about the terminal size only? (https://github.com/ionelmc/python-remote-pdb/issues/21)

Can you provide an example on how to use/try this locally, so that others (i.e. me) can see how it works easily?

blueyed commented 4 years ago

(Also make sure to use pdb++ master - there have been fixes also to the terminal size detection etc, and IIRC it can be forced/set already.)

TheMeaningfulEngineer commented 4 years ago

I think it would be good to improve the integration with e.g. python-remote-pdb then. Is it about the terminal size only? (ionelmc/python-remote-pdb#21)

It's terminal size, arrow keys and autocomplete.

Can you provide an example on how to use/try this locally, so that others (i.e. me) can see how it works easily?

Will come back with an example and how it behaves on master. :+1:

TheMeaningfulEngineer commented 4 years ago

Am not the best screencast creator in the world, but hopefully this will do :)

It seems there are multiple issues here.

pdbpp:

remote-pdb:

python-remote-debug-small

# Setting the environment
git clone https://github.com/pdbpp/pdbpp.git
python3 -m venv pdbpp_master
source pdbpp_master/bin/activate
pip3 install wheel python-remote-pdb
cd pdbpp
pip3 install .
cd ..
#remote_debug.py
from remote_pdb import RemotePdb    
import pdb    

RemotePdb('127.0.0.1', 4444).set_trace()    
#pdb.set_trace()    
print("This is a very long line. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35.")    
print("This is a very long line. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35.")    
print("This is a very long line. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35.")    
# Commands executed in the example
# Terminal 1:
python3 remote_debug.py
# Switch to the remote debugger in the source
python3 remote_debug.py

#Other terminal:
telnet 127.0.0.1 4444
TheMeaningfulEngineer commented 4 years ago

Have just tried epdb again.

epdb-pdbpp

Have misinterpreted the lack of the pdbpp prompt. Regardless of that a lot of the functionality remains preserved:

It dies when you try to edit but regardless am finding it a much better experience than with remote_pdb

mecampbellsoup commented 3 years ago

So what is the recommended remote debugger library to use that works best with pdbpp currently?

mecampbellsoup commented 3 years ago

Can you provide an example on how to use/try this locally, so that others (i.e. me) can see how it works easily?

After (briefly) reading thru this discussion I don't really see how you are using them together...?