Changeset 2204
- Timestamp:
- Jul 4, 2005, 3:17:39 AM (20 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/ChangeLog.LIBC
-
Property cvs2svn:cvs-rev
changed from
1.96
to1.97
r2203 r2204 1 1 /* $Id$ */ 2 3 2005-07-03: knut st. osmundsen <bird-gccos2-spam@anduin.net> 4 - libc: 5 o Collected the different panic routines into one single routine 6 in the backend, __libc_Back_panic[V](). The routine supports 7 very simple printf like message formatting. By default it wil 8 dump any available registers and attempt dumping the process 9 before killing it. This behaviour can be configured with the 10 env var.: LIBC_PANIC=[nodump][terse][quiet][breakpoint] 2 11 3 12 2005-07-02: knut st. osmundsen <bird-gccos2-spam@anduin.net> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/backend.h
-
Property cvs2svn:cvs-rev
changed from
1.25
to1.26
r2203 r2204 38 38 #include <signal.h> 39 39 #include <emx/io.h> 40 #include <stdarg.h> 40 41 41 42 … … 1040 1041 /** @} */ 1041 1042 1043 1044 /** @defgroup grp_Back_panic LIBC Backend - Panic Routines 1045 * @{ */ 1046 1047 /** The panic was caused by a signal. Drop the LIBC PANIC line. */ 1048 #define __LIBC_PANIC_SIGNAL 1 1049 /** Don't set the SPM termination code / status. When set the caller is 1050 * responsible for doing this. */ 1051 #define __LIBC_PANIC_NO_SPM_TERM 2 1052 1053 /** 1054 * Print a panic message and dump/kill the process. 1055 * 1056 * @param fFlags A combination of the __LIBC_PANIC_* defines. 1057 * @param pvCtx Pointer to a context record if available. This is a PCONTEXTRECORD. 1058 * @param pszFormat User message which may contain %s and %x. 1059 * @param ... String pointers and unsigned intergers as specified by the %s and %x in pszFormat. 1060 */ 1061 void __libc_Back_panic(unsigned fFlags, void *pvCtx, const char *pszFormat, ...) __attribute__((__noreturn__)); 1062 1063 /** 1064 * Print a panic message and dump/kill the process. 1065 * 1066 * @param fFlags A combination of the __LIBC_PANIC_* defines. 1067 * @param pvCtx Pointer to a context record if available. This is a PCONTEXTRECORD. 1068 * @param pszFormat User message which may contain %s and %x. 1069 * @param args String pointers and unsigned intergers as specified by the %s and %x in pszFormat. 1070 */ 1071 void __libc_Back_panicV(unsigned fFlags, void *pvCtx, const char *pszFormat, va_list args) __attribute__((__noreturn__)); 1072 1073 /* @} */ 1074 1042 1075 __END_DECLS 1043 1076 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/umalloc.h
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r2203 r2204 807 807 808 808 809 static __inline__ void _um_abort (const char *pszmsg) 810 { 811 /* Use the 'syscall' write for safest possible path. */ 812 extern int __write (int handle, const void *buf, size_t nbytes); 813 __write (2, "\r\n!_um_abort!", 13); 814 if (pszmsg) 815 { 816 const char *psz = pszmsg; 817 while (*psz) 818 psz++; 819 __write (2, " ", 1); 820 __write (2, pszmsg, psz - pszmsg); 821 } 822 __write (2, "\r\n", 2); 823 __asm__ __volatile__ ("int $3"); 824 } 825 809 void _um_abort (const char *, ...) __attribute__((__noreturn__)); 826 810 827 811 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/libc.def
-
Property cvs2svn:cvs-rev
changed from
1.130
to1.131
r2203 r2204 1917 1917 "__ufc_output_conversion_r" @1916 1918 1918 "__ufc_setup_salt_r" @1917 1919 "___libc_Back_panic" @1918 1920 "___libc_Back_panicV" @1919 1921 "__um_abort" @1920 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/_hinitheap.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r2203 r2204 90 90 if (!pvInitial) 91 91 { 92 abort();92 _um_abort("_hinitheap: __libc_HimemDefaultAlloc failed!\n"); 93 93 return NULL; 94 94 } … … 103 103 if (Heap == NULL) 104 104 { 105 abort();105 _um_abort("_hinitheap: _ucreate2 failed!\n"); 106 106 return NULL; 107 107 } 108 108 if (_uopen(Heap) != 0) 109 109 { 110 abort();110 _um_abort("_hinitheap: _uopen(%p) failed!\n", Heap); 111 111 return NULL; 112 112 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/_linitheap.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r2203 r2204 75 75 if (pvInitial == (void *)-1) 76 76 { 77 abort();77 _um_abort("_linitheap: sbrk failed!\n"); 78 78 return NULL; 79 79 } … … 88 88 if (Heap == NULL) 89 89 { 90 abort();90 _um_abort("_linitheap: _ucreate2 failed!\n"); 91 91 return NULL; 92 92 } 93 93 if (_uopen(Heap) != 0) 94 94 { 95 abort();95 _um_abort("_linitheap: _uopen(%p) failed!\n", Heap); 96 96 return NULL; 97 97 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/ifree.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r2203 r2204 40 40 if (*patch == NULL) 41 41 { 42 _um_abort ("Corrupt heap? (Patch not found.)"); 42 _um_abort ("_um_crate_free: patch not found! patch=%p crate=%p crateset=%p\n", 43 patch, crate, crateset); 43 44 return; 44 45 } … … 126 127 if (_UM_HDR_STATUS (hdr) == _UMS_FREE) 127 128 { 128 _um_abort ("Tried to free block twice! (free)"); 129 _um_abort ("_um_free_maybe_lock: Tried to free block twice - block=%p lock=%d\n", 130 block, lock); 129 131 return; 130 132 } … … 141 143 break; 142 144 default: 143 _um_abort ("Corrupt heap or passing wrong pointer to free! (bad parent magic)"); 145 _um_abort ("_um_free_maybe_lock: bad parent magic %x, parent=%p block=%p lock=%d\n", 146 *parent, parent, block, lock); 144 147 return; 145 148 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/imisc.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r2203 r2204 9 9 #include <sys/fmutex.h> 10 10 #include <emx/umalloc.h> 11 #include <InnoTekLIBC/backend.h> 11 12 12 13 /* Leave FLS undefined if __fls() is not available. __fls() is … … 33 34 if (_UM_BUCKET_SIZE (bucket) <= rsize) 34 35 return bucket; 35 abort ();/* RSIZE is probably not rounded! */36 _um_abort ("_um_find_bucked: rsize=%x\n", rsize); /* RSIZE is probably not rounded! */ 36 37 #endif 37 38 } … … 162 163 _um_lump_link_heap (h, lump); 163 164 } 165 166 167 void _um_abort (const char *pszMsg, ...) 168 { 169 va_list args; 170 va_start(args, pszMsg); 171 __libc_Back_panicV(0, NULL, pszMsg, args); 172 va_end(args); 173 } 174 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/irealloc.c
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r2203 r2204 316 316 if (_UM_HDR_STATUS (hdr) == _UMS_FREE) 317 317 { 318 _um_abort ("Tried to free block twice! (realloc)"); 318 _um_abort ("_um_free_maybe_lock: Tried to reallocate freed block - block=%p new_size=%x align=%x flags=%x\n", 319 block, new_size, align, flags); 319 320 errno = EINVAL; 320 321 return NULL; … … 337 338 default: 338 339 { 339 _um_abort ("Corrupt heap or passing wrong pointer to realloc! (bad parent magic)"); 340 _um_abort ("_um_realloc: bad parent magic %x, parent=%p block=%p new_size=%x align=%x flags=%x\n", 341 *parent, parent, block, new_size, align, flags); 340 342 errno = EINVAL; 341 343 return NULL; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uheapmin.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r2203 r2204 64 64 } 65 65 else 66 abort ();66 _um_abort ("_uheapmin: shrink_size=%x seg->size=%x\n", shrink_size, seg->size); 67 67 } 68 68 else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/fmutex.c
-
Property cvs2svn:cvs-rev
changed from
1.12
to1.13
r2203 r2204 17 17 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_MUTEX 18 18 #include <InnoTekLIBC/logstrict.h> 19 #include <InnoTekLIBC/backend.h> 19 20 20 21 /******************************************************************************* … … 308 309 } 309 310 310 static void __fmutex_deadlock_hex(unsigned u, unsigned cDigits)311 {312 static const char szHex[17] = "0123456789abcdef";313 ULONG cb;314 char sz[32];315 if (u <= 0xf && cDigits <= 1)316 {317 sz[0] = szHex[u & 0xf];318 sz[1] = '\0';319 cb = 1;320 }321 if (u <= 0xff && cDigits <= 2)322 {323 sz[0] = szHex[u >> 4];324 sz[1] = szHex[u & 0xf];325 sz[2] = '\0';326 cb = 2;327 }328 else if (u <= 0xffff && cDigits <= 4)329 {330 sz[0] = szHex[u >> 12];331 sz[1] = szHex[(u >> 8) & 0xf];332 sz[2] = szHex[(u >> 4) & 0xf];333 sz[3] = szHex[u & 0xf];334 sz[4] = '\0';335 cb = 4;336 }337 else338 {339 sz[0] = szHex[u >> 28];340 sz[1] = szHex[(u >> 24) & 0xf];341 sz[2] = szHex[(u >> 20) & 0xf];342 sz[3] = szHex[(u >> 16) & 0xf];343 sz[4] = szHex[(u >> 12) & 0xf];344 sz[5] = szHex[(u >> 8) & 0xf];345 sz[6] = szHex[(u >> 4) & 0xf];346 sz[7] = szHex[u & 0xf];347 sz[8] = '\0';348 cb = 8;349 }350 DosWrite(2, sz, cb, &cb);351 }352 353 311 static void __fmutex_deadlock(_fmutex *pSem, const char *pszMsg) 354 312 { 355 ULONG ul; 356 static const char szMsg[] = "\r\n!!!deadlock!!! fmutex "; 357 DosWrite(2, szMsg, sizeof(szMsg) - 1, &ul); 358 if (pSem->pszDesc) 359 DosWrite(2, pSem->pszDesc, strlen(pSem->pszDesc), &ul); 360 if (pszMsg) 361 { 362 DosWrite(2, ": ", 2, &ul); 363 DosWrite(2, pszMsg, strlen(pszMsg), &ul); 364 } 365 static const char szMsg2[] = "\r\nOwner=0x"; 366 DosWrite(2, szMsg2, sizeof(szMsg2) - 1, &ul); 367 __fmutex_deadlock_hex(pSem->Owner, 8); 368 static const char szMsg3[] = " Self=0x"; 369 DosWrite(2, szMsg3, sizeof(szMsg3) - 1, &ul); 370 __fmutex_deadlock_hex(fibGetTidPid(), 8); 371 static const char szMsg4[] = " fs=0x"; 372 DosWrite(2, szMsg4, sizeof(szMsg4) - 1, &ul); 373 __fmutex_deadlock_hex(pSem->fs, 2); 374 static const char szMsg5[] = "\r\n"; 375 DosWrite(2, szMsg5, sizeof(szMsg5) - 1, &ul); 376 377 __asm__ __volatile__("movl $0xdead10cc, %%eax; movl $0xdead10cc, %%edx; movl %0, %%ecx; int $3" : : "m" (pSem) : "%eax", "%edx", "%ecx"); 313 __libc_Back_panic(0, NULL, 314 "fmutex deadlock: %s\n" 315 "%x: Owner=%x Self=%x fs=%x flags=%x hev=%x\n" 316 " Desc=\"%s\"\n", 317 pszMsg, 318 pSem, pSem->Owner, fibGetTidPid(), pSem->fs, pSem->flags, pSem->hev, 319 pSem->pszDesc); 378 320 } 379 321 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/libcfork.c
-
Property cvs2svn:cvs-rev
changed from
1.13
to1.14
r2203 r2204 155 155 static int forkBthCallbacksCall(__LIBC_PFORKCALLBACK *papCallbacks, __LIBC_PFORKHANDLE pForkHandle, __LIBC_FORKOP enmOperation); 156 156 static void forkBthDumpMemFlags(void *pv); 157 static void forkChlFatalError(__LIBC_PFORKHANDLE pForkHandle, int rc ) __attribute__((__noreturn__));157 static void forkChlFatalError(__LIBC_PFORKHANDLE pForkHandle, int rc, void *pvCtx) __attribute__((__noreturn__)); 158 158 static ULONG _System forkChlExceptionHandler(PEXCEPTIONREPORTRECORD pXcptRepRec, 159 159 PEXCEPTIONREGISTRATIONRECORD pXcptRegRec, … … 1061 1061 PAG_READ | PAG_WRITE | PAG_COMMIT); 1062 1062 if (rc) 1063 forkChlFatalError(pForkHandle, -__libc_native2errno(rc) );1063 forkChlFatalError(pForkHandle, -__libc_native2errno(rc), NULL); 1064 1064 } 1065 1065 else … … 1118 1118 rc = forkBthBufferGiveWaitNext(pForkHandle, __LIBC_FORK_CTX_CHILD); 1119 1119 if (rc < 0) 1120 forkChlFatalError(pForkHandle, rc );1120 forkChlFatalError(pForkHandle, rc, NULL); 1121 1121 1122 1122 /* … … 1130 1130 LIBC_ASSERTM(pModules, "No fork modules in child process!!!!\n"); 1131 1131 if (!pModules) 1132 forkChlFatalError(pForkHandle, -EDOOFUS );1132 forkChlFatalError(pForkHandle, -EDOOFUS, NULL); 1133 1133 1134 1134 /* … … 1137 1137 rc = forkChlRunForkChild(pForkHandle, pModules); 1138 1138 if (rc < 0) 1139 forkChlFatalError(pForkHandle, rc );1139 forkChlFatalError(pForkHandle, rc, NULL); 1140 1140 1141 1141 … … 2019 2019 rc = pHdr->u.Abort.err; 2020 2020 if (enmCtx == __LIBC_FORK_CTX_CHILD) 2021 forkChlFatalError(pForkHandle, rc );2021 forkChlFatalError(pForkHandle, rc, NULL); 2022 2022 break; 2023 2023 … … 2510 2510 * @param pForkHandle Pointer to fork handle. 2511 2511 * @param rc The return code (negative) which caused the failure. 2512 */ 2513 void forkChlFatalError(__LIBC_PFORKHANDLE pForkHandle, int rc) 2514 { 2515 LIBCLOG_ENTER("pForkHandle=%p rc=%d\n", (void *)pForkHandle, rc); 2516 static const char szMsg[] = "LIBC Error: Child aborting fork()!\r\n"; 2517 ULONG cbWritten; 2512 * @param pvCtx Context if available. 2513 */ 2514 void forkChlFatalError(__LIBC_PFORKHANDLE pForkHandle, int rc, void *pvCtx) 2515 { 2516 LIBCLOG_ENTER("pForkHandle=%p rc=%d pvCtx=%p\n", (void *)pForkHandle, rc, pvCtx); 2518 2517 PID pid; 2519 2518 TID tid; … … 2569 2568 * Exit process. 2570 2569 */ 2571 DosWrite(2, szMsg, sizeof(szMsg) - 1, &cbWritten); 2572 for (;;) 2573 { 2574 LIBCLOG_MSG("Calling DosExit(EXIT_PROCESS, 0xffff)...\n"); 2575 DosExit(EXIT_PROCESS, /*fixme*/0xffff); 2576 } 2570 __libc_Back_panic(__LIBC_PANIC_NO_SPM_TERM, pvCtx, "LIBC fork: Child aborting fork()! rc=%x\n", rc); 2577 2571 } 2578 2572 … … 2755 2749 { 2756 2750 DosPostEventSem(pForkHandle->hevParent); 2757 forkChlFatalError(pForkHandle, -EINTR );2751 forkChlFatalError(pForkHandle, -EINTR, pCtx); 2758 2752 } 2759 2753 break; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sharedpm.c
-
Property cvs2svn:cvs-rev
changed from
1.30
to1.31
r2203 r2204 3805 3805 { 3806 3806 /* 3807 * This isn't wrong just unlikely and must be ignored!3807 * This isn't wrong, just unlikely and must be ignored! 3808 3808 */ 3809 3809 case XCPT_ASYNC_PROCESS_TERMINATE: … … 3891 3891 spmCheck(1, 1); 3892 3892 #endif 3893 __libc_Back_panic(__LIBC_PANIC_NO_SPM_TERM, pCtx, 3894 "SPM Exception %x (%x,%x,%x,%x)%s\n", 3895 pRepRec->ExceptionNum, 3896 pRepRec->ExceptionInfo[0], 3897 pRepRec->ExceptionInfo[1], 3898 pRepRec->ExceptionInfo[2], 3899 pRepRec->ExceptionInfo[3], 3900 !rc && pPib->pib_ulpid == pid && pTib->tib_ptib2->tib2_ultid == tid ? " - Owner of the mutex" : ""); 3893 3901 return XCPT_CONTINUE_SEARCH; 3894 3902 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/signals.c
-
Property cvs2svn:cvs-rev
changed from
1.28
to1.29
r2203 r2204 1893 1893 1894 1894 /* 1895 * Kill process / dump core (no cores for LIBC!).1895 * Kill process / dump core. 1896 1896 */ 1897 1897 case SPA_NEXT_KILL: … … 2078 2078 2079 2079 /** 2080 * Calculates the length of a string.2081 * @returns String length in bytes.2082 * @param psz Pointer to the string.2083 */2084 static size_t signalTerminateStrLen(const char *psz)2085 {2086 const char *pszEnd = psz;2087 while (*pszEnd)2088 pszEnd++;2089 return pszEnd - psz;2090 }2091 2092 2093 /**2094 * Termination time hex formatter.2095 *2096 * @returns number of bytes formatted.2097 * @param pszBuf Where to store the formatted number.2098 * @param u Number to format.2099 * @param cDigits Minimum number of digits in the output. Use 0 for whatever fits.2100 */2101 static int signalTerminateHex(char *pszBuf, unsigned u, unsigned cDigits)2102 {2103 static const char szHex[17] = "0123456789abcdef";2104 if (u <= 0xf && cDigits <= 1)2105 {2106 pszBuf[0] = szHex[u & 0xf];2107 pszBuf[1] = '\0';2108 return 1;2109 }2110 if (u <= 0xff && cDigits <= 2)2111 {2112 pszBuf[0] = szHex[u >> 4];2113 pszBuf[1] = szHex[u & 0xf];2114 pszBuf[2] = '\0';2115 return 2;2116 }2117 else if (u <= 0xffff && cDigits <= 4)2118 {2119 pszBuf[0] = szHex[u >> 12];2120 pszBuf[1] = szHex[(u >> 8) & 0xf];2121 pszBuf[2] = szHex[(u >> 4) & 0xf];2122 pszBuf[3] = szHex[u & 0xf];2123 pszBuf[4] = '\0';2124 return 4;2125 }2126 else2127 {2128 pszBuf[0] = szHex[u >> 28];2129 pszBuf[1] = szHex[(u >> 24) & 0xf];2130 pszBuf[2] = szHex[(u >> 20) & 0xf];2131 pszBuf[3] = szHex[(u >> 16) & 0xf];2132 pszBuf[4] = szHex[(u >> 12) & 0xf];2133 pszBuf[5] = szHex[(u >> 8) & 0xf];2134 pszBuf[6] = szHex[(u >> 4) & 0xf];2135 pszBuf[7] = szHex[u & 0xf];2136 pszBuf[8] = '\0';2137 return 8;2138 }2139 }2140 2141 2142 /**2143 2080 * Cause immediate process termination because of the given signal. 2144 2081 * … … 2150 2087 { 2151 2088 LIBCLOG_ENTER("iSignalNo=%d\n", iSignalNo); 2089 2152 2090 /* 2153 2091 * Set the exit reason in SPM. … … 2156 2094 2157 2095 /* 2158 * Before we go crazy here, let's release the semaphore. 2159 * 2160 * If possible we'll stay in the must complete section to 2161 * be sure we get to the exit. If not we'll have to mess with 2162 * exception handlers and such now. 2163 */ 2164 //if (__libc_back_signalSemIsOwner()) 2165 // DosReleaseMutexSem(ghmtxSignals); 2166 2167 /* 2168 * Terminate the exception handler chain to avoid recursive trouble. 2169 */ 2170 FS_VAR(); 2171 FS_SAVE_LOAD(); 2172 PTIB pTib; 2173 PPIB pPib; 2174 DosGetInfoBlocks(&pTib, &pPib); 2175 pTib->tib_pexchain = END_OF_CHAIN; 2176 2177 /* 2178 * Write message to stderr. 2179 */ 2180 ULONG cb; 2181 char szHexNum[12]; 2182 #define SIG_PRINT_C(msg) DosWrite(HFILE_STDERR, msg, sizeof(msg) - 1, &cb) 2183 #define SIG_PRINT_P(msg) DosWrite(HFILE_STDERR, msg, signalTerminateStrLen(msg), &cb) 2184 #define SIG_PRINT_H(hex) DosWrite(HFILE_STDERR, szHexNum, signalTerminateHex(szHexNum, hex, 0), &cb) 2185 #define SIG_PRINT_H16(hex) DosWrite(HFILE_STDERR, szHexNum, signalTerminateHex(szHexNum, hex, 4), &cb) 2186 #define SIG_PRINT_H32(hex) DosWrite(HFILE_STDERR, szHexNum, signalTerminateHex(szHexNum, hex, 8), &cb) 2187 if (iSignalNo == SIGABRT) 2188 SIG_PRINT_C("\n\rAbnormal program termination"); 2096 * Panic 2097 */ 2098 PCONTEXTRECORD pCtx = pvXcptParams ? pCtx = ((PEXCPTPARAMS)pvXcptParams)->pCtx : NULL; 2099 if (iSignalNo < sizeof(gaszSignalNames) / sizeof(gaszSignalNames[0])) 2100 __libc_Back_panic(__LIBC_PANIC_SIGNAL | __LIBC_PANIC_NO_SPM_TERM, pCtx, "Killed by %s\n", gaszSignalNames[iSignalNo]); 2189 2101 else 2190 { 2191 SIG_PRINT_C("\n\rProcess terminated by "); 2192 2193 if (iSignalNo < sizeof(gaszSignalNames) / sizeof(gaszSignalNames[0])) 2194 SIG_PRINT_P(gaszSignalNames[iSignalNo]); 2195 else 2196 { 2197 SIG_PRINT_C("unknown signal "); 2198 SIG_PRINT_H(iSignalNo); 2199 } 2200 } 2201 2202 /* pid */ 2203 SIG_PRINT_C(" - pid=0x"); SIG_PRINT_H16(pPib->pib_ulpid); 2204 2205 /* tid */ 2206 SIG_PRINT_C(" - tid=0x"); SIG_PRINT_H16(pTib->tib_ptib2->tib2_ultid); 2207 2208 /* executable name. */ 2209 static char szExeName[CCHMAXPATH]; 2210 if (!DosQueryModuleName(pPib->pib_hmte, sizeof(szExeName), &szExeName[0])) 2211 { 2212 static const char szHypen[] = " - "; 2213 DosWrite(HFILE_STDERR, szHypen, sizeof(szHypen) - 1, &cb); 2214 2215 for (cb = 0; szExeName[cb];) 2216 cb++; 2217 DosWrite(HFILE_STDERR, szExeName, cb, &cb); 2218 } 2219 2220 /* eip */ 2221 PCONTEXTRECORD pCtx; 2222 if ( pvXcptParams 2223 && (pCtx = ((PEXCPTPARAMS)pvXcptParams)->pCtx)) 2224 { 2225 SIG_PRINT_C("\r\ncs:eip="); 2226 SIG_PRINT_H16(pCtx->ctx_SegCs); 2227 SIG_PRINT_C(":"); 2228 SIG_PRINT_H32(pCtx->ctx_RegEip); 2229 if (pCtx->ctx_RegEip >= 0x10000) 2230 { 2231 HMODULE hmod; 2232 ULONG iObj = 0; 2233 ULONG offObj = 0; 2234 if (!DosQueryModFromEIP(&hmod, &iObj, sizeof(szExeName), szExeName, &offObj, pCtx->ctx_RegEip)) 2235 { 2236 SIG_PRINT_C(" - "); 2237 SIG_PRINT_H(iObj); 2238 SIG_PRINT_C(":"); 2239 SIG_PRINT_H32(offObj); 2240 SIG_PRINT_C(" "); 2241 SIG_PRINT_P(szExeName); 2242 } 2243 } 2244 } 2245 2246 /* final newline */ 2247 SIG_PRINT_C("\r\n"); 2248 2249 /* 2250 * Terminate the process. 2251 */ 2252 LIBCLOG_MSG("Calling DosKillProcess()\n"); 2253 for (;;) 2254 { 2255 DosKillProcess(DKP_PROCESS, fibGetPid()); 2256 DosExit(EXIT_PROCESS, 127); 2257 } 2102 __libc_Back_panic(__LIBC_PANIC_SIGNAL | __LIBC_PANIC_NO_SPM_TERM, pCtx, "Killed by unknown signal %d\n", iSignalNo); 2103 LIBCLOG_MSG("panic failed\n"); /* shuts up gcc */ 2104 asm("int3"); 2258 2105 } 2259 2106 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.