New in Haiku: Debugger is now default

Blog post by nielx on Mon, 2012-12-24 08:44

Just a few days ago, Rene Gollent switched on the Haiku debugger as the default debugger. Starting from revision 45032, whenever an application crashes, you will now get the option to debug it in Haiku's debugger. This milestone is important because it marks Haiku's debugger as ready for general use. Before Haiku used the command line tool gdb, which is very good but also very user unfriendly if you are used to a descent GUI debugger.

What changed?

Whenever an application crashes, you will see this dialog:

Debug dialog

If you click on the Save Report button you will be able to save a debug log to a text file, which you can attach to bug reports. If you click on the Debug button, instead of going to gdb, you will now open Haiku's Debugger:

Debugger window

Authors & code

Initial work on the debugger was done by Ingo Weinhold. Recently, Rene Gollent worked hard on getting the debugger into shape and getting it ready for release quality.

The debugger itself can be found at src/apps/debugger. The kernel support for debugging can be found at src/system/kernel/debug. There is a debug server that runs in the background and monitors which applications have crashed, and if so enables Debugger to take it over. It can be found at src/servers/debug.

Comments

Re: New in Haiku: Debugger is now default

Yay!
Awesome work.

Re: New in Haiku: Debugger is now default

Thanks a lot, Rene and Ingo!

Re: New in Haiku: Debugger is now default

I always knew that santa really does exist, finally this year he is in time :-)

Re: New in Haiku: Debugger is now default

I was mainly just aiming/hoping for getting to this point by end of year, it was more or less luck that I managed by Christmas. I promise I look nothing like Santa in any case. :) More seriously, enjoy and hope it helps people!

Re: New in Haiku: Debugger is now default

I am curious! Was this new debugger needed before Haiku could enter beta phase? If not, well it could not hurt, could it? This trully is an awesome feature that Haiku and her users have been waiting for for so long!

Kudos to Ingo and Rene for making this possible!

Re: New in Haiku: Debugger is now default

No, the debugger being ready was more of a "nice-to-have" thing than a beta/R1 blocker. To my knowledge the main feature missing as far as beta is concerned is the package management, which should be dealt with by the upcoming contracts.

Re: New in Haiku: Debugger is now default

In the Screenshot it says "Source file unavailable". How can you attach the source code?

TBH, I have to disagree that this debugger is more user-friendly than gdb. At least for gdb there is a man page and extensive documentation on the net. I tried the new debugger a while ago and couldn't really use it.

Re: New in Haiku: Debugger is now default

The "Source file unavailable" there refers to code that has not been compiled with debug support. Neither gdb nor anything else will be able to do much for you there beyond raw memory dumps and such. For code that's been appropriately compiled, however, if the source file wasn't locatable on disk based on the path specified in the debug information, the message there will indicate the aforementioned path as well as telling you to click there to help locate it which will present you with a corresponding file panel.

Re: New in Haiku: Debugger is now default

Is it possible to install and invoke the Haiku debugger in Alpha4? Or is a current nightly required?

Re: New in Haiku: Debugger is now default

I want to inspect the value of a variable at runtime. How can I set a breakpoint to do so?