Debugging your problem using service replay debugging

Procedure

  1. Open a command prompt or shell.
    Tip: On Windows, one way to open a command prompt is to select Start > Run Type cmd and click OK.
  2. Set the runtime environment for the service in the command prompt by running the service replay debugging environment script in the command prompt. The environment script is named as follows:
    • Windows: appName.serviceName.hostname.pid.timestamp.env.bat
    • Linux®:
      • For bash: appName.serviceName.hostname.pid.timestamp.env.profile
      • For csh: appName.serviceName.hostname.pid.timestamp.env.cshrc
  3. Launch the debugger or IDE from the same command prompt or shell. The following examples demonstrate how:
    • GDB: /usr/bin/gdb
    • Visual Studio: devenv C:\mydirectory\mysolution.sln or, if your Visual Studio environment is not set in the command prompt:
      C:\Program Files (x86)\Microsoft Visual Studio\Common7\IDE\devenv.com \mydirectory\mysolution.sln
    • Eclipse:
      C:\eclipse\eclipse.exe
      /usr/bin/eclipse/eclipse
      
  4. Set breakpoints as appropriate.

    For example, if you already know that the problem is in CreateService, put a breakpoint at the beginning of the CreateService method. Otherwise, if you do not know where the problem is, put breakpoints at the beginning of each method.

  5. Run your service application from the debugger or IDE and step through the code to find the problem.
    Tip: On Windows, set the Service project as the Startup Project or Active Project before running your service application.
    Note: If there are multiple problems in a particular method, you can identify them using one iteration of service replay debugging. If, however, there are problems in other methods that were not yet invoked when the service was run, no replay data exists for these methods. Actions cannot be replayed until they are played once through IBM® Spectrum Symphony or IBM Spectrum Symphony Developer Edition.