From 5ee527d39176d5d612014ce39a1e1ecbe59b3d9c Mon Sep 17 00:00:00 2001 From: Christopher Chang Date: Thu, 17 Feb 2022 19:08:02 -0800 Subject: [PATCH] add terminal --debug prints --- 2.0/plink2.cc | 6 ++++++ 2.0/plink2_cmdline.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/2.0/plink2.cc b/2.0/plink2.cc index c9ed51a5..83b28814 100644 --- a/2.0/plink2.cc +++ b/2.0/plink2.cc @@ -10944,7 +10944,13 @@ int main(int argc, char** argv) { reterr = kPglRetWriteFail; } if (bigstack_ua) { + if (g_debug_on) { + fputs("--debug: Trying to free bigstack_ua.\n", stdout); + } free(bigstack_ua); } + if (g_debug_on) { + fputs("--debug: Exiting.\n", stdout); + } return S_CAST(int32_t, reterr); } diff --git a/2.0/plink2_cmdline.cc b/2.0/plink2_cmdline.cc index 4c49ccee..b02aace5 100644 --- a/2.0/plink2_cmdline.cc +++ b/2.0/plink2_cmdline.cc @@ -526,9 +526,15 @@ BoolErr CleanupLogfile(uint32_t print_end_time) { } BoolErr ret_boolerr = 0; if (g_logfile) { + if (g_debug_on) { + printf("--debug: g_log_failed = %u.\n", g_log_failed); + } if (!g_log_failed) { logputs_silent("\n"); logputs_silent(g_logbuf); + if (g_debug_on) { + fputs("--debug: Trying to close log.\n", stdout); + } if (unlikely(fclose(g_logfile))) { fflush(stdout); fprintf(stderr, "Error: Failed to finish writing to log: %s.\n", strerror(errno));