guard dumping the stack trace to prevent infinite exception loops Modified: trunk/reactos/lib/kernel32/except/except.c _____
Modified: trunk/reactos/lib/kernel32/except/except.c --- trunk/reactos/lib/kernel32/except/except.c 2005-05-05 13:27:00 UTC (rev 15000) +++ trunk/reactos/lib/kernel32/except/except.c 2005-05-05 15:38:32 UTC (rev 15001) @@ -171,23 +171,31 @@
_dump_context ( ExceptionInfo->ContextRecord ); #ifdef _X86_ DbgPrint("Frames:\n"); - Frame = (PULONG)ExceptionInfo->ContextRecord->Ebp; - while (Frame[1] != 0 && Frame[1] != 0xdeadbeef) + _SEH_TRY { - if (IsBadReadPtr((PVOID)Frame[1], 4)) { - DbgPrint(" %8x%9s %s\n", Frame[1], "<invalid address>"," "); - } else { - _module_name_from_addr((const void*)Frame[1], &StartAddr, - szMod, sizeof(szMod)); - DbgPrint(" %8x+%-8x %s\n", - (PVOID)StartAddr, - (ULONG_PTR)Frame[1] - (ULONG_PTR)StartAddr, szMod); + Frame = (PULONG)ExceptionInfo->ContextRecord->Ebp; + while (Frame[1] != 0 && Frame[1] != 0xdeadbeef) + { + if (IsBadReadPtr((PVOID)Frame[1], 4)) { + DbgPrint(" %8x%9s %s\n", Frame[1], "<invalid address>"," "); + } else { + _module_name_from_addr((const void*)Frame[1], &StartAddr, + szMod, sizeof(szMod)); + DbgPrint(" %8x+%-8x %s\n", + (PVOID)StartAddr, + (ULONG_PTR)Frame[1] - (ULONG_PTR)StartAddr, szMod); + } + if (IsBadReadPtr((PVOID)Frame[0], sizeof(*Frame) * 2)) { + break; + } + Frame = (PULONG)Frame[0]; } - if (IsBadReadPtr((PVOID)Frame[0], sizeof(*Frame) * 2)) { - break; - } - Frame = (PULONG)Frame[0]; } + _SEH_HANDLE + { + DbgPrint("<error dumping stack trace: 0x%x>\n", _SEH_GetExceptionCode()); + } + _SEH_END; #endif }