# Debugging the Debugger Debugging the debugger is one of the highest levels of inception. Before you begin, prepare yourself for a mind-bending trip of self-discovery. ## Playing with the Debugger Set up the debugger so that your environment looks like this [gif][debugger-intro-gif]. If you have any questions, go back to the [_Getting Set Up_][getting-setup] instructions. Now that you have the debugger ready, play around with it. - Use the debugger and get comfortable with how it works (from a user perspective). - Identify the different components and panes (e.g. the sources pane, editor, right sidebar, etc.). - Review the code and identify the presentation layer with React, the interaction with Redux, and the client's data. ## Design a New Theme :snowflake: Let's design a new theme for the debuggerâdon't worry, it's not so hard! **Goals** - Style the source tree, the editor, and some other UI components. **Hints** - Don't forget to read about the [themes](local-development.md#themes). - Remember that each component has its own CSS. - Keep in mind that there is a CSS file for variables: ~/debugger/node_modules/devtools-mc-assets/assets/devtools/client/themes/variables.css - Take a look at the "reps"â a set of rules for the debugger! **Next Steps** Share a screenshot of your theme! Here's an example: * [Camo theme][camo-theme] designed by [@jasonlaster](https://github.com/jasonlaster). ## Make Your Breakpoints Dance :dancers: Adding a breakpoint is a critical piece in the inception game. **Goals** - Make the debugger do something special whenever a breakpoint is added. **Hints** You can find the file that handles breakpoints here: `/debugger/src/components/Editor/Breakpoint.js`. Once you have the file open in your editor, go ahead and find (Ctrl-F) "addBreakpoint". This should pull up the `addBreakpoint` function, which (surprise!) adds a breakpoint. Next we are going to add an alert, so that we can see that we're triggering the right code: ```javascript addBreakpoint() { const { breakpoint, editor, selectedSource } = this.props; // Hidden Breakpoints are never rendered on the client if (breakpoint.hidden) { return; } //Add the code below alert("Your first breakpoint! Congratulations!"); // NOTE: we need to wait for the breakpoint to be loaded // to get the generated location if (!selectedSource || breakpoint.loading) { return; } ``` This will cause a popup to appear whenever we create a breakpoint. **Next Steps** Use your imagination! What should your version of the debugger do whenever a breakpoint is added? ## Pausing FTW :red_circle: When the debugger pauses, the fun begins! Here's a [gif](http://g.recordit.co/qutDioRQvy.gif) of what the debugger does normally when it pauses. **Goals** - Add logic on the pausing event. **Hints** Here's some example code that can help you get started: The file `debugger.html/src/components/SecondaryPanes/Frames/WhyPaused.js` renders the reason for the pause in the sidebar, and the file `/debugger.html/src/utils/pause/why.js` is used in several places to expose the current paused state. **WhyPaused.js** (Starts at line 42): ```javascript export default function renderWhyPaused({ pause }: { pause: Pause }) { const reason = getPauseReason(pause); if (!reason) { return null; } //Add the code below: console.log("Hello from src/components/SecondaryPanes/Frames/WhyPaused.js!"); return (