-
Notifications
You must be signed in to change notification settings - Fork 449
DiagnosticsApi
The diagnostics API determines where stdout and stderr are sent, and what's written to them. BOINC's initialization functions - boinc_init() etc. - set reasonable defaults for these settings. If for some reason you want different settings, this API lets you do it.
BOINC applications can call
int boinc_init_diagnostics(int flags)
BOINC graphics applications can call
int boinc_init_graphics_diagnostics(int flags)
to initialize various diagnostic functions. This call should be made early in the program - before boinc_init()
- so that error info is routed appropriately. flags
is formed by or'ing together a subset of the following flags.
Applications are advised to use at least BOINC_DIAG_DUMPCALLSTACKENABLED
, BOINC_DIAG_REDIRECTSTDERR
, and BOINC_DIAG_TRACETOSTDERR
.
The default is BOINC_DIAG_DUMPCALLSTACKENABLED, BOINC_DIAG_HEAPCHECKENABLED, BOINC_DIAG_MEMORYLEAKCHECKENABLED, BOINC_DIAG_REDIRECTSTDERR, BOINC_DIAG_TRACETOSTDERR
If the application crashes, write a symbolic call stack to stderr. If you use this in a Windows application, you can make use of Symbol Stores for just in time debugging.
Check the integrity of the malloc heap every N allocations. (N is line 249 in diagnostics.C; default 1024).
When process exits, write descriptions of any outstanding memory allocations to stderr.
Rename stderr.txt to stderr.old on startup.
Rename stdout.txt to stdout.old on startup.
Redirect stderr to stderr.txt.
Redirect stdout to stdout.txt.
Overwrite stderr.txt (default is to append).
Overwrite stdout.txt (default is to append).
Write TRACE macros to stderr (Windows specific).
Write TRACE macros to stdout (Windows specific).