summaryrefslogtreecommitdiffstats
path: root/private/ntos/rtl/i386/rtldump.c
blob: a75c27353df2d27df987ab0b9d314003dce2f5ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*++

Copyright (c) 1990  Microsoft Corporation

Module Name:

    rtldump.c

Abstract:

    This module implements dump procedures for:

	ContextRecords,
	ExceptionReportRecords,
	ExceptionRegistrationRecords

Author:

    Bryan Willman (bryanwi)  12 April 90

Environment:

    Callable in any mode in which DbgPrint works.

Revision History:

--*/

#include    "ntrtlp.h"

VOID
RtlpContextDump(
    IN PVOID Object,
    IN ULONG Control OPTIONAL
    )
/*++

Routine Description:

    This function dumps the contents of a context record.

    Currently, it does not dump floating point context.

Arguments:

    Object - Address of the record to dump.

    Control - Ignored, here so we look like a standard dump procedure.

Return Value:

    none

--*/

{
    PCONTEXT	Context;

    Context = (PCONTEXT)Object;

    DbgPrint("      Record @ %lx\n", (ULONG)Context);
    DbgPrint(" ContextFlags: %lx\n", Context->ContextFlags);
    DbgPrint("\n");

    DbgPrint("        SegGs: %lx\n", Context->SegGs);
    DbgPrint("        SegFs: %lx\n", Context->SegFs);
    DbgPrint("        SegEs: %lx\n", Context->SegEs);
    DbgPrint("        SegDs: %lx\n", Context->SegDs);
    DbgPrint("\n");

    DbgPrint("          Edi: %lx\n", Context->Edi);
    DbgPrint("          Esi: %lx\n", Context->Esi);
    DbgPrint("          Ebx: %lx\n", Context->Ebx);
    DbgPrint("          Edx: %lx\n", Context->Edx);
    DbgPrint("          Ecx: %lx\n", Context->Ecx);
    DbgPrint("          Eax: %lx\n", Context->Eax);
    DbgPrint("\n");

    DbgPrint("          Ebp: %lx\n", Context->Ebp);
    DbgPrint("          Eip: %lx\n", Context->Eip);
    DbgPrint("        SegCs: %lx\n", Context->SegCs);
    DbgPrint("       EFlags: %lx\n", Context->EFlags);
    DbgPrint("          Esp: %lx\n", Context->Esp);
    DbgPrint("        SegSs: %lx\n", Context->SegSs);
    DbgPrint("\n");

    return;
}



VOID
RtlpExceptionReportDump(
    IN PVOID Object,
    IN ULONG Control OPTIONAL
    )
/*++

Routine Description:

    This function dumps the contents of an Exception report record.

Arguments:

    Object - Address of the record to dump.

    Control - Ignored, here so we look like a standard dump procedure.

Return Value:

    none

--*/

{
    ULONG i;

    PEXCEPTION_RECORD	Exception;

    Exception = (PEXCEPTION_RECORD)Object;

    DbgPrint("                Record @ %lx\n", (ULONG)Exception);
    DbgPrint("          ExceptionCode: %lx\n", Exception->ExceptionCode);
    DbgPrint("         ExceptionFlags: %lx\n", Exception->ExceptionFlags);
    DbgPrint("        ExceptionRecord: %lx\n", Exception->ExceptionRecord);
    DbgPrint("       ExceptionAddress: %lx\n", Exception->ExceptionAddress);
    DbgPrint("       NumberParameters: %lx\n", Exception->NumberParameters);
    for (i = 0; i < Exception->NumberParameters; i++)
	DbgPrint("ExceptionInformation[%d]: %lx\n",
		 i, Exception->ExceptionInformation[i]);
    DbgPrint("\n");
    return;
}



VOID
RtlpExceptionRegistrationDump(
    IN PVOID Object,
    IN ULONG Control OPTIONAL
    )
/*++

Routine Description:

    This function dumps the contents of an exception registration record,
    unless Object == NULL, in which case it dumps the entire registration
    chain.

    Currently, it does not dump floating point context.

Arguments:

    Object - Address of the record to dump.

    Control - Ignored, here so we look like a standard dump procedure.

Return Value:

    none

--*/

{
    PEXCEPTION_REGISTRATION_RECORD RegistrationPointer;

    RegistrationPointer = (PEXCEPTION_REGISTRATION_RECORD)Object;

    if (RegistrationPointer != EXCEPTION_CHAIN_END) {
	DbgPrint("Record @ %lx\n", (ULONG)RegistrationPointer);
	DbgPrint("   Next: %lx\n", RegistrationPointer->Next);
	DbgPrint("Handler: %lx\n", RegistrationPointer->Handler);
	DbgPrint("\n");
    } else {
	RegistrationPointer = RtlpGetRegistrationHead();

	while (RegistrationPointer != EXCEPTION_CHAIN_END) {
	    DbgPrint("Record @ %lx\n", (ULONG)RegistrationPointer);
	    DbgPrint("   Next: %lx\n", RegistrationPointer->Next);
	    DbgPrint("Handler: %lx\n", RegistrationPointer->Handler);
	    DbgPrint("\n");
	}
    }
    return;
}