Debug Your Application

Introduction

You may debug your applications on a CAT-DEV by using the MULTI debugger that was installed along with the entire MULTI toolchain from Green Hills Software during Set Up Your Development Environment. Debugging with the MULTI debugger is not available for the CAT-R. The steps in the following sections show you how to use the debugger.

To Debug Your Application

  1. Navigate to location where you installed the Cafe SDK.
  2. Double-click cafex_env.bat.
  3. At the command prompt, type the following command, and then press Enter:
    cd %CAFE_ROOT%/system/bin/ghs/cafe/demo/helloworld/DEBUG
    
  4. At the command prompt, type the following command and press Enter:
    cafex run -d multi helloworld.rpx
    
  5. In the Cafe Cygwin shell window, you should see debug output. Before the command prompt returns, you should see the message WAITING FOR DEBUGGER:
    ...
       ACP_AutoInit: start
       ACP_AutoInit: ACPInitialize complete
       ACP_AutoInit: ACPSaveDataInit complete
       ACP_AutoInit: ACPNotifyPlayEvent complete
       ACP_AutoInit: NDMInitialize complete
    ACP: initialized
    Wait for connection from debugger...
    [+-*WAITING FOR DEBUGGER*-+]
    
  6. After a short wait, the MULTI debugger starts. Step through the demo.
    HelloWorld demo completed successfully
NOTE:
This demo does not output anything to the television or the DRC.

You may also build and debug the demo in one step from the demo source directory.

NOTE:
This process only works if you have installed Cygwin or MinGW/MSYS.

To Build and Debug Your Application in One Step

  1. Navigate to the folder where you installed the Cafe SDK.
  2. Double-click cafe.bat.
  3. At the command prompt, type the following command, and then press Enter:
    cd $CAFE_ROOT/system/src/demo/helloworld
    
  4. At the command prompt, type the following command, and then press Enter:
    make multirun
    

You may also build and run the demo in one step from the demo source directory and launch the MULTI debugger only in the event of a crash or trap call (OSDebug or OSDebugStr).

To Build and Run Your Application in One Step and Stop in MULTI Debugger if there is a Crash or Trap Call

  1. Navigate to the folder where you installed the Cafe SDK.
  2. Double-click cafe.bat.
  3. At the command prompt, type one of the following commands, and then press Enter:
    cd $CAFE_ROOT/system/demo/debug_crash/nullptr
    
    cd $CAFE_ROOT/system/demo/debug_crash/osdebugstr
    
  4. At the command prompt, type the following command, and then press Enter:
    make run2multi
    
  5. There is additional documentation in the above directories.

Control Single-Step Performance in the MULTI Debugger

By default, the debugger interface with MULTI now uses the higher-performance EXI channel. If you need to restore the old SDIO channel as the interface, set the Windows CMD shell or Cafe Cygwin shell environment variable USE_EXI_AS_DEBUG_CHANNEL to a value of 0. To restore the default EXI channel behavior, set USE_EXI_AS_DEBUG_CHANNEL to a value of 1. EXI channel support is available in MULTI 5.3.21 or greater. For more information, see the Green Hills Software MULTI 5.3.21 release notes included in the root directory of the MULTI debugger install.

Revision History

2014-02-17 Updated Single Step Performance section.
2014-02-13 Added Single Step Performance section.
2013-12-20 Cygwin->CMD transition changes.
2013-12-16 Add run2multi.
2013-12-13 Fix incorrect link to CAT-R and examples.
2013-05-08 Automated cleanup pass.
2013-01-15 Initial version.


CONFIDENTIAL