ChorusOS 4.0 Introduction

Preparing the System for Symbolic Debugging

Compiling for Debugging

In order to use all the debugging features in the XRAY Debugger, you need to generate symbolic debugging information when you compile components. This information is stored in the object files and describes the data type of each variable or function and the correspondence between source line numbers and addresses in the executable code.

How you enable debugging in components will depend on which release of ChorusOS 4.0 you have. The binary release of ChorusOS 4.0 includes the source code for the BSP, driver and example components. These you will compile in what is known as an imake build environment because the imake tool is used to create the Makefiles for these components.

The source release of ChorusOS 4.0 includes everything in the binary release plus source code for system components, such as the kernel and the operating system. These components are built in an mkmk build environment where the tool mkmk is used to build Makefiles. For more details see ChorusOS 4.0 Production Guide.

Enabling Debugging for Components Built with imake

To build all your components with symbolic debugging information turned on:

Other ways can be used to selectively build your components with symbolic debugging information. These are presented below.

To enable symbolic debugging throughout the component directory and its sub-directories:

  1. Edit the Project.tmpl file located in the root of the component source directory, and add the following line to the end:

    DEBUG=$(DEBUG_ON)

  2. Change directory to the root of your build directory and remove all the object files and executables:


    % make clean
    

  3. Rebuild the local Makefile:


    % make Makefile
    

  4. Rebuild the sub-directory Makefiles:


    % make Makefiles
    

  5. Finally, rebuild the component:


    % make
    

To enable symbolic debugging in selected component directories:

  1. Edit the Imakefile within each desired component source directory, and add the following line to the end:

    DEBUG=$(DEBUG_ON)

  2. Change directory to the root of your build directory and remove all the object files and executables:


    % make clean
    

  3. Rebuild the local Makefile:


    % make Makefile
    

  4. Finally, rebuild the component:


    % make
    

If you prefer not to modify the Imakefile or Project.tmpl files, there is an alternative way of enabling debugging. You can pass the debug option within the make command itself:

Once a component has been compiled in debug mode, rebuild and reboot the system image.

Enabling Debugging for Components Built with mkmk

To enable symbolic debugging for system components:

  1. Change to your build directory and remove all the object files and executables:


    % make clean
    

  2. Create a mkmk build definition file:


    % echo 'FREMOTEDEB=ON' > filename.df
    

    filename can be a name of your choice.

  3. Rebuild the system component:


    % make makemk
    

Configuring the Debug Agent

The DebugAgent is activated by enabling the DEBUG_SYSTEM feature with the configurator(1CC) command:


% configurator -set DEBUG_SYSTEM=true


Note -

The DEBUG_SYSTEM feature is set to true by default.


When the DebugAgent is activated, communications on the serial line are performed in binary mode.

The DebugAgent has eight tunable options that you can configure with ews or configurator. The following three tunables control the behavior of the DebugAgent when it is enabled (DEBUG_SYSTEM=true):

The following five tunables control the serial line used by the DebugAgent.


Note -

When the DebugAgent is not active (DEBUG_SYSTEM=false), the serial line is used by the system debugging console, and the five tunables control the serial device and speed.