Sun Studio 12: Debugging a Program With dbx

bcheck Examples

To perform only leak checking on hello, type:

bcheck hello

To perform only access checking on mach with the argument 5, type:

bcheck -access mach 5

To perform memory use checking on cc quietly and exit with normal exit status, type:

bcheck -memuse -q cc -c prog.c

The program does not stop when runtime errors are detected in batch mode. All error output is redirected to your error log file logfile. The program stops when breakpoints are encountered or if the program is interrupted.

In batch mode, the complete stack backtrace is generated and redirected to the error log file. The number of stack frames can be controlled using the dbx environment variable stack_max_size.

If the file logfile already exists, bcheck erases the contents of that file before it redirects the batch output to it.