Monday, May 16, 2011

Remember, Remember ... The History of Debugging

Debugging your application can be an intriguing task. And analyzing what happens in your application, and what went wrong (or maybe right), often requires the developer to keep an eye on quite a lot of data.
Sometimes that means not only to look at the data as it is on the current step of execution, but also to compare it to what it was on the previous step(s).

Lazarus does now provide a history overview for watched values, locals, and call-stack. Each time your application stops, a record of this data is made and stored.
By default Watches and Locals are recorded for the current stack-frame/thread. But if you browse other frames or threads by selecting them in the stack or threads overview windows, then Lazarus will notice this and keep track of those too.

A new debug window "History" provides access to all recorded values. Currently this is up to 25 history entries. And you can even browse the history after you program terminated.
If you have a history entry selected, you can use the stack-window to change the current stack. If any data was collected for the selected frame, it will be shown. Currently data for extra stack frames is only collected if the frame was selected, while your app was running, and if the watches or locals window where open and active.

There is however a little twist to it. Collecting all the data takes some time. To avoid any slowdown of the debugger, this new feature works on idle time only. It collects data, only if the debugger has no other work. This even means that you can continue the execution of your application, without having to wait the full time it would have taken to get all the data. In this case the snapshot will be incomplete.
If you want to ensure complete snapshots, you can open the watches, locals and stack window, and observe when the information has been fully fetched, as it gets displayed to you.

This feature is available in Lazarus 0.9.31


RC said...

Hey guys, I've just downloaded Lazarus today, and I'm TOTALLY IMPRESSED !!! I couldn't believe how great it is !! Keep doing good job !

Lauraine said...

Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
Android apps development| Google android app development|

asif said...

very nice thanks for sharing

hey friend see snow on google
Type “Let It Snow” on @Google If you click and drag you can wipe the snow away. It is great. source:

farhan said...

This was a nice post and I think it is pretty easy to see from the other comments as well that this post is well written and informative. Thanks a lot.

Nashev said...

... and it's stil very far to GDB 7

Unknown said...

Nashev, Lazarus uses GDB 7 for debugging.