I code in Python and I my workflow uses debuggers (I coded for 8 years in Matlab).
I develop numerical simulation codes: most of the time it returns a result, the question is: "Is the result right?"
Consequently, I use the debugger to track constantly variables' content.
Here is my workflow:
- I code a bunch of lines
- M-x realgud:ipdb RET the_name_of_the_file_i_want_to_debug RET
- I set one breakpoint in a tricky part of the code I want to inspect
- M-x isend-associate RET *ipdb thefile shell* RET
- I test the lines I feel might be wrong: M-x isend-mode RET C-RET (on the line I want to test in the interpreter)
- I find the mistake and the right code, I change the file: C-x C-q (this command leave at the same time the read-only-mode and the single keystroke mode of realGUD), I modify the code, save C-x C-s
- I go back in realGUD activating again the single keystroke: C-x C-a C-q (all the breakpoints are still present)
- I restart the debugging process: r
- I check and continue to debug other parts of the code.
I have one general question, and 3 technical questions:
general question: What do you think of this workflow, how would you optimize it?
technical questions: I am on Mac OS X 10.11, using emacs 25.3 (9.0), and ipython 6.2.1, consequently I need to pass the argument --simple-prompt to IPython to make it work. I think, it creates these problems:
- I cannot use isend with a python line distributed on several lines (long command), so I had to turn off the auto-fill-mode,
- I cannot use completion on defined variables (a HUGE drawback): lets say I define oiseau = "bird" in a previous part of the code, then the ipdb debugger opened by realGUD does not let me complete if I type: oise + TAB
the last technical question:
- debugging pyQt when creating GUI does not seem to work (not central in my work but still disappointing...)