Difference between revisions of "User:Oldman"

From ReactOS Wiki
Jump to: navigation, search
Line 34: Line 34:
 
'''cont''' - this is short for continue.
 
'''cont''' - this is short for continue.
 
<br />
 
<br />
'''set condition * first always''' - this command tells ROS to enter the debugger on the first exception.
+
'''set condition <big><big>*</big></big> first always''' - this command tells ROS to enter the debugger on the first exception.
  
 
The following is an example of when ROS enters the debugger (see also in the <sup><span style="background:yellow">[4]</span></sup> screenshot below):
 
The following is an example of when ROS enters the debugger (see also in the <sup><span style="background:yellow">[4]</span></sup> screenshot below):
Line 50: Line 50:
  
 
=== Getting a more detailed backtrace: ===
 
=== Getting a more detailed backtrace: ===
When you see debug info streaming into putty <sup>[<span style="color:red">1</span>]</sup>, then press '''Tab'''<small>+</small>'''k''' on your keyboard, then type '''set condition * first always''' at the command prompt, then type '''cont''' <sup><span style="background:yellow">[6]</span></sup>. 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'''.
+
When you see debug info streaming into putty <sup>[<span style="color:red">1</span>]</sup>, then press '''Tab'''<small>+</small>'''k''' on your keyboard, then type '''set condition <big><big>*</big></big> first always''' at the command prompt, then type '''cont''' <sup><span style="background:yellow">[6]</span></sup>. 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'''.
  
 
<sup>[<span style="color:red">1</span>]</sup> If you are testing an app, then it is best to wait until you are ready to run the app before setting the condition to first always, else you could be overwhelmed with the ROS entering the debugger.
 
<sup>[<span style="color:red">1</span>]</sup> If you are testing an app, then it is best to wait until you are ready to run the app before setting the condition to first always, else you could be overwhelmed with the ROS entering the debugger.

Revision as of 08:15, 24 January 2015

A layman's guide - How to get a debug log.

This is a layman's guide to using the Ros debugger to get a debug log when ReactOS is started in Debug [1] mode.

Hardware requirements:

  • A test computer with a serial port.
  • A second computer with a serial port and Putty installed (or simular app).
  • A nullmodem cable to contect both computers.

Setting up Putty.

There are some vital settings in Putty which need to be set so that Putty can capture a debug log. In putty go to Category and select Session then 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; use the Browse button for the destination folder.

See in Screenshots [2] [3] below for visual information.

Save the above changes in putty with a name of your choice in Saved Sessions, then use the Save button. It can then be loaded the next time you use Putty, by using the Load button. Note: logging is started by using the Open button.

The ReactOS debugger

The ReactOS debugger has some commands that can be used from the command line; all of the commands are typed into the ReactOS test computer, but will be viewed in the terminal window (i.e putty) on the second computer. To enter a command, press the key combination of Tab+k, which halts the system and gives you the command prompt which looks like this: kdb:> where you can then enter the command.

Commands:

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

The following is an example of when ROS enters the debugger (see also in the [4] screenshot below):
Entered debugger on last-chance exception (Exception Code: 0xc0000001) (Unknown/User defined exception)
kdb>

Getting a backtrace:

When ROS enters the debugger, then you need to enter bt at the command prompt, like so: kdb:> bt [4] and press enter on the keyboard. You may see this
--- Press q to abort, any other key to continue --- [5]
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 Tab+k on your keyboard, then type set condition * first always at the command prompt, then type cont [6]. 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 setting the condition to first always, else you could be overwhelmed with the ROS entering the debugger.

No working keyboard - Not a problem!

Currently (Jan 2015) usb support is problematic, so your keyboard may not work! If you have found that your usb keyboard does not work with ReactOS, you can still get a debug log by down-loading a livecd debug version (example: livecd-66078-dbg.7z) and burning that to a cd/dvd. It currently defaults to Debug mode, so when it boots, it will output debug info to the serial port, but you will not be able to get a backtrace!

The bootcd debug version (example: bootcd-66078-dbg.7z) defaults to a no debug mode, so do not use it, use only the livecd debug version, if you want to get a debug log. See [7]

Advice:

Don't use Tab+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".

Variations

RosDbg - This is only useful when ReactOS is compiled with a Microsoft compiler, which adds extra debugging code into Ros, which can output extra debug info. In use the difference is in the keyboard input where you can only use Tab + k on the Ros test computer, all other keyboard input is via the logging computer's keyboard.

Screen - In this mode, debug information is written to the screen and you will have to take photos to be able to submit the information in a Jira Issue. Any keyboard input is done on the Ros test computer keyboard.

Log file - This writes all debug output to a file on the Ros test computer's hard drive. Any keyboard input is done on the Ros test computer keyboard. You may, also need to use a Linux livecd to be able to recover the log file from the test computer.

Screenshots (a picture is worth a thousand words)

A layman's guide - How to create a Jira Issue for your bug.

Go to the jira page (https://jira.reactos.org/secure/Dashboard.jspa) by clicking on the Bugtracker link on the navigation bar at the top of most pages. If you successfully followed the link you should now be at the Dashboard page of ReactOS JIRA, on the right side of the page [1], you should see a login form (there is also a login link in the top right of the page, which will open another page with a log in form), just use your forum username and password.

Note: If you have only just created an account for the forum, you may find that you cannot log into Jira, if that as happened to you, you will have to wait a few days and try again. There is also something else that you could try; go to the ReactOS.org front page and log out, then log in, go back to the Dashboard page of ReactOS JIRA; now try logging in again.

When you have logged in, the next thing to do, is a search to see if your bug has been reported already. Use the Quick Search box at the far right of the navigation bar.

To create a bug report (called an Issue in Jira), click on the "+ Create Issue" on the navigation bar at the top [3], which will open a Create Issue form [4].

Give a short description of the problem in Summary (this with be the title of the report).

Put your computer specification (or VM) in Environment.

In Description describe what happens and how to replicate the problem and the revision number where it occurred (include the down-load link to any software) .

If you get a debug log or take a photo or video, use the Browse button in Attachment to upload it.

That is all you need to fill in, leave the rest to the developers. To submit your report, click on the Create button in the bottom right of the form.

Screenshots (a picture is worth a thousand words)

Adding more debug logs, photos and videos.

Having created a Jira Issue for your bug, you have a need to add another debug log, photo or video.

Go to ReatOS Jira and log in. Then go to the Issues [2] page and select Reported by Me [5] and your Issues will be shown. Select the Issue you want to add more to. Then use either the Attach Files [6] link on the menu bar that is just below the report name, or further down at Attachments [7], the plus sign. Both will open the Attach Files form [8], where you will need to use the Browse button to upload your files, the Comment box to describe the attached file(s) and any further information about the Issue you wish to add, then use the Attach button at the bottom of the form, to attach it all to the report.

If you only want to add more information, or to reply to a question from a developer, use the Comment button at the bottom left of the page, which will open a Comment box. When you have finished writing in the Comment box, use the Add buttom (which is where the Comment button was) to attach it to the report.

Screenshots (a picture is worth a thousand words)

oldman - 23 January 2015