Using ipdb with emacs' gud without explicit breakpoints in code

前端 未结 1 1516
鱼传尺愫
鱼传尺愫 2021-02-05 15:05

I\'m using python.el If I choose \'debugger\' from the menu, and enter \'python -m pdb myfile.py\', gud starts, and in a split frame I see the (Pdb) prompt in one, and my python

相关标签:
1条回答
  • 2021-02-05 15:26

    The basic problem here is that gud is looking for a (Pdb) prompt and ipdb doesn't prompt this way. There are three ways to fix this: fix ipdb to give a (Pdb) prompt, fix gud not to need to look for (Pdb) or (my favorite) use something else either on the gud side or on the ipdb side.

    The problem with fixing up gud is that it is rather old and to my mind a bit creaky using global variables and not making use of Emacs Lisp data structures available other than lists and cons cells. A total rewrite of gud is called realgud, it is currently in MELPA and ELPA. And ipdb is supported.

    The last option is to use something else, so let me suggest the Python trepan debugger which is already integrated into realgud (but not gud since I consider that a dead end). Although the backtraces it gives are not exactly like ipdb's, it does colorize them and the source code.

    And recent versions of trepan3k backtraces will even show, on demand, you where in the line you are. So if you had say two calls of a function, like fib() it would distinguish which of the calls function was the one in progress.

    0 讨论(0)
提交回复
热议问题