Hi,
using a debugger with calibre is rather difficult, but I've managed to get the PyDev debugger working via remote debugging.
Here are the necessary steps:
- Set up calibre development for your platform (I'm using Windows 7 64bit):
http://manual.calibre-ebook.com/develop.html
- Set up PyDev remote debugging:
http://pydev.org/manual_adv_remote_debugger.html. For step 3 "Make sure pydevd.py is in your pythonpath" I've copied the required files to the src directory of calibre.
- Locate the source code to debug and add the line
Code:
import pydevd;pydevd.settrace()
- Start the PyDev remote debugger server
- Start calibre with "calibre-debug -g"
- When the added line is reached, the debugger will stop. You can continue from there, set break points etc.
Please note that it doesn't work to add the debug line at the calibre startup code and single step from there through the whole application, as the calibre startup is rather tricky and different threads are running. So it's best to just add the line (even at multiple locations) where you would normally set your breakpoint.
Happy debugging,
Steffen