Two ways to debug a VxWorks code include as a function that is started in suspended debug mode or as a task that is attached to and suspended for debug.

 

Launching a function in debug mode

Start by setting up a project for debug using SIMNTgnu toolchain and simulator BSP

project-setup.JPG

 

Now make sure symbol analysis is don on new project

project-setup-2.JPG

Adding example code files to your new project

adding-code.JPG

 

 

Now build it

 

building-project.JPG

 

Now debug it

debugging-project.JPG

Connect to custom simulator

connect-to-custom-sim.JPG

 

 

Now set up entry point for debug to stop on

set-entry-point.JPG

 

Now run in debug mode

debug-screen-comes-up.JPG

Now single step and debug your code and note that in simulator windshell your task that is being debugged is in as suspended (STOP) state

debugged-task-stopped.JPG


 

 

Attaching to an already running task and suspending for debug

 

Alternatively, if you have a resident service that is running as a periodic task, you can attach to it, suspend it and then debug it

suspend-running-task.JPG

 

You will most often wind up in kernel code, so step out of the system call and back into application code

step-return-out-of-asm.JPG