How to Single Step Debug with Workbench

First, build a DKM (Downloadable Kernel Module) as follows:

build_DKM.JPG

Then, download a DKM (Downloadable Kernel Module) as follows to an already running simulator or real target:

download_DKM.JPG

The option to debug a DKM can be specified right at the load and launch time as follows:

debug_specific_DKM.JPG

Alternatively, we can attach to an already running task from a DKM as follows:

already_running_tasks.JPG

This is done by attaching to a task by name as seen in the WindShell TCB (Task Control Block) dump above.

debug_specific_DKM.JPG

Either way, we need to set a break point at a function entry point or in the source code as shown here:

single_stepping.JPG

Breakpoints can be seen above and can also be set, listed, or cleared in the WindShell.  Here, we see the “b” command in the following below reveals that no break points are presently set.

no_bps.JPG

To view modules loaded, and to look for specific function entry points, use lkup “function_name” for example.

module_show.JPG

Showing task status from the TCBs (Task Control Blocks) while debugging, will reveal that the tasks being debugged are in a stopped state.

task_status_while_debugging_task.JPG

It is most useful to keep the source window up, single step, click to set breakpoints, for interactive debug as shown here:

single_stepping_in_entry_point.JPG

Spend time debugging the example code, test_tasks.c, by both attaching to the already running tasks, and by launching with breakpoints pre-set.  Useful features like viewing source in mixed assembly and C source level may also be useful.  The underlying debugger is GDB, which attaches to the remote Wdb debug agent to gain control of tasks on the target and to single step them.