







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This lecture is from Operating System Design and Implementation course. Its key words are: Debugging, Plot Summaries, Critical Question, Pinpointing Problempinpointing the Problem, Measuring, Measurement Techniques, Debugger, Writing Codewriting Code
Typology: Slides
1 / 13
This page cannot be seen from the preview
Don't miss anything!
15-410, F'
Dave Eckhardt
Dave Eckhardt
Todd Mowry
Todd Mowry
L06a_Debug
15-410, F'
Debugging is resolving a clash between stories
Debugging is resolving a clash between stories
Your hopeful story of achievement
The world's sad tale of woe
The stories look alike!
The stories look alike!
At the beginning, they both start with main()...
Key step: finding the divergence
Stories are fractal
Stories are fractal
You can zoom in on them and get more detail each time
The divergence is typically a tiny detail
●
You will need to zoom in quite a lot
15-410, F'
When I install my keyboard handler...”
When I install my keyboard handler...”
What do you really hope?
15-410, F'
When I install my keyboard handler...”
When I install my keyboard handler...”
What do you really hope?
Hardware notices key press/release
Hardware posts interrupt
CPU recognizes interrupt as keyboard interrupt
CPU responds to (vs. ignores) keyboard interrupt
CPU stores trap frame
CPU vectors through your IDT entry
Your wrapper is run
Wrapper calls C code
C code does ...
15-410, F'
Keypress
Keypress ⇒
crash” tells you quite a bit
crash” tells you quite a bit
✔ Hardware notices keyboard event
✔ Hardware posts interrupt
✔ CPU recognizes interrupt as keyboard interrupt
✔ CPU responds to (vs. ignores) keyboard interrupt
? CPU stores trap frame
? CPU vectors through your IDT entry
? Your wrapper is run
? Wrapper calls C code
? C code does ...
What now?
What now?
15-410, F'
How can you
How can you measure
measure the other steps?
the other steps?
? CPU stores trap frame
? CPU vectors through your IDT entry
? Your wrapper is run
? Wrapper calls C code
? C code does ...
15-410, F'
Writing code
Writing code
Breakage of a complex data structure is, well complex
Probably need code to check invariants
Doing it by hand is fun at most once
15-410, F'
Plot summary” is not enough
Plot summary” is not enough
We probaby have no idea what's wrong
Really!
Please see “triple fault” web page
You should always have a measurement plan
You should always have a measurement plan
What is the next thing to measure?
How would I measure it?
You may reach the end of your rope
You may reach the end of your rope
Some things are genuinely tricky to debug
Things in this class may occasionally qualify
This is a good learning experience
15-410, F'
Debugging is about reconciling two stories
Debugging is about reconciling two stories
“Plot summaries” aren't stories (you must zoom in)
“If you don't know where you are going, you will wind up
somewhere else.” — Yogi Berra
Measure multiple things, use multiple mechanisms
Measure multiple things, use multiple mechanisms
You should “always” have a next measurement target
You should “always” have a next measurement target
When you see us, bring a long story
When you see us, bring a long story
...which you will naturally be an expert on the first part of
Try to know why each register has the value it does