diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/creator/creator_args.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 675f2621942..4b5038d89df 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -536,6 +536,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_argsPrintArgDoc(ba, "--log"); BLI_argsPrintArgDoc(ba, "--log-level"); BLI_argsPrintArgDoc(ba, "--log-show-basename"); + BLI_argsPrintArgDoc(ba, "--log-show-backtrace"); BLI_argsPrintArgDoc(ba, "--log-file"); printf("\n"); @@ -748,6 +749,17 @@ static int arg_handle_log_show_basename_set(int UNUSED(argc), const char **UNUSE return 0; } +static const char arg_handle_log_show_backtrace_set_doc[] = +"\n\tShow a back trace for each log message (debug builds only)." +; +static int arg_handle_log_show_backtrace_set(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + /* Ensure types don't become incompatible. */ + void (*fn)(FILE *fp) = BLI_system_backtrace; + CLG_backtrace_fn_set((void (*)(void *))fn); + return 0; +} + static const char arg_handle_log_file_set_doc[] = "<filename>\n" "\n" @@ -1948,6 +1960,7 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 1, NULL, "--log", CB(arg_handle_log_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-level", CB(arg_handle_log_level_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-show-basename", CB(arg_handle_log_show_basename_set), ba); + BLI_argsAdd(ba, 1, NULL, "--log-show-backtrace", CB(arg_handle_log_show_backtrace_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-file", CB(arg_handle_log_file_set), ba); BLI_argsAdd(ba, 1, "-d", "--debug", CB(arg_handle_debug_mode_set), ba); |