Tuesday, June 17, 2008

Bookmarks in GDB

When you are debugging a program using gdb you might have come across situations where you might have missed to see what is happening at particular point. But you cant go back to that place in earlier versions of gdb.
With the newer versions of gdb there is a feature called checkpoint in gdb. This is very useful and acts something like a bookmark. This basically takes a whole snapshot of the entire program which you are debugging upto that point including all the variables, files opened, etc. So when you are into a debugging a very big process and finally see that you want to go back to particular place then you can easily go to the saved place.

When you are inside gdb :

checkpoint - creates the checkpoint

restart checkpoint_id - this restores to the saved place.


I also came across one very interesting project is being undertaken by GNU. It aims to reverse a debugging process, i.e, you can go one step back in the debugging. If this feature gets implemented in the future versions of GDB , then it ll be very useful for debugging complex processes and when you realise that you missed out a particular step.
If someone is interested in contributing to this project you can look into : http://sourceware.org/gdb/news/reversible.html



1 comment:

Anonymous said...

Hi, just noticed your post. You might like to check out this product: http://undo-software.com/

Not open source, but it's real. And it's free for non-commercial use. It really works too. :)