Changeset 1313


Ignore:
Timestamp:
Mar 16, 2004, 4:55:24 AM (21 years ago)
Author:
bird
Message:

LIBC_STRICT_DISABLED and missing writes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/sys/logstrict.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1312 r1313  
    824824                          const char *pszFormat, ...)
    825825{
     826    static int      fEnabled = -1;
    826827    unsigned        uTS = getTimestamp();
    827828    char           *pszMsg;
     
    833834
    834835    /*
     836     * Check if strict is enabled or not.
     837     * Disabled when LIBC_STRICT_DISABLED is present.
     838     */
     839    if (fEnabled == -1)
     840    {
     841        PSZ pszValue;
     842        fEnabled = DosScanEnv((PCSZ)"LIBC_STRICT_DISABLED", &pszValue) != NO_ERROR;
     843    }
     844
     845    /*
    835846     * Check instance, get default.
    836847     */
     
    871882    va_start(args, pszFormat);          /* make compiler happy we do it here. */
    872883    cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %04x Asrt: Assertion Failed!!!\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags));
    873     DosWrite(2, pszMsg, cch, &cb);
     884    __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch);
     885    if (fEnabled)
     886        DosWrite(2, pszMsg, cch, &cb);
     887
    874888    cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %04x Asrt: Function: %s\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction);
    875     DosWrite(2, pszMsg, cch, &cb);
     889    __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch);
     890    if (fEnabled)
     891        DosWrite(2, pszMsg, cch, &cb);
     892
    876893    cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %04x Asrt: File:     %s\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFile);
    877     DosWrite(2, pszMsg, cch, &cb);
     894    __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch);
     895    if (fEnabled)
     896        DosWrite(2, pszMsg, cch, &cb);
     897
    878898    cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %04x Asrt: Line:     %d\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), uLine);
    879     DosWrite(2, pszMsg, cch, &cb);
     899    __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch);
     900    if (fEnabled)
     901        DosWrite(2, pszMsg, cch, &cb);
     902
    880903    cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %04x Asrt: Expr:     %s\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszExpression);
    881     DosWrite(2, pszMsg, cch, &cb);
     904    __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch);
     905    if (fEnabled)
     906        DosWrite(2, pszMsg, cch, &cb);
     907
    882908    cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %04x Asrt: ",
    883909                             uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags));
     910    __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch);
     911    if (fEnabled)
     912        DosWrite(2, pszMsg, cch, &cb);
    884913    va_end(args);
    885914
    886915    /*
    887      * Write the message.
    888      */
    889     __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch);
    890 
    891     __asm__ __volatile__("int $3");
     916     * Breakpoint. (IBM debugger: T or Ctrl-T to get to caller)
     917     */
     918    if (fEnabled)
     919        __asm__ __volatile__("int $3");
    892920}
    893921
Note: See TracChangeset for help on using the changeset viewer.