from Hacker News

Reverse Debugging with GDB

by mrmaddog on 11/7/13, 10:48 PM with 19 comments

  • by coldcode on 11/8/13, 1:25 AM

    Reverse debugging sounds like putting bugs in. We do that every day already.
  • by fijal on 11/8/13, 9:03 AM

    We (PyPy developers) tried this and it's unusably slow. I don't know how they got that slow, but it takes a bit forever to execute 10mln instructions. We ended up using UndoDB gdb wrapper, which runs slower than they advertise (+- the same speed as valgrind so say 30x give or take), but is a lot more usable. They had stability problems in the past, but with the recent versions, we're able to run stuff like complex python programs on top of pypy on top of UndoDB, which is very impressive. Very useful for hard GC bugs.
  • by bravura on 11/8/13, 7:33 AM

    I have a more modest request:

    Could debuggers please store the code paths and variable values, over the last 50 executions or perhaps the test suite (deterministic)? This is particularly useful for understanding someone else's code.

    [edit: a context-free version of reverse debugging]

    I've recently been enjoying using IntelliJ for Scala, because it can show me types, and jump to type declarations, and usages.

    However, I still have to do a bunch of print debugging when trying to understand someone else's code, because I want to understand what values certain variables take. This is a pain using a compiler as slow as Scala.

    Something that captured relevant information, so that it would be easier + faster to do print debugging against previous code runs or the test suite, would be awesome.

  • by neur0mancer on 11/7/13, 11:33 PM

    I tried it. Unfortunately, it is very slow.
  • by Groxx on 11/8/13, 1:50 AM

    For Java, if it still runs: http://www.lambdacs.com/debugger/

    I really like the idea. Never knew GDB had implemented it (thanks for the link!). I'll definitely try this out :)

  • by martin_ on 11/7/13, 11:25 PM

    I'm assuming this wasn't a big hit as little as been mentioned about it since its release in 2009?
  • by peterhajas on 11/8/13, 9:13 AM

    Cool! Does `lldb` have similar functionality?