Debugging your problem using service replay debugging
Procedure
- Open a command prompt or shell. Tip: On Windows, one way to open a command prompt is to select Start > Run, and type cmd and click OK.
- Run the service replay debugging environment script in
the command prompt to set the runtime environment for the service
in the command prompt, as follows:
- Windows: script_name.bat
- Linux®:
- For csh: source script_name.cshrc
- For bash: . script_name.profile
The environment scripts are located with the SERL files. For example, on Windows, in the %SOAM_HOME%\work\serl\appName\serviceName directory.
Tip: An easy way to set the environment is to copy the base file name from the service instance manager log that you were viewing while determining the problem. Change .serl in the file name to .env.bat, .env.profile, or .env.cshrc as required.On Windows, another easy way is to first navigate to the %SOAM_HOME%\work\serl\appName\serviceName directory using Windows Explorer, then drag the icon of the environment script into the command prompt and press Enter.
- 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:
dC:\Program Files (x86)\Microsoft Visual Studio\Common7\IDE\devenv.com
\mydirectory\mysolution.sln - Eclipse:
C:\eclipse\eclipse.exe /usr/bin/eclipse/eclipse
- GDB:
- 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.
- 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.