#include <rtl.h>
#include <debug.h>
Go to the source code of this file.
◆ NDEBUG
◆ _dump_context()
Definition at line 203 of file exception.c.
204{
205#ifdef _M_IX86
206
207
208
213 DbgPrint(
"EDX: %.8x EBP: %.8x ESI: %.8x ESP: %.8x\n", pc->
Edx,
216#elif defined(_M_AMD64)
220 DbgPrint(
"RAX: %I64x RBX: %I64x RCX: %I64x RDI: %I64x\n", pc->Rax, pc->Rbx, pc->Rcx, pc->Rdi);
221 DbgPrint(
"RDX: %I64x RBP: %I64x RSI: %I64x RSP: %I64x\n", pc->Rdx, pc->Rbp, pc->Rsi, pc->Rsp);
222 DbgPrint(
"R8: %I64x R9: %I64x R10: %I64x R11: %I64x\n", pc->
R8, pc->
R9, pc->
R10, pc->
R11);
223 DbgPrint(
"R12: %I64x R13: %I64x R14: %I64x R15: %I64x\n", pc->
R12, pc->R13, pc->R14, pc->R15);
225#elif defined(_M_ARM)
227 DbgPrint(
"R0: %lx R1: %lx R2: %lx R3: %lx\n", pc->
R0, pc->
R1, pc->
R2, pc->
R3);
228 DbgPrint(
"R4: %lx R5: %lx R6: %lx R7: %lx\n", pc->
R4, pc->
R5, pc->
R6, pc->
R7);
231#else
232#pragma message ("Unknown architecture")
233#endif
234}
Referenced by PrintStackTrace().
◆ _module_name_from_addr()
Definition at line 178 of file exception.c.
180{
181#if 0
185 {
186 psz[0] = '\0';
187 *module_start_addr = 0;
188 }
189 else
190 {
192 }
193 return psz;
194#else
195 psz[0] = '\0';
196 *module_start_addr = 0;
197 return psz;
198#endif
199}
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
GLenum const GLvoid * addr
SIZE_T NTAPI VirtualQuery(IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
Referenced by PrintStackTrace().
◆ PrintStackTrace()
Definition at line 237 of file exception.c.
238{
240 CHAR szMod[128] =
"";
243
244
247
250 {
252 }
253
254
257 {
259 }
260
263 DbgPrint(
"Address:\n %8x+%-8x %s\n",
266 szMod);
267#ifdef _M_IX86
269
271 {
274
275 for (
i = 0; Frame[1] != 0 && Frame[1] != 0xdeadbeef &&
i < 128;
i++)
276 {
277
278 if (Frame[1] == 0)
279 {
280 DbgPrint(
" %8x%9s %s\n", Frame[1],
"<invalid address>",
" ");
281 }
282 else
283 {
285 szMod, sizeof(szMod));
289 szMod);
290 }
291
292 if (Frame[0] == 0) break;
293
294
295
296 Frame = (
PULONG) Frame[0];
297 }
298 }
300 {
302 }
304#endif
305}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define EXCEPTION_EXECUTE_HANDLER
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
#define STATUS_ACCESS_VIOLATION
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
static const char * _module_name_from_addr(const void *addr, void **module_start_addr, char *psz, size_t nChars)
static VOID _dump_context(PCONTEXT pc)
PEXCEPTION_RECORD ExceptionRecord
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
Referenced by RtlUnhandledExceptionFilter(), and RtlUnhandledExceptionFilter2().
◆ RtlCaptureStackBackTrace()
Definition at line 133 of file exception.c.
137{
138 PVOID Frames[2 * 64];
141
142
143 FramesToSkip++;
144
145
147
148
150
151
152 if (FrameCount <= FramesToSkip) return 0;
153
154
156 {
157
158 if ((FramesToSkip +
i) >= FrameCount)
break;
159
160
161 BackTrace[
i] = Frames[FramesToSkip +
i];
163 }
164
165
167
168
171}
ULONG NTAPI RtlWalkFrameChain(OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags)
static int Hash(const char *)
_In_ ULONG FramesToCapture
_In_ ULONG _Out_opt_ PULONG BackTraceHash
#define RtlFillMemoryUlong(dst, len, val)
◆ RtlRaiseException()
Definition at line 32 of file exception.c.
33{
36
37
39
40
42
43
45
46
48 {
49
51 }
52 else
53 {
54
56 {
57
59 }
60 else
61 {
62
64 }
65 }
66
67
69}
BOOLEAN NTAPI RtlpCheckForActiveDebugger(VOID)
NTSYSAPI NTSTATUS NTAPI ZwContinue(_In_ PCONTEXT Context, _In_ BOOLEAN TestAlert)
NTSYSAPI NTSTATUS NTAPI ZwRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PCONTEXT Context, _In_ BOOLEAN SearchFrames)
NTSYSAPI BOOLEAN NTAPI RtlDispatchException(_In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PCONTEXT Context)
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
VOID NTAPI RtlRaiseStatus(IN NTSTATUS Status)
◆ RtlRaiseStatus()
Definition at line 85 of file exception.c.
86{
89
90
92
93
99
100
102
103
105 {
106
108 }
109 else
110 {
111
113
114
116 }
117
118
120}
struct _EXCEPTION_RECORD * ExceptionRecord
#define EXCEPTION_NONCONTINUABLE
Referenced by RtlRaiseException(), and RtlRaiseStatus().
◆ RtlSetUnhandledExceptionFilter()
Definition at line 341 of file exception.c.
342{
343
345}
NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID)
PRTLP_UNHANDLED_EXCEPTION_FILTER RtlpUnhandledExceptionFilter
Referenced by LdrpInitializeProcess().
◆ RtlUnhandledExceptionFilter()
◆ RtlUnhandledExceptionFilter2()
◆ RtlpUnhandledExceptionFilter