Skip to main content

Introdunction

Debugging is an important aspect of IT.
We have to remember to follow the important 6 steps for debugging a problem:

1. The first step is to check that the error is reproducible.
2. Be sure that you know exactly what the problem is.
3. Check all of the “obvious” error sources.
4. Apply basic strategy of debugging:
Isolate the problem by dividing the operation into those parts that are working and those that are not.
"The best approach is to step through the process from BEGINNING TO END, comparing what should be happening with what is happening."
5. When you reach a dead end in debugging, it's time to reassess your info.
Question where wrongful assumptions/conclusions could have been made.
Carefully walk through process again.
Locating the bug can be a hard process.
Locating takes experimentation
6.Walk through process making sure all functions that should be happening are happening.
These 6 steps are very important to follow when debugging a problem on the computer. There is a difference between debugging and troubleshooting.
Troubleshooting: solving a problem, basically an end product of fixing a problem.
AND
Debugging: is the process/steps to solve the problem, such as: removing an error on the computer.
Example: A teacher is having a hard time starting the computer. By following the steps ask the teacher is he/she has the computer plugged in. It so happens that the computer was not plugged in. The process that the IT person took was the debugging process.
Troubleshooting: Figuring out the computer was not plugged in. The final product.

WinDbg Commands

WinDBG Commands

Regular commands : k
Meta command or Dot commands: .cls, .reload .time
Extension Commands: !analyze !locks !teb !peb


Some important commands
!analyze -v : Analyze Exception.
!analyze -hang -v : Analyze Hanging
!gle : Get Last Error
.lastevent : Get Last Exception Event
!sym noisy: While loading symbols display error information.
K: Display call stack
ld*: Load all modules
!for_each_frame: Display call stack Frame number.
.frame N : set “N” Frame as context
.reload /f /v /I : load all modules forcefully with verbose
!teb : Thread Environment Block.
!peb: Process Enviournment block
dt nt!_TEB : full Thread Enviournment Block
~ : Display all thread info
|| : Display Process Info
.sympath: load symbols from server
!handle: Display handle info

Useful WinDbg Commands 


Comments