Showing posts with label debugger. Show all posts
Showing posts with label debugger. Show all posts
Saturday, May 10, 2014
(De-) Bug wars - A new hope
"This are not the bugs you are looking for"
Well hopefully in future it will get easier to find those parts of your code, that joined the dark side.The Lazarus Team is currently working on improving the Debugger in the IDE. And not just improving, but adding an all new shiny debugger.
In fact not just one either.
Here is what we are currently working on. In future we will offer 3 kind of debuggers in the IDE.
- The existing gdb based debugger: "GdbmiDebugger".
And it's variations for gdbserver, and gdb over ssh.
We will continue to maintain them, as they support additional targets (arm, powerppc, ...) that the new debuggers do not (or not yet) have. - A gdb free debugger: "FpDebugger".
This is still in its very early alpha stage. So far it will be for Intel targets only. And initial work concentrates on supporting Mac (which no longer comes with GDB, and urgently needs a replacement), and Windows 32 bits. But Win64 and Linux are planned too. - A hybrid: "FpGdbmiDebugger".
Like the existing GdbmiDebugger it uses GDB. In fact it inherits much of the functionality from GdbmiDebugger.
But it will have its own routines to evaluate watches itself (without GDB). So it will be able to deal better with Pascal data. As a side effect watch evaluation will also be faster.
Other debugging tasks, such as running or stepping the exe, and handling breakpoints are handled by the GdbmiDebugger code using GDB.
But why this one at all?
The same watch evaluation is available when using FpDebugger?
Well, with FpGdbmiDebugger being GDB based, it will be easier to support more of the targets that GDB can support (like arm). It will still need some additions (e.g. a reader for arm executables, to read debug info) in order to do this. And FpGdbmiDebugger also has the potential to be extended to be gdbserver based and support remote debugging in future.
The progress of FpGdbmiDebugger can be watched on its wiki page: FpGdbmiDebugger on our wiki.
A page for FpDebugger does not yet exist.
The two new debuggers are developed in our SVN version (1.3). And if all goes to plan, then they will be part of Lazarus 1.4 (Probably sometime in 2015)
May Pascal live long and prosper (Oops wrong source).
May the force be with Pascal.
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
Subscribe to:
Posts (Atom)