You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Content/Chapter-11-tricks-and-hacks/debugging-techniques/debugging-techniques.md
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Debugging plays an important role in the process of creating software, which is
11
11
12
12
Visual Studio gives us **a built-in debugger**, thanks to which we can place **breakpoints** at places we have chosen. When it reaches a **breakpoint**, the program **stops running** and allows **step-by-step running** of the remaining lines. Debugging allows us to **get in the details of the program** and see where exactly the errors occur and what is the reason for this.
13
13
14
-
In order to demonstrate the debugger, we will use the following program:
14
+
In order to demonstrate how to use the debugger in VS, we will use the following C# program:
15
15
16
16
```csharp
17
17
staticvoidMain(string[] args)
@@ -33,11 +33,12 @@ In order to start **the program in debug mode**, we choose \[**Debug**\] ->
33
33
34
34

35
35
36
-
After starting the program, we can see that it **stops executing** at line 11, where we placed our breakpoint. The code in the current line **is colored in yellow** and we can **run it step by step**. In order to go to **the next line**, we use the key \[**F10**\]. **We can see that the code on the current line hasn't executed yet**. **It executes when we go to the next line**:
36
+
After starting the program, we can see that it **stops executing** at line 11, where we placed our breakpoint. The code in the current line **is colored in yellow** and we can **run it step by step**. In order to go to **the next line**, we use the key \[**F10**\]. We can see that **the code on the current line hasn't executed yet** and it is displayed in yellow. It will execute when we go ahead with the debugging the next line.
37
+
38
+
The screenshot below shows **the Visual Studio debugger**, stopped at the breakpoint and waiting for the developer to decide what to do (e.g. execute the next command or stop the program):
From the **Locals** window we can observe **the changes in the local variables**. In order to open the window, you must choose \[**Debug**\] ->\[**Windows**\] ->\[**Locals**\].
42
+
From the **Locals** window we can observe **the changes in the local variables** or **modify their values at runtime**. In order to open the window, you must choose \[**Debug**\] ->\[**Windows**\] ->\[**Locals**\].
0 commit comments