DEBUG CONTROL
Unit 03.1
Debug Control
Contents
01
Download
3
02
Run / Stop
4
03
Step and Run Until
5
03.1 Step to the next code line
6
03.2 Step (into)
7
03.3 Run Until
8
03.4 Run Until Return
9
Download
01
After the CPU Reset is operational, the next step is to download the executable code and the belonging debug information to the CPU. Once this is done, you can start exploiting functionalities such as Run Control and various Debug windows providing focused insight into the CPU and the executing application.
It is pressumed that winIDEA Examples are in use, therefore a download file is not a neccessary step at this point.
Perform download:
1. From the Debug toolbar select the Download button or
2. Select Download (2) from Debug menu/Run Control or
3. Use CTRL+F3 shortcut.
After downloading the code into your
embedded Target board, the Project workspace and Symbols window show the content: Modules (Source files),Types (Data types), Functions, Globals (Global Variables).
Introduction to BlueBox and winIDEA / Unit 03.1 / Chapter 01 / Download 3
1
2
If you wish to start debugging with you own application, follow the steps in Tutorial Download Files and prepare your own files for download.
Run / Stop
02
While you are debugging, the CPU can be in Run or Stop state.
1. Run debug command starts or resumes the execution of the application which
continuous until the application is stopped, a breakpoint is hit or other exception or event occurs.
2. Stop debug command stops the
application execution. When the CPU stops, all debug windows are refreshed and provide insight into the current CPU
and application state.
Choose debug commands Run or Stop from
the Debug menu/Run Control (1) or click on the Run or Stop buttons (2) in the toolbar. The CPU state is displayed in Debug Status bar at the bottom right corner of winIDEA.
Introduction to BlueBox and winIDEA / Unit 03.1 / Chapter 02 / Run Stop Mode Debug Session 4
1
2
1
Step and Run Until
03
Debug toolbar allows you to easily operate
with Step and Run/Stop. Step:
1. Step – F11/F10 – Step to the next
statement.
2. Step (into) – F11 – Step into a function.
Run/Stop:
3. Run Until – CTRL+F10 – Run the program
until the current or specified position.
4. Run Until Return – SHIFT+F11 – Run until
current function exists.
5. Commands are accessible also from View
menu/Run Control menu.
Introduction to BlueBox and winIDEA / Unit 03.1 / Chapter 03 / Step and Run/Stop 5
1
2
3
4
Step to the next code line
03.1
Introduction to BlueBox and winIDEA / Unit 03.1 / Chapter 03.1 / Step to the next code line 6
Step enables line-by-line code execution and examining variables and content changes. 1. Starting point – CPU is stopped.
2. Hit F11 or F10 (depending on the content of the code line), to move to the next code line.
3. CPU stops at the next possible code line. Depending on the type
Functions for debugging (Breakpoints and Run/Stop) can be used and observed as well in the Disassembly Window.
1
2
Step (into)
03.2
Introduction to BlueBox and winIDEA / Unit 03.1 / Chapter 03.2 / Step (into) 7
Step (into) can be used together with a function call to step inside the source code of the associated function (if available).
Example:
1. Starting point – CPU is stopped. 2. Hit F11 to step into the function.
3. Continue at the beginning of the function.
Keep in mind: Stepping into a function
may open a new source document if the called function is not in the same document you are currently working in.
1
2
1
3
Run Until
03.3
Introduction to BlueBox and winIDEA / Unit 03.1 / Chapter 033 / Run Until 8
Run Until executes the program from the current execution point until the selected line in the code.
Setting a point until where you want
to execute the code can be accomplished in two ways.
Example:
1. Set cursor to a line you want to run until. 2. Hit CTRL+F10 to run until the chosen position.
3. The CPU executed the code until the line where cursor was set.
Alternative:
Run Until can be executed with right-clicking within the Editor Window or the Disassembly Window and chose Run Until from the
context menu.
2
Run Until navigates you to the next
breakpoint or the cursor position depending in which one is next in the program execution flow.
5
4
3
Run Until Return
03.4
Introduction to BlueBox and winIDEA / Unit 03.1 / Chapter 03.4 / Run Until Return 9
Run Until Return executes the applicaton
until the current function exit point.
Example:
1. Starting point – the CPU is
stopped on a function to be
executed.
2. Hit F11 to step into the function.
3. CPU enters the function and stops.
4. Hit SHIFT+F11 to run until the end of
the function.
5. CPU stops on the function exit point.
2
Run Until Return is useful
when inspecting the execution of the first few lines of a function using the
Step debug command and then executing
the rest of the function in one run.