BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   Programming BEA Tuxedo ATMI Applications Using C   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents

 


Debugging Application Processes

Although you can use userlog(3c)statements to debug application software, it is sometimes necessary to use a debugger command for more complex problem solving.

The following sections describe how to debug an application on UNIX and Windows 2000 platforms.

Debugging Application Processes on UNIX Platforms

The standard UNIX system debugging command is dbx(1). For complete information about this tool, refer to dbx(1) in a UNIX system reference manual. If you use the -g option to compile client processes, you can debug those processes using the procedures described on the dbx(1) reference page.

To run the dbx command, enter the following:

dbx client

To execute a client process:

  1. Set any desired breakpoints in the code.

  2. Enter the dbx command.

  3. At the dbx prompt (*), type the run subcommand (r) and any options you want to pass to the client program's main().

The task of debugging server programs is more complicated. Normally a server is started using the tmboot command, which starts the server on the correct machine with the correct options. When using dbx, it is necessary to run a server directly rather than through the tmboot command. To run a server directly, enter the r (short for run) subcommand after the prompt displayed by the dbx command.

The BEA Tuxedo tmboot(1) command passes undocumented command-line options to the server's predefined main(). To run a server directly, you must pass these options, manually, to the r subcommand. To find out which options need to be specified, run tmboot with the -n and -d 1 options. The -n option instructs tmboot not to execute a boot; -d 1 instructs it to display level 1 debugging statements. By default, the -d 1 option returns information about all processes. If you want information about only one process, you can specify your request accordingly with additional options. For more information, refer to the BEA Tuxedo Command Reference.

The output of tmboot -n -d 1 includes a list of the command-line options passed by tmboot to the server's main(), as shown in the following example:

exec server -g 1 -i 1 -u sfmax -U /tuxdir/appdir/ULOG -m 0 -A

Once you have the list of required command-line options, you are ready to run the server program directly, with the r subcommand of dbx(1). The following command line is an example:

*r -g 1 -i 1 -u sfmax -U /tuxdir/appdir/ULOG -m 0 -A 

You may not use dbx(1) to run a server that is already running as part of the configuration. If you try to do so, the server exits gracefully, indicating a duplicate server in the central event log.

Debugging Application Processes on Windows 2000 Platforms

On a Windows 2000 platform, a graphical debugger is provided as part of the Microsoft Visual C++ environment. For complete information about this tool, refer to the Microsoft Visual C++ reference manual.

To invoke the Microsoft Visual C++ debugger, enter the start command as follows:

start msdev -p process_ID

Note: For versions of the Microsoft Visual C++ debugger that are earlier than 5.0, enter the start command as follows:

start msdev -p process_id

To invoke the debugger and automatically enter a process, specify the process name and arguments on the start command line, as follows:

start msdev filename argument

For example, to invoke the debugger and enter the simpcl.exe process with the ConvertThisString argument, enter the following command:

start msdev simpcl.exe ConvertThisString

When a user-mode exception occurs, you are prompted to invoke the default system debugger to examine the location of the program failure and the state of the registers, stacks, and so on. By default, Dr. Watson is used in the Windows 2000 environment uses as the default debugger for user-mode exception failures, while the kernel debugger is used in the Win32 SDK environment.

To modify the default debugger used by the Windows 2000 system for user-mode exception failures, perform the following steps:

  1. Run regedit or regedt32.

  2. Within the HKEY_LOCAL_MACHINE subtree, navigate to \SOFTWARE\Microsoft\Windows\CurrentVersion\AeDebug

  3. Double-click on the Debugger key to advance into the registry string editor.

  4. Modify the existing string to specify the debugger of your choice.

    For example, to request the debugger supplied with the Microsoft Visual C++ environment, enter the following command:

    msdev.exe -p %ld -e %ld

Note: For versions of the Microsoft Visual C++ debugger that are earlier than 5.0, enter the following command:

msvc.exe -p %ld -e %ld

 

back to top previous page