How to make pdb recognize that the source has changed between runs?

Posted by user88028 on Stack Overflow See other posts from Stack Overflow or by user88028
Published on 2009-04-07T10:09:09Z Indexed on 2010/04/15 17:53 UTC
Read the original article Hit count: 248

Filed under:
|
|

From what I can tell, pdb does not recognize when the source code has changed between "runs". That is, if I'm debugging, notice a bug, fix that bug, and rerun the program in pdb (i.e. without exiting pdb), pdb will not recompile the code. I'll still be debugging the old version of the code, even if pdb lists the new source code.

So, does pdb not update the compiled code as the source changes? If not, is there a way to make it do so? I'd like to be able to stay in a single pdb session in order to keep my breakpoints and such.

FWIW, gdb will notice when the program it's debugging changes underneath it, though only on a restart of that program. This is the behavior I'm trying to replicate in pdb.

© Stack Overflow or respective owner

Related posts about python

Related posts about pdb-ms