1.3.11 Stepping Into and Through Method Calls

Step Into Lets You Follow a Method Call

You already know that F10 / Step Over can execute a method call without taking you line-by-line through the called method.

When you need to see what happens inside the called method, use Step Into.

A common Visual Studio shortcut is:

Activity diagram showing inside ShowTeamName(), then this player1, then F11 into this.team.DisplayName(), then inside DisplayName(), then this team1.
InsideShowTeamName.
  • New
  • Changed
  • Removed

This makes object-to-object method calls visible.

Use the Call Stack While Stepping

While inside the nested Team method, the Call Stack can show:

Activity diagram showing caller, then ShowTeamName(), then DisplayName().
Caller.
  • New
  • Changed
  • Removed

the return path is:

Activity diagram showing DisplayName() finishes, then ShowTeamName() resumes, then ShowTeamName() finishes, then caller resumes.
DisplayNameFinishes.
  • New
  • Changed
  • Removed

Even void methods return execution to their caller.

They simply do not return a data value.

F5, F10, and F11 Serve Different Purposes

Use:

F5 / Continue

These commands give you different levels of detail.

The Module 1.3 Debugging Story

You can now connect:

Sequence diagram showing sequence diagram, then C# method call, then breakpoint, then F11 into call, then Call Stack shows nesting, then F10 F11 trace statements and calls.
SequenceDiagram.
  • New
  • Changed
  • Removed

That gives you a complete introductory workflow for understanding method execution before parameters and return values are introduced.