bcheck [ -access | -all | -leaks | -memuse ] [ -o logfile ] [ -q ] [ -s script ] program [ args ]
bcheck 是 dbx 的运行时检查 (Runtime Checking, RTC) 的批处理接口,它是在 dbx 下使用指定的所有 args 运行 program 的 shell 脚本。RTC 错误输出将写入指定的 logfile 或者缺省文件 program.errs.如果该文件已存在,则将覆盖其内容。尽管 bcheck 可以执行内存泄露检查、内存访问检查、内存使用检查或全部三项,但是缺省情况下仅执行泄露检查。
在运行 Linux 操作系统的系统上运行 bcheck 之前,必须设置 _DBX_EXEC_32 环境变量。
执行内存访问检查。
执行内存访问和内存泄露检查。
仅执行内存泄露检查。(缺省值)
执行内存使用检查,其中包括内存泄露检查。
将错误输出写入 logfile 或者缺省文件 program.errs。
运行 bcheck 时完全无任何提示并返回与 'program' 相同的退出状态。如果您想要在脚本、makefile 和类似的项目中使用 bcheck,则该选项非常有用。
在执行之前读入 script 中包含的 dbx 命令。通过 suppress 和 dbxenv 等命令,您可以调整 bcheck 的错误输出。
对 hello 执行泄露检查:
bcheck hello
使用参数对 mach 执行访问检查:
bcheck -access mach 5
以静默方式对 'cc' 执行访问和内存使用检查,并以正常退出状态退出:
bcheck -all -q cc -c prog.c
对 foo 执行访问检查,禁止显示所有 rui 错误:
echo suppress rui > foo.sup bcheck -access -s foo.sup foo 1
dbx(1)