DEV Community

Cover image for Debug controllers and debug flow in VSCode
Gleb Krishin
Gleb Krishin

Posted on

5 3

Debug controllers and debug flow in VSCode

Hey, hey πŸ‘‹ After we have learned about how to configure our debugger, let's talk more about the actual debugging controllers πŸ•Ή

Breakpoints

We will put some breakpoints
Button component with breakpoint
As you see, we put a breakpoint on line 12, so we will be able to receive a context of our props.
After that, you restart the page and see in the run & debug section of the VSCode the following structure. We will talk more about this section later.
Run & Debug menu in VSCode
On your screen, near the breakpoint will appear a yellow outline, which means that your code stopped its execution at this line
Stop execution on a breakpoint
We will also get controllers:
Debug controllers VSCode

  1. Continue – An action to take in the debugger that will continue execution until the next breakpoint is reached or the program exits.
  2. Step over – An action to take in the debugger that will step over a given line. The function will be executed if the string contains a function, and the result is returned without debugging each line.
  3. Step In – An action to take in the debugger. If the line does not contain a function, it behaves the same as "step over" but if it does, the debugger will enter the called function and continue line-by-line debugging there.
  4. Step out – An action in the debugger that returns to the line where the current function was called.
  5. Restart
  6. Stop

Controller demo

Continue

With "Continue", we can resume debugging to the next breakpoint you put previously.

Step over

"Step over" functionality helps us to go to the following execution line without putting a new breakpoint.

Step in

"Step in" gives us a superpower to traverse up&down in a function execution and see the function's return values in a variables section.

Step out

I'm happy that we're now familiar with essential debugging tools and ready for a new journey to something more advanced! πŸš€πŸš€πŸš€

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (2)

Collapse
 
dt_reshape profile image
dt-reshape β€’

Great and most importantly detailed guide!

Collapse
 
dealwith profile image
Gleb Krishin β€’

Thanks for the feedback !

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay