Ignore:
Timestamp:
Sep 17, 2020, 11:52:16 PM (5 years ago)
Author:
bird
Message:

kash: Use kHlpAssert instead of assert.h (debugger stops on the assertion rather than at exit process code).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/error.c

    r3438 r3477  
    371371        return psh->errmsg_buf;
    372372}
     373
     374
     375#ifdef K_STRICT
     376
     377KHLP_DECL(void) kHlpAssertMsg1(const char *pszExpr, const char *pszFile, unsigned iLine, const char *pszFunction)
     378{
     379        shinstance *psh = shthread_get_shell();
     380
     381        TRACE((psh,  "Assertion failed in %s --- %s --- %s(%u)\n", pszFunction, pszExpr, pszFile, iLine));
     382        dprintf(psh, "Assertion failed in %s --- %s --- %s(%u)\n", pszFunction, pszExpr, pszFile, iLine);
     383}
     384
     385KHLP_DECL(void) kHlpAssertMsg2(const char *pszFormat, ...)
     386{
     387        shinstance *psh = shthread_get_shell();
     388        va_list va;
     389        va_start(va, pszFormat);
     390        doformat(psh->out2, pszFormat, va);
     391        va_end(va);
     392}
     393
     394#endif /* K_STRICT */
Note: See TracChangeset for help on using the changeset viewer.