top

Debugging NaCl Projects

This topic describes how to debug Native Client projects with the Tizen Studio.

You can use the Tizen Studio debugger to test Native Client (NaCl) applications. The NaCl debugger is based on the Eclipse remote debugger. For more information on the remote debugger, see Remote Debugging.

Prerequisites

Before you debug the application:

  • In Google Chrome™ on a Windows® computer, you must download and extract an older Google Chrome™ version, such as snapshot 328051, and define its path in the debug launch configuration.

  • On the emulator, you must launch an appropriate emulator instance.

  • On a Samsung TV:

    1. Obtain a Samsung-provided Smart TV developer model, running Tizen 2.4.
      For more information, contact a Samsung representative by going to "Samsung Apps TV Seller Office > Support > 1:1 Q&A".
    2. Install the WebKit or Chromium debug version on the TV.
    3. On the TV, switch on the NaCl debug mode.
    4. Connect the TV to the SDK.

Launching the Debugger

To debug the application with the default debug configuration:

  1. Create breakpoints in the source code by double-clicking in the source code editor left margin.
    Figure 1. Creating breakpoints

    Figure 1. Creating breakpoints

  2. Launch the debugger:
    • To debug the application in Google Chrome™, in the "Project Explorer" view, right-click the project and select "Debug As > Webpage in Chrome".
    • To debug the application on the emulator or a Samsung TV:
      1. In the Tizen Studio toolbar, select the emulator instance or TV from the drop-down menu.
      2. In the "Project Explorer" view, right-click the project and select "Debug As > Widget on a Tizen device".

Customizing Debug Configurations

You can also customize the debug configuration. The process is similar to customizing the launch configuration.

In the Tizen Studio, you can use a cheat sheet to guide you through using a custom debug configuration to debug a NaCl project in Google Chrome™ or the emulator. To open the cheat sheet, select "Help > Cheat Sheets > NaCl Application > NaCl project guides > [required cheat sheet]" and click "OK".

To create and use a custom debug configuration:

  1. In the Tizen Studio menu, select "Run > Debug configurations".

  2. Create the debug configuration you need:

    • To debug the application in Google Chrome™:
      1. In the side menu, double-click "Chrome Debug".
      2. Enter the configuration name, project name, and main HTML file path, and customize the launch parameters.
      3. In the "Chrome command" field, define the path to your Google Chrome™ executable file location.
    • To debug the application on the emulator or a TV, in the side menu, double-click "Device Debug":
      1. Define the configuration name, project name, and ".wgt" file path.
      2. Select the emulator or TV you want to debug the application on.
        Figure 2. Device debug configuration

        Figure 2. Device debug configuration

  3. Define the path to the compiled NaCl module (".nexe" file) in your project.

  4. If you want to set a debugging entry point, in the "Debugger" tab, fill the "Stop on startup" checkbox and define the entry function.

    Figure 3. Debugging entry point

    Figure 3. Debugging entry point

    Important

    Do not modify the settings in the "Debugger" sub-tabs or the "Source" and "Common" tabs.

  5. To start debugging, click "Debug".