How Debuggers Work

Recently one of my colleagues asked me this question on the way back to home from office – “How do you design a debugger?”. We had some interesting discussions, made some assumptions on the support from OS, thoughts on what would happen in different approaches. I got this question at the back of mind and tried to find an answer and came across this site which has 3 parts that explains “How Debuggers work”. Though I haven’t read the articles completely [looks really geeky :)], I felt its worth sharing. In case if some one is curious like me to know about the topic, the below links might help

http://eli.thegreenplace.net/2011/01/23/how-debuggers-work-part-1/

http://eli.thegreenplace.net/2011/01/27/how-debuggers-work-part-2-breakpoints/

http://eli.thegreenplace.net/2011/02/07/how-debuggers-work-part-3-debugging-information/

In case if any one finds anything simpler or good guides on the topic do let me know.

Next thing to know is “How does a code profiler work?”

Thanks!

The Monkey Story

Its been an year since I last blogged. Got busy building some cool stuff here at Microsoft!

Recently I came across this story from one of the senior guys – “The Monkey Story”.

This discussion started when we were talking about how “Beliefs lead to Actions lead to Results”. So the story is :

Some guys did an experiment with monkeys. There is a monkey in a room and a banana is hanging from the ceiling. There is a ladder to climb and get the banana. The monkey raced to the banana and ate it. Then there was a second banana placed on the ceiling, the monkey again climbed to get the banana. This happened the same with a 3rd banana as well. The fourth time, when the monkey started climbing the ladder, the monkey was sprayed ice-cold water, the monkey ran down. When the monkey tried again, it was again sprayed with cold water. Same happened the third time. Now the monkey learned a lesson whenever it climbs the ladder something is going to happen, so no banana.

After some time a second monkey was released into the room, this second monkey saw the banana hanging on the ceiling and obviously tries to get it. As soon as the second monkey starts climbing the ladder, the first monkey drags it down. Assuming the monkey cannot talk to each other but just express saying something wrong can happen. The second monkey now starts believing that something wrong happens when it climbs the ladder but it doesn’t know what. After a while a third monkey is released into the same room. This third monkey doesn’t know anything about cold water and all that stuff. When the third monkey tries to climb the ladder, the other two monkeys drag it down. Now this third one becomes cautious and starts believing something happens when we climb the ladder.

Now the first monkey is taken out of the room and a fourth monkey is release into the room. The second and third monkey doesn’t know what happens if they climb the ladder except a belief they shared from the first monkey that something happens. When the fourth monkey tries to climb the ladder the other two in the room drag is down.

The story resembles many things in your daily life as well. You do not do certain things because you were told by some one not to do. One day if some on asks you why?, you don’t have a good answer to say, except the fact to share someone else told you this. Similarly is the case with many organizations as well – over years of time companies develop routines, habits and practices, which you can call “Organisational culture”.

A new monkey’s (probably a new employee, your children etc) question of the way we do things round here might actually be a valid one. Watch out! 🙂