Debugging Hello World in C on a Fixed Virtual Platform

Once you have created the project and built the code, launch the debugger to run the application on one of the Fixed Virtual Platforms (FVP) provided with DS-5. For this tutorial, we use a Cortex-A9 Fixed Virtual Platform (FVP) which is provided with DS-5.

Creating a DS-5 Debug Configuration and Connecting to an FVP

  1. From the DS-5 main menu, select Run > Debug Configurations.
  2. In the Debug Configurations dialog:
    1. Select DS-5 Debugger.
    2. Click the New launch configuration button.

      This creates a new DS-5 debug configuration and displays the various tabs required to specify settings for loading your application on the target.

  3. In the Debug Configurations dialog:
    1. Give a name to the debug configuration. For example, HelloWorld_FVP.
    2. In the Connection tab, under Select Target, browse and select ARM FVP (Installed with DS-5) > VE_Cortex_A9x1 > Bare Metal Debug > Debug Cortex-A9.

    3. Select the Files tab, and under Target Configuration in the Application on host to download field, click Workspace.

      The Workspace contains the HelloWorld.axf application file you created when you built the Hello World project.

      Note: Ensure that the Load symbols option is selected.

    4. Select HelloWorld.axf.

    5. Select the Debugger tab, and ensure the Debug from symbol option is selected and set to main.

    6. Click Debug to load the application on the target, and load the debug information into the debugger.
    7. In the Confirm Perspective Switch dialog that appears, click Yes.

      DS-5 connects to the model and displays the connection status in the Debug Control view.

      The application is loaded on the target, and has stopped at the main() function, ready to run.

    8. Click to continue running the application.

      You can view the application output in the Target Console view.

      Other views display information relevant to the debug connection

      • Commands view displays messages output by the debugger. Also use this view to enter DS-5 commands.

      • C/C++ Editor view shows the structure of the active C, C++, or makefile. The view is updated as you edit these files.

      • Disassembly view shows the loaded program in memory as addresses and assembler instructions.

         Indicates the location in the code where your program is stopped. In this case, it is at the main() function.

      • Memory view shows how the code is represented in the target memory.

        For example, to view how the string Hello World from the application is represented in memory:

        1. Open the Memory view.
        2. In the Address field, enter 0x80000000 and press Enter on your keyboard. The view displays contents of the target's memory.
        3. Select and highlight the words Hello World.

        In the above example, the Memory view displays the hexadecimal values for the code, and also the ASCII character equivalent of the memory values which enable you to drill down into the details of the code.

Step Through the Application

Use the controls provided in the Debug Control view to step through the application.


Continue Button - Click to continue executing code.

Pause Button - Click to interrupt or pause executing code.

Step Through button - Click to step through the code.

Step Over button - Click to step over source line.

Step Out button - Click to step out.

Step instruction - This is a toggle. Select this if you want the above controls to step through instructions.

Disconnecting from the Debug Connection

To disconnect from a debug connection, you can either right-click the connection and select Disconnect from Target or select the connection and in the Debug Control view toolbar click