python-web-pdb icon indicating copy to clipboard operation
python-web-pdb copied to clipboard

Unable to see source code

Open Dan-Eli opened this issue 4 years ago • 3 comments

I'm using web-db in the context of remote debug (on the same machine) with a tool call FME. This tool is a GUI ETL (Extract Transform ans load) that manupulates spatial information. In FME we can include python scripts to create specific manipulations that are not supplied by the basic GUI tools. When I include a python script that is stored on the file disk system and referenced with from aaa import bbb there is no problem and I can debug and see my code/variable in the browser. There is another mode in FME tool, where we can write directly the python code which is not stored on the file disk system and we do not need to import it (the python code is probably loaded dynamically). When I use the latter method, I can start web-pdb in the browser but I cannot see the python source code and neither the variables but I know web-pdb is working as I can print the content of the variable from the PDB window (at the bottom) and step blindly from line to line. Is there something I'm doing wrongly, if not it would be very useful to adapt web-pdb for that context.

Dan-Eli avatar Oct 20 '21 01:10 Dan-Eli

Do I understand correctly that you enter Python code in some editor and then run it "live"? Web-PDB was never tested in such scenario. Since it's only a front-end for Python's built-in PDB, it looks like the latter does not get all data about the current execution frame. BTW, what does ll command output?

romanvm avatar Oct 20 '21 15:10 romanvm

Yes it's kind of entering some Python code in the FME GUI which it turns run it "live" When I typellin the command output it displays: > (29)input() (Pdb) ll *** could not get source code (Pdb) In the PDB Console Is there something else you would like me to test?

Dan-Eli avatar Oct 20 '21 15:10 Dan-Eli

I'm afraid this is a limitation of Python's built-in PDB.

romanvm avatar Oct 21 '21 07:10 romanvm