How to do bidirectional or reverse debugging of programs?

前端 未结 11 2025
南方客
南方客 2020-12-02 21:29

Has anyone actually used a reversable debugger? The only product that Google turns up is UndoDB. It is for apparently for Linux only.

相关标签:
11条回答
  • 2020-12-02 22:06

    The newly released gdb-7.0 includes reverse debugging capability for native linux x86 and x86_64. You can debug any linux program as usual, turn on the "recording" feature, and from that point on, if you step forward too far, you can step backward or reverse-continue to a breakpoint.

    0 讨论(0)
  • 2020-12-02 22:07

    Mozilla rr open source trace based reverse debugging

    https://github.com/mozilla/rr

    It is similar to UndoDB, but free and open source.

    Only works on Linux x86 unfortunately, because such tools require advanced OS features to work efficiently.

    Here is a minimal example of rr in action: How to go to the previous line in GDB?

    0 讨论(0)
  • 2020-12-02 22:09

    Although this question is old, reverse-debugging remains an interesting topic, so I thought I'd post an updated answer. My thesis, Combining reverse debugging and live programming towards visual thinking in computer programming, covers some of the historical approaches, and explains the difference between omniscient debugging and true reverse debugging:

    The computer, having forward-executed the program up to some point, should really be able to provide us with information about it. Such an improvement is possible, and is found in what are called omniscient debuggers. They are usually classified as reverse debuggers, although they might more accurately be described as "history logging" debuggers, as they merely record information during execution to view or query later, rather than allow the programmer to actually step backwards in time in an executing program. "Omniscient" comes from the fact that the entire state history of the program, having been recorded, is available to the debugger after execution. There is then no need to rerun the program, and no need for manual code instrumentation.

    Software-based omniscient debugging started with the 1969 EXDAMS system where it was called "debug-time history-playback". The GNU debugger, GDB, has supported omniscient debugging since 2009, with its 'process record and replay' feature. TotalView, UndoDB and Chronon appear to be the best omniscient debuggers currently available, but are commercial systems. TOD, for Java, appears to be the best open-source alternative, which makes use of partial deterministic replay, as well as partial trace capturing and a distributed database to enable the recording of the large volumes of information involved.

    Debuggers that do not merely allow navigation of a recording, but are actually able to step backwards in execution time, also exist. They can more accurately be described as back-in-time, time-travel, bidirectional or reverse debuggers.

    The first such system was the 1981 COPE prototype ...

    0 讨论(0)
  • 2020-12-02 22:10

    Yes, I've used it back in the 90th.. The Watcom C Debugger (understood FORTRAN and most other languages as well) had the option to let you step back and forward in time.

    It's great, but not a big new thing...

    0 讨论(0)
  • 2020-12-02 22:12

    VS 2010 is supposed to have something like this, I think.

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