So I often use the emacs pdb tool (started with M-x pdb) to debug python code. There is one small issue I don't know how to deal with. When I start pdb to run a specific file the file appears to open in "debug mode" (I don't know if I'm using that term right), meaning that the keyboard shortcuts for things like setting a breakpoint are available to me. But if that file is running code from a different python file then when I navigate to that file I can't use these keyboard shortcuts (that file is open in "regular text editing mode").

So what I've been doing is use a command to copy the file name of the new file and using it to write the command b filename:lineno to set my break points. This isn't too bad, but I think it'd be nice if I could shorten this process a bit. I'm thinking doing something to make it so that once I start pdb every python file I open will be open in "debug mode" so I can use the keyboard shortcuts to set break points would be nice if that makes sense.

Does anyone have any advice of how to deal with this?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.