.. _sec-rov:

Runtime Object Viewer
=====================

Debuggers may include the Runtime Object Viewer (ROV) plug-in that provides
insight into the current state of FreeRTOS, including task states, stacks, and
so forth.

This section discusses some ROV views useful for debugging and profiling.

Viewing the State of Each Task
------------------------------

.. XXX BLE only example with reference to ICall

The Task ``Detailed`` view is useful for seeing the state of each task and its
related runtime stack usage. This picture below shows the state the first time the
user-thread is called. 

.. _fig-rov-task-detailed:
.. figure:: /debugging/resources/rov_task_detailed_cc2340.png
    :align: center

    ROV Task Detail View

The following table explains the column in :ref:`fig-rov-task-detailed`

.. _table-task-detail:
.. table:: Task Detail View Item Explanation

    +----------------------+-----------------------------------------------------------------------+
    |     Address          | The memory location of the ``Task_Struct`` instance for each task.    |
    +----------------------+-----------------------------------------------------------------------+
    |     TaskName         | The name of the entry function of the task.                           |
    +----------------------+-----------------------------------------------------------------------+
    |     Priority         | The RTOS priority for the task.                                       |
    +----------------------+-----------------------------------------------------------------------+
    |     State            | Current state of the task.                                            |
    +----------------------+-----------------------------------------------------------------------+
    |     StackSize        | The size of the runtime stack, configured when instantiating a task.  |
    +----------------------+-----------------------------------------------------------------------+
    |     StackPeak        | The maximum run-time stack memory used based on watermark  in RAM,    |
    |                      | where the stacks are prefilled with 0xBE and there is a sentinel      |
    |                      | word at the end of the run-time stack.                                |
    +----------------------+-----------------------------------------------------------------------+
    |     StackLimit       | The logical top of the runtime stack of the task.                     |
    +----------------------+-----------------------------------------------------------------------+

.. note::
    Function calls may push the stack pointer out of the run-time stack, but
    not actually write to the entire area. A stack peak near stackSize but not
    exceeding it may indicate stack overflow.
    