Search code examples
pythondjangogdbreverse-debugging

Is it possible to use GDB's reverse debugging with Python? How?


I am trying to use GDB's reverse debugging with a Django application. I get it running in GDB, but I can't make it run backwards.

I stopped my Django app with Ctrl-Z and then entered reverse-next at the gdb prompt, getting the error message "Target multi-thread does not support this command."

Am I doing it wrong? Isn't this possible? Both?


Solution

  • Before you can use GDB for reverse debugging, you must tell it to record your program execution (so it can play it back) via target record command, as documented here.

    I am not sure this will help you debug your Django application though -- GDB is well suited for debugging "native" code (compiled C/C++), and is not well suited for debugging "interpreted" code (in either forward or reverse direction).