Changeset 229 for trunk/src/helpers/except.c
- Timestamp:
- Nov 24, 2002, 9:45:05 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/except.c
r217 r229 451 451 *@@changed V0.9.16 (2001-11-02) [pr]: make object display signed 452 452 *@@changed V0.9.19 (2002-03-28) [umoeller]: added thread ordinal 453 *@@changed V 0.9.21(2002-08-28) [umoeller]: added OS revision to dump453 *@@changed V1.0.0 (2002-08-28) [umoeller]: added OS revision to dump 454 454 */ 455 455 … … 508 508 // generic exception info 509 509 DosQuerySysInfo(QSV_VERSION_MAJOR, // 11 510 QSV_VERSION_REVISION, // 13 V 0.9.21(2002-08-28) [umoeller]510 QSV_VERSION_REVISION, // 13 V1.0.0 (2002-08-28) [umoeller] 511 511 &aulBuf, sizeof(aulBuf)); 512 512 // Warp 3 is reported as 20.30 … … 527 527 aulBuf[0], // major 528 528 aulBuf[1], 529 aulBuf[2], // revision V 0.9.21(2002-08-28) [umoeller]529 aulBuf[2], // revision V1.0.0 (2002-08-28) [umoeller] 530 530 pcszVersion); 531 531 … … 791 791 * 792 792 * -- pfnExcOpenFileNew gets called to open 793 * the trap log file. This must return a FILE* 794 * pointer from fopen(). If this is not defined, 795 * ?:\TRAP.LOG is used. Use this to specify a 796 * different file and have some notes written 797 * into it before the actual exception info. 793 * the trap log file. This can return a FILE* 794 * pointer from fopen() (which will be closed 795 * automatically by the handler). 796 * 797 * If this hook is not defined, ?:\TRAP.LOG is 798 * used. Use this hook to specify a different file 799 * and have some notes written into it before the 800 * actual exception info. 801 * 802 * If the hook returns a null FILE* pointer, 803 * logging is disabled, and the "loud" handler 804 * effectively behaves like the "quiet" handler. 798 805 * 799 806 * -- pfnExcHookNew gets called while the trap log … … 801 808 * the following info has been written into 802 809 * the trap log already: 810 * 803 811 * -- exception type/address block 812 * 804 813 * -- exception explanation 814 * 805 815 * -- process information 806 816 * … … 890 900 { 891 901 /* From the VAC++3 docs: 892 * "The first thing an exception handler should do is check the 893 * exception flags. If EH_EXIT_UNWIND is set, meaning 894 * the thread is ending, the handler tells the operating system 895 * to pass the exception to the next exception handler. It does the 896 * same if the EH_UNWINDING flag is set, the flag that indicates 897 * this exception handler is being removed. 898 * The EH_NESTED_CALL flag indicates whether the exception 899 * occurred within an exception handler. If the handler does 900 * not check this flag, recursive exceptions could occur until 901 * there is no stack remaining." 902 * So for all these conditions, we exit immediately. 902 * "The first thing an exception handler should do is check the 903 * exception flags. If EH_EXIT_UNWIND is set, meaning 904 * the thread is ending, the handler tells the operating system 905 * to pass the exception to the next exception handler. It does the 906 * same if the EH_UNWINDING flag is set, the flag that indicates 907 * this exception handler is being removed. 908 * The EH_NESTED_CALL flag indicates whether the exception 909 * occurred within an exception handler. If the handler does 910 * not check this flag, recursive exceptions could occur until 911 * there is no stack remaining." 912 * 913 * So for all these conditions, we exit immediately. 903 914 */ 904 915 905 916 if (pReportRec->fHandlerFlags & EH_EXIT_UNWIND) 906 return (XCPT_CONTINUE_SEARCH);917 return XCPT_CONTINUE_SEARCH; 907 918 if (pReportRec->fHandlerFlags & EH_UNWINDING) 908 return (XCPT_CONTINUE_SEARCH);919 return XCPT_CONTINUE_SEARCH; 909 920 if (pReportRec->fHandlerFlags & EH_NESTED_CALL) 910 return (XCPT_CONTINUE_SEARCH);921 return XCPT_CONTINUE_SEARCH; 911 922 912 923 switch (pReportRec->ExceptionNum) … … 920 931 { 921 932 // "real" exceptions: 922 FILE *file ;933 FILE *file = NULL; 923 934 924 935 // open traplog file; 925 936 if (G_pfnExcOpenFile) 926 937 // hook defined for this: call it 927 file = (*G_pfnExcOpenFile)();938 file = G_pfnExcOpenFile(); 928 939 else 929 940 { … … 933 944 // boot drive 934 945 sprintf(szFileName, "%c:\\trap.log", doshQueryBootDrive()); 935 file = fopen(szFileName, "a"); 936 937 if (file) 946 947 if (file = fopen(szFileName, "a")) 938 948 { 939 949 DATETIME DT; … … 948 958 } 949 959 950 // write error log 951 excExplainException(file, 952 "excHandlerLoud", 953 pReportRec, 954 pContextRec); 955 fclose(file); 960 if (file) 961 { 962 // write error log 963 excExplainException(file, 964 "excHandlerLoud", 965 pReportRec, 966 pContextRec); 967 fclose(file); 968 } 956 969 957 970 // copy report rec to user buffer … … 963 976 // jump back to failing routine 964 977 longjmp(pRegRec2->jmpThread, pReportRec->ExceptionNum); 965 break; } 978 } 979 break; 966 980 } 967 981 968 982 // not handled 969 return (XCPT_CONTINUE_SEARCH);983 return XCPT_CONTINUE_SEARCH; 970 984 } 971 985 … … 997 1011 { 998 1012 if (pReportRec->fHandlerFlags & EH_EXIT_UNWIND) 999 return (XCPT_CONTINUE_SEARCH);1013 return XCPT_CONTINUE_SEARCH; 1000 1014 if (pReportRec->fHandlerFlags & EH_UNWINDING) 1001 return (XCPT_CONTINUE_SEARCH);1015 return XCPT_CONTINUE_SEARCH; 1002 1016 if (pReportRec->fHandlerFlags & EH_NESTED_CALL) 1003 return (XCPT_CONTINUE_SEARCH);1017 return XCPT_CONTINUE_SEARCH; 1004 1018 1005 1019 switch (pReportRec->ExceptionNum) … … 1033 1047 longjmp(pRegRec2->jmpThread, pReportRec->ExceptionNum); 1034 1048 break; 1035 1036 default:1037 break;1038 1049 } 1039 1050 1040 return (XCPT_CONTINUE_SEARCH);1051 return XCPT_CONTINUE_SEARCH; 1041 1052 } 1042 1053
Note:
See TracChangeset
for help on using the changeset viewer.