Search code examples
pythonpdbgedit

Python - Debug running application


I'm trying to fix bugs from gedit plugins. Gedit uses C but some of its plugins are in Python. My computer is old and I cannot run an IDE. I've read about PDB (Python Debugger), but i cannot call the plugin directly with PDB. Is it possible set breakpoints in a gedit plugin, run gedit and then use PDB to debug?


Solution

  • You could try editing the gedit plugins that you want to debug and putting

    import pdb; pdb.set_trace()
    

    in there and that should break into the debugger. You might need to launch gedit from a command prompt instead of the GUI so that it has a terminal for pdb to run in.