
Review: UndoDB, a reversible debugger - jsnell
http://blog.jwhitham.org/2015/05/review-undodb-reversible-debugger.html
======
pron
The JVM has a few such reversible/omniscient/recording debuggers. A couple of
open-source ones --
[http://www.lambdacs.com/debugger/](http://www.lambdacs.com/debugger/),
[http://pleiad.dcc.uchile.cl/tod/download.html](http://pleiad.dcc.uchile.cl/tod/download.html)
\-- and a couple of commercial ones --
[http://chrononsystems.com/](http://chrononsystems.com/),
[https://www.takipi.com/](https://www.takipi.com/) \-- the last one is
designed to impose very low overhead and run constantly in production.

I've used the first (the Omniscient Debugger) quite a few times. It has a
query language that allows you to query for events throughout the duration of
the program (e.g. 'x is assigned a value > 1 while y < 10'). Unfortunately, it
can only record a few seconds of the program (it uses a cyclical in-memory
buffer). The other debuggers supposedly record to disk and can record longer
durations.

~~~
lemming
Takipi is actually a little different, since it looks like it just catches
errors and records the whole local stack state at the time of the error.
Useful, but it's not a full back-in-time debugger.

I'm actually interested in adding something like this to Cursive for Clojure
code - I'd be interested to see whether immutability results in smaller trace
captures. I suspect Clojure would make up for that with much deeper function
call stacks. Datomic could be a nice interface for querying the events, too.

~~~
seanmcdirmid
Immutability would probably make the traces larger since it would be much
harder to do delta compression (what has changed since the last check
point...uhm...nothing and everything!).

~~~
lemming
I'm not sure how many of these systems actually use checkpoints - I believe
that ODB just records a stream of events. I'm not sure how easy it would be to
store events that take advantage of the structural sharing of Clojure's data
structures - probably quite tricky.

~~~
seanmcdirmid
The one in this post does, it seems.

------
pm215
If you want an actually usably fast Free Software reversible debugger, I
recommend giving rr a go ([http://rr-project.org/](http://rr-project.org/)).
It works by record-and-replay, and you can do step-backwards in the replay
part. It's not perfect yet, but you can use it for serious work on complex
multithreaded programs; I've used it for debugging QEMU bugs. I'm optimistic
that this will become part of the standard open source C/C++ development
toolkit in the same way that valgrind did.

------
ganarajpr
I wish there was a reversible debugger for browsers. Would really love to have
something like this ( perhaps something like a time travelling debugger like
what elm gives is even better! ). Does anyone know of such a project for the
browsers ?

~~~
cheepin
From a previous blog post from someone on the Chrome team (that I cannot
find), the debug build is unusable slow. Browsers are monstrously complex[0],
and it would have to somehow deal with the complexities of multithreaded
execution. Not impossible, but almost assuredly adds a performance overhead to
an already slow debug build.

[0] The oft sited string allocations per keystroke:
[https://groups.google.com/a/chromium.org/forum/#!msg/chromiu...](https://groups.google.com/a/chromium.org/forum/#!msg/chromium-
dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ)

------
justincormack
I was also quite excited by gdb's reverse debug feature but found it unusably
slow.

------
k4st
I use this frequently and it's pretty awesome. The killer combination for me
is usually to set a hardware watchpoint, then reverse-continue. This is super
useful when you've got a bit of memory corruption (e.g. buffer overflow) but
don't know what's causing it.

------
stevelaz
This looks great! I'll be downloading the trial for sure. I wonder if it'll
work with gdbserver for remote target debugging? UndoDB's site says it works
for Android, but they mention that it's native Android not remote. Anyone have
any experience with that?

~~~
cgdae
UndoDB comes with its own internal replacement for gdbserver called undodb-
server; you can do remote debugging by running undodb-server manually on the
target machine and connecting to it from within undodb-gdb. The README has an
example.

[Disclaimer: i work for Undo.]

------
padator
Seems similar to what ocamldebug does in ocaml (which itself was copied from
the SML debugger).

