tryWaitForDebugger#
Fully qualified name: carb::extras::tryWaitForDebugger
Defined in carb/extras/Debugging.h
- inline bool carb::extras::tryWaitForDebugger(
- int argc,
- char **argv,
- bool quiet = false,
- bool stop = true,
- const char *option = "--wait-debugger",
Parses a command line and waits for a debugger if a specific option is found.
This is a low-level function intended to be called as early as possible during process startup. If the given option is found, this function blocks forever until a debugger is attached.
- Parameters:
argc – The number of command-line arguments passed to the application.
argv – The array of command-line options.
quiet – If false (the default) and
optionis found in the array of command-line options, prints the text"***** waiting for a debugger to attach to process <pid> *****\n"tostderr; otherwise prints nothing but still waits.stop – If true, a debug-break will occur immediately after the debugger attaches. Otherwise, execution continues without a debug-break.
option – The command-line argument to look for. Default:
--wait-debugger. Ifnullptror an empty string, no waiting will be performed.
- Returns:
trueifoptionwas found inargvand a debugger was attached;falseotherwise.