Changeset 3413 for trunk/src/kmk/kmkbuiltin/kSubmit.c
- Timestamp:
- Aug 20, 2020, 10:20:15 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/kSubmit.c
r3363 r3413 122 122 #endif 123 123 124 /** --debug-dump-history-on-failure. */ 125 int fDebugDumpHistoryOnFailure; 124 126 /** Current history index (must mod with aHistory element count). */ 125 127 unsigned iHistory; … … 1552 1554 case STATUS_ILLEGAL_INSTRUCTION: *piSigNo = SIGILL; break; 1553 1555 } 1554 if (pWorker->Result.s.rcExit && 1)1556 if (pWorker->Result.s.rcExit && pWorker->fDebugDumpHistoryOnFailure) 1555 1557 kSubmitDumpHistory(pCtx, pWorker); 1556 1558 if (pWorker->Result.s.bWorkerExiting) … … 1758 1760 " More verbose execution.\n" 1759 1761 " --debug-dump-history\n" 1760 " Dump the history as of the submitted command. Handy for debug ing\n"1762 " Dump the history as of the submitted command. Handy for debugging\n" 1761 1763 " trouble caused by a previous job.\n" 1764 " --debug-dump-history-on-failure, --no-debug-dump-history-on-failure\n" 1765 " Dump the history on failure. Can also be enabled by a non-empty\n" 1766 " KMK_KSUBMIT_DUMP_HISTORY_ON_FAILURE variable (first invocation only).\n" 1762 1767 " -P|--post-cmd <cmd> ...\n" 1763 1768 " For running a built-in command on the output, specifying the command\n" … … 1793 1798 int fNoPchCaching = 0; 1794 1799 int fDebugDumpHistory = 0; 1800 static int s_fDebugDumpHistoryOnFailure = -1; 1801 int fDebugDumpHistoryOnFailure = s_fDebugDumpHistoryOnFailure; 1795 1802 int cVerbosity = 0; 1796 1803 size_t const cbCwdBuf = GET_PATH_MAX; … … 1813 1820 } 1814 1821 #endif 1822 if (fDebugDumpHistoryOnFailure != -1) 1823 { /* likely */ } 1824 else 1825 { 1826 struct variable *pVar = lookup_variable(TUPLE("KMK_KSUBMIT_DUMP_HISTORY_ON_FAILURE")); 1827 fDebugDumpHistoryOnFailure = pVar && *pVar->value != '\0'; 1828 s_fDebugDumpHistoryOnFailure = fDebugDumpHistoryOnFailure; 1829 } 1815 1830 1816 1831 /* … … 1880 1895 } 1881 1896 1897 if (strcmp(pszArg, "debug-dump-history-on-failure") == 0) 1898 { 1899 fDebugDumpHistoryOnFailure = 1; 1900 continue; 1901 } 1902 1903 if (strcmp(pszArg, "no-debug-dump-history-on-failure") == 0) 1904 { 1905 fDebugDumpHistoryOnFailure = 0; 1906 continue; 1907 } 1882 1908 1883 1909 /* convert to short. */ … … 2061 2087 #endif 2062 2088 output_dump(pCtx->pOut); 2089 pWorker->fDebugDumpHistoryOnFailure = fDebugDumpHistoryOnFailure; 2063 2090 rcExit = kSubmitSendJobMessage(pCtx, pWorker, pvMsg, cbMsg, 0 /*fNoRespawning*/, cVerbosity); 2064 2091 if (rcExit == 0)
Note:
See TracChangeset
for help on using the changeset viewer.