Oracle® Solaris Studio 12.4: Debugging a Program With dbx

Exit Print View

Updated: January 2015
 
 

Attached Process on a System Running Oracle Solaris

On a system running the Oracle Solaris operating system, the process must have rtcaudit.so preloaded when it starts. If the process to which you are attaching is a 64-bit process, use the appropriate 64-bit rtcaudit.so, which is located at:

64-bit SPARC platforms: /install-dir/lib/dbx/sparcv9/runtime/rtcaudit.so

AMD64 platforms: /install-dir/lib/dbx/amd64/runtime/rtcaudit.so

32-bit platforms: /install-dir/lib/dbx/runtime/rtcaudit.so

To preload rtcaudit.so:

% setenv LD_AUDIT path-to-rtcaudit/rtcaudit.so

Set the LD_AUDIT environment variable to preload rtcaudit.so only when needed. Do not keep it loaded all the time. For example:

% setenv LD_AUDIT...
% start-your-application
% unsetenv LD_AUDIT

Once you attach to the process, you can enable runtime checking.

If the program you want to attach to is forked or executed from some other program, you must set LD_AUDIT for the main program, which will fork. The setting of LD_AUDIT is inherited across forks and execution. This solution might not work if a 32–bit program forks or executes a 64–bit program, or a 64–bit program forks or executes a 32–bit program.

The LC_AUDIT environment variable applies to both 32-bit programs and 64-bit programs, which makes it difficult to select the correct library for a 32-bit program that runs a 64-bit program, or a 64-bit program that runs a 32-bit program. Some versions of the Oracle Solaris OS support the LD_AUDIT_32 environment variable and the LD_AUDIT_64 environment variable, which affect only 32-bit programs and 64-bit programs, respectively. See the Linker and Libraries Guide for the version of Oracle Solaris you are running to determine if these variables are supported.