Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Debugging - Operating System Design and Implementation - Lecture Slides, Slides of Operating Systems

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

2013/2014

Uploaded on 02/01/2014

sashie
sashie 🇮🇳

4.2

(40)

185 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
15-410, F'13
1
Debugging
Sep. 9, 2013
Dave Eckhardt
Dave Eckhardt
Todd Mowry
Todd Mowry
L06a_Debug
15-410
“Experience is what you get...
...when you don't get what you want.”
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Debugging - Operating System Design and Implementation - Lecture Slides and more Slides Operating Systems in PDF only on Docsity!

15-410, F'

Debugging

Sep. 9, 2013

Dave Eckhardt

Dave Eckhardt

Todd Mowry

Todd Mowry

L06a_Debug

“Experience is what you get...

...when you don't get what you want.”

15-410, F'

What is “Debugging”?

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'

Telling Your Story

When I install my keyboard handler...”

When I install my keyboard handler...”

What do you really hope?

15-410, F'

Telling Your Story

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'

Matching Phenomena to the Story

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'

Measuring

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'

Measurement Techniques

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'

Asking for Help

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'

Summary

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