Ignore:
Timestamp:
Jun 23, 2023, 11:24:37 PM (2 years ago)
Author:
rlwalsh
Message:

except.c: make trap logs less verbose/pedantic; minor formatting changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1-0/src/helpers/except.c

    r431 r453  
    468468                ulOffset = -1;
    469469    ULONG       ul;
    470 
    471470    ULONG       ulOldPriority = 0x0100; // regular, delta 0
     471    PSZ         pszExp = "\nExplanation:         %s\n                     %s\n";
    472472
    473473    // raise global flag for whether this func is running
     
    528528            pcszVersion);
    529529
    530 
    531     // generic exception info
    532     fprintf(file,
    533             "\n%s:\n    Exception type: %08lX\n    Address:        %08lX\n    Params:         ",
    534             pszHandlerName,
    535             pReportRec->ExceptionNum,
    536             (ULONG)pReportRec->ExceptionAddress);
    537     for (ul = 0;  ul < pReportRec->cParameters;  ul++)
    538     {
    539         fprintf(file, "%08lX  ",
    540                 pReportRec->ExceptionInfo[ul]);
    541     }
    542530
    543531    // now explain the exception in a bit more detail;
     
    565553                        pContextRec->ctx_SegDs,
    566554                        pReportRec->ExceptionInfo[1]);
    567             fprintf(file,
    568                     "Explanation: An attempt was made to access a memory object which does\n"
    569                     "             not belong to the current process. Most probable causes\n"
    570                     "             for this are that an invalid pointer was used, there was\n"
    571                     "             confusion with administering memory or error conditions \n"
    572                     "             were not properly checked for.\n");
     555            fprintf(file, pszExp,
     556                    "An attempt was made to access a memory object which does",
     557                    "not belong to the current process.");
    573558        break;
    574559
    575560        case XCPT_INTEGER_DIVIDE_BY_ZERO:
    576561            fprintf(file, "\nXCPT_INTEGER_DIVIDE_BY_ZERO.\n");
    577             fprintf(file,
    578                     "Explanation: An attempt was made to divide an integer value by zero,\n"
    579                     "             which is not defined.\n");
     562            fprintf(file, pszExp,
     563                    "An attempt was made to divide an integer value by zero,"
     564                    "which is not defined.");
    580565        break;
    581566
    582567        case XCPT_ILLEGAL_INSTRUCTION:
    583568            fprintf(file, "\nXCPT_ILLEGAL_INSTRUCTION.\n");
    584             fprintf(file,
    585                     "Explanation: An attempt was made to execute an instruction that\n"
    586                     "             is not defined on this machine's architecture.\n");
     569            fprintf(file, pszExp,
     570                    "An attempt was made to execute an instruction that",
     571                    "is not defined on this machine's architecture.");
    587572        break;
    588573
    589574        case XCPT_PRIVILEGED_INSTRUCTION:
    590575            fprintf(file, "\nXCPT_PRIVILEGED_INSTRUCTION.\n");
    591             fprintf(file,
    592                     "Explanation: An attempt was made to execute an instruction that\n"
    593                     "             is not permitted in the current machine mode or that\n"
    594                     "             the program had no permission to execute.\n");
     576            fprintf(file, pszExp,
     577                    "An attempt was made to execute an instruction that",
     578                    "the program does not have permission to use.");
    595579        break;
    596580
    597581        case XCPT_INTEGER_OVERFLOW:
    598582            fprintf(file, "\nXCPT_INTEGER_OVERFLOW.\n");
    599             fprintf(file,
    600                     "Explanation: An integer operation generated a carry-out of the most\n"
    601                     "             significant bit. This is a sign of an attempt to store\n"
    602                     "             a value which does not fit into an integer variable.\n");
     583            fprintf(file, pszExp,
     584                    "An integer operation generated a carry out of the most"
     585                    "significant bit.");
    603586        break;
    604587
    605588        default:
    606589            fprintf(file, "\nUnknown OS/2 exception number %d.\n", pReportRec->ExceptionNum);
    607             fprintf(file, "Look this up in the OS/2 header files.\n");
    608590        break;
    609591    }
     592
     593    // generic exception info
     594    fprintf(file,
     595            "\n%s:\n    Exception type:  %08lX\n    Address:         %08lX\n    Params:          ",
     596            pszHandlerName,
     597            pReportRec->ExceptionNum,
     598            (ULONG)pReportRec->ExceptionAddress);
     599    for (ul = 0;  ul < pReportRec->cParameters;  ul++)
     600    {
     601        fprintf(file, "%08lX  ",
     602                pReportRec->ExceptionInfo[ul]);
     603    }
     604    fputs("\n", file);
     605
    610606
    611607    // V0.9.16 (2001-11-02) [pr]: We already got this info. above - this overwrites the
Note: See TracChangeset for help on using the changeset viewer.