English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
How can I treat bits?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-10-04 (12:39)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] replay debugger
[The question was: how does the OCaml debugger implements reverse execution?]

> Y'a t'il de la doc sur le fonctionnement interne du debuggger.
> Comment ca marche ? comment ki fait pour revenir en arriere ?

Like all "time-travel" debuggers: by periodic checkpointing.  That is,
it saves the state of the program from time to time, and uses these
checkpoints to restore the state of the program at any time.  E.g.
say you stop the program and wish to execute it backwards one step.
Find the most recent checkpoint, which was taken N steps ago;
duplicate it, and run one copy N-1 steps forward.

We learnt this trick from Andrew Tolmach's thesis:
The only difference between Tolmach's system and ocamldebug is that
the former uses first-class continuations to capture the checkpoints,
while ocamldebug uses the fork() Unix system call.  Thus, each
checkpoint is really a separate process, and all of them communicate
with the debugger via sockets.

- Xavier Leroy
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr