From ReactOS Wiki
Revision as of 08:06, 19 December 2014 by Oldman (talk | contribs)
Jump to: navigation, search

A layman's guide - getting a debug log.

A layman's guide to using the Ros debugger to get a debug log. This mini guide assumes that you have got the relevant hardware (cable, second computer with Putty installed) and that you know to start ReactOS in (Debug) mode.

Some vital settings in Putty.

In Category select Session and set the following to these values:
Serial line = COM1
Speed = 115200
Connection type = Serial

Back to Category and select Logging In Session logging: check All session output. Note where Putty saves the log file and change if required.

Save the above changes in putty with a name of your choice (there is a input for this), it can then be loaded the next time.

The ReactOS debugger has some commands that can be used from the command line, they are typed into the ReactOS test computer, but will be viewed in the terminal window (i.e putty) on the second computer, with the exception of Alt+k, which gives you the command prompt and looks like this: kdb:>


Alt+k - this command halts the system so you can enter commands into the debugger.
bt - this command gives a backtrace; use it when the ROS enters the debugger (see below).
cont - this is short for continue.
set condition * first always - this command tells the ROS to enter the debugger on the first exception.

The following is an example of when the ROS enters the debugger:
Entered debugger on last-chance exception (Exception Code: 0xc0000001) (Unknown/User defined exception)

Getting a backtrace:

When ROS enters the debugger, then enter bt at the command prompt, like so: kdb:> bt and press enter on the keyboard. You may see this
--- Press q to abort, any other key to continue ---
If you do see it, then just press any key other than q, it may show again, just repeat until you are back at the command prompt of kdb:>

Getting a more detailed backtrace:

When you see debug info streaming into putty(1), then press Alt+k on your keyboard, then type set condition * first always at the command prompt, then type cont. This will make the ROS enter the debugger on every exception, which it will do many times, and each time you will have to type bt then cont.

(1) If you are testing an app, then it is best to wait until you are ready to run the app before doing this, else you will be overwhelmed with the ROS entering the debugger.


Don't use Alt+k and bt to get a backtrace, when the ROS does not automatically enter the debugger, thinking you are going to get some more useful info for the dev's to work with, which I have done in the past; the info is useless!

Putty names the file putty.log, it would be a good idea to re-name it, because the next time that putty is run, it will over-write the file called "putty.log". I use something descriptive, in this format "app name-Ros revision number", for example "gimp-1.0.4-R65099".