forked from TheSuperHackers/GeneralsGameCode
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathStackDump.cpp
More file actions
641 lines (545 loc) · 19.4 KB
/
Copy pathStackDump.cpp
File metadata and controls
641 lines (545 loc) · 19.4 KB
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
#if defined(RTS_DEBUG) || defined(IG_DEBUG_STACKTRACE)
#pragma pack(push, 8)
#include "Common/StackDump.h"
#include "Common/Debug.h"
#include "DbgHelpLoader.h"
//*****************************************************************************
// Prototypes
//*****************************************************************************
BOOL InitSymbolInfo();
void MakeStackTrace(DWORD myeip,DWORD myesp,DWORD myebp, int skipFrames, void (*callback)(const char*));
void GetFunctionDetails(void *pointer, char*name, char*filename, unsigned int* linenumber, unsigned int* address);
void WriteStackLine(void*address, void (*callback)(const char*));
//*****************************************************************************
// Mis-named globals :-)
//*****************************************************************************
static CONTEXT gsContext;
//*****************************************************************************
//*****************************************************************************
void StackDumpDefaultHandler(const char*line)
{
DEBUG_LOG((line));
}
//*****************************************************************************
//*****************************************************************************
void StackDump(void (*callback)(const char*))
{
if (callback == nullptr)
{
callback = StackDumpDefaultHandler;
}
if (!InitSymbolInfo())
return;
DWORD myeip,myesp,myebp;
#if defined(_MSC_VER)
_asm
{
MYEIP1:
mov eax, MYEIP1
mov dword ptr [myeip] , eax
mov eax, esp
mov dword ptr [myesp] , eax
mov eax, ebp
mov dword ptr [myebp] , eax
}
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86))
// GCC/Clang inline assembly for x86-32
__asm__ __volatile__(
"call 1f\n\t"
"1: pop %0\n\t"
"mov %%esp, %1\n\t"
"mov %%ebp, %2"
: "=r"(myeip), "=r"(myesp), "=r"(myebp)
:
: "memory"
);
#else
#error "Unsupported compiler or architecture for register capture"
#endif
MakeStackTrace(myeip,myesp,myebp, 2, callback);
}
//*****************************************************************************
//*****************************************************************************
void StackDumpFromContext(DWORD eip,DWORD esp,DWORD ebp, void (*callback)(const char*))
{
if (callback == nullptr)
{
callback = StackDumpDefaultHandler;
}
if (!InitSymbolInfo())
return;
MakeStackTrace(eip,esp,ebp, 0, callback);
}
//*****************************************************************************
//*****************************************************************************
BOOL InitSymbolInfo()
{
if (DbgHelpLoader::isLoaded())
return TRUE;
if (DbgHelpLoader::isFailed())
return FALSE;
if (!DbgHelpLoader::load())
{
atexit(DbgHelpLoader::unload);
return FALSE;
}
char pathname[_MAX_PATH+1];
char drive[10];
char directory[_MAX_PATH+1];
HANDLE process;
DbgHelpLoader::symSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME | SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST);
process = GetCurrentProcess();
//Get the apps name
::GetModuleFileName(nullptr, pathname, _MAX_PATH);
// turn it into a search path
_splitpath(pathname, drive, directory, nullptr, nullptr);
sprintf(pathname, "%s:\\%s", drive, directory);
// append the current directory to build a search path for SymInit
::lstrcat(pathname, ";.;");
if(DbgHelpLoader::symInitialize(process, pathname, FALSE))
{
// regenerate the name of the app
::GetModuleFileName(nullptr, pathname, _MAX_PATH);
if(DbgHelpLoader::symLoadModule(process, nullptr, pathname, nullptr, 0, 0))
{
//Load any other relevant modules (ie dlls) here
atexit(DbgHelpLoader::unload);
return TRUE;
}
}
DbgHelpLoader::unload();
return FALSE;
}
//*****************************************************************************
//*****************************************************************************
void MakeStackTrace(DWORD myeip,DWORD myesp,DWORD myebp, int skipFrames, void (*callback)(const char*))
{
STACKFRAME stack_frame;
BOOL b_ret = TRUE;
HANDLE thread = GetCurrentThread();
HANDLE process = GetCurrentProcess();
memset(&gsContext, 0, sizeof(CONTEXT));
gsContext.ContextFlags = CONTEXT_FULL;
memset(&stack_frame, 0, sizeof(STACKFRAME));
stack_frame.AddrPC.Mode = AddrModeFlat;
stack_frame.AddrPC.Offset = myeip;
stack_frame.AddrStack.Mode = AddrModeFlat;
stack_frame.AddrStack.Offset = myesp;
stack_frame.AddrFrame.Mode = AddrModeFlat;
stack_frame.AddrFrame.Offset = myebp;
{
/*
if(GetThreadContext(thread, &gsContext))
{
memset(&stack_frame, 0, sizeof(STACKFRAME));
stack_frame.AddrPC.Mode = AddrModeFlat;
stack_frame.AddrPC.Offset = gsContext.Eip;
stack_frame.AddrStack.Mode = AddrModeFlat;
stack_frame.AddrStack.Offset = gsContext.Esp;
stack_frame.AddrFrame.Mode = AddrModeFlat;
stack_frame.AddrFrame.Offset = gsContext.Ebp;
*/
//{
callback("Call Stack\n**********\n");
// Skip some ?
unsigned int skip = skipFrames;
while (b_ret&&skip)
{
b_ret = DbgHelpLoader::stackWalk( IMAGE_FILE_MACHINE_I386,
process,
thread,
&stack_frame,
nullptr, //&gsContext,
nullptr,
DbgHelpLoader::symFunctionTableAccess,
DbgHelpLoader::symGetModuleBase,
nullptr);
skip--;
}
skip = 30;
while(b_ret&&skip)
{
b_ret = DbgHelpLoader::stackWalk( IMAGE_FILE_MACHINE_I386,
process,
thread,
&stack_frame,
nullptr, //&gsContext,
nullptr,
DbgHelpLoader::symFunctionTableAccess,
DbgHelpLoader::symGetModuleBase,
nullptr);
if (b_ret) WriteStackLine((void *) stack_frame.AddrPC.Offset, callback);
skip--;
}
}
}
//*****************************************************************************
//*****************************************************************************
void GetFunctionDetails(void *pointer, char*name, char*filename, unsigned int* linenumber, unsigned int* address)
{
if (!InitSymbolInfo())
return;
if (name)
{
strcpy(name, "<Unknown>");
}
if (filename)
{
strcpy(filename, "<Unknown>");
}
if (linenumber)
{
*linenumber = 0xFFFFFFFF;
}
if (address)
{
*address = 0xFFFFFFFF;
}
ULONG displacement = 0;
HANDLE process = ::GetCurrentProcess();
char symbol_buffer[512 + sizeof(IMAGEHLP_SYMBOL)];
memset(symbol_buffer, 0, sizeof(symbol_buffer));
PIMAGEHLP_SYMBOL psymbol = (PIMAGEHLP_SYMBOL)symbol_buffer;
psymbol->SizeOfStruct = sizeof(symbol_buffer);
psymbol->MaxNameLength = 512;
if (DbgHelpLoader::symGetSymFromAddr(process, (DWORD) pointer, &displacement, psymbol))
{
if (name)
{
strcpy(name, psymbol->Name);
strcat(name, "();");
}
// Get line now
IMAGEHLP_LINE line;
memset(&line,0,sizeof(line));
line.SizeOfStruct = sizeof(line);
if (DbgHelpLoader::symGetLineFromAddr(process, (DWORD) pointer, &displacement, &line))
{
if (filename)
{
strcpy(filename, line.FileName);
}
if (linenumber)
{
*linenumber = (unsigned int)line.LineNumber;
}
if (address)
{
*address = (unsigned int)line.Address;
}
}
}
}
//*****************************************************************************
// Gets last x addresses from the stack
//*****************************************************************************
void FillStackAddresses(void**addresses, unsigned int count, unsigned int skip)
{
if (!InitSymbolInfo())
return;
STACKFRAME stack_frame;
HANDLE thread = GetCurrentThread();
HANDLE process = GetCurrentProcess();
memset(&gsContext, 0, sizeof(CONTEXT));
gsContext.ContextFlags = CONTEXT_FULL;
DWORD myeip,myesp,myebp;
#if defined(_MSC_VER)
_asm
{
MYEIP2:
mov eax, MYEIP2
mov dword ptr [myeip] , eax
mov eax, esp
mov dword ptr [myesp] , eax
mov eax, ebp
mov dword ptr [myebp] , eax
xor eax,eax
}
#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86))
// GCC/Clang inline assembly for x86-32
__asm__ __volatile__(
"call 1f\n\t"
"1: pop %0\n\t"
"mov %%esp, %1\n\t"
"mov %%ebp, %2\n\t"
"xor %%eax, %%eax"
: "=r"(myeip), "=r"(myesp), "=r"(myebp)
:
: "eax", "memory"
);
#else
#error "Unsupported compiler or architecture for register capture"
#endif
memset(&stack_frame, 0, sizeof(STACKFRAME));
stack_frame.AddrPC.Mode = AddrModeFlat;
stack_frame.AddrPC.Offset = myeip;
stack_frame.AddrStack.Mode = AddrModeFlat;
stack_frame.AddrStack.Offset = myesp;
stack_frame.AddrFrame.Mode = AddrModeFlat;
stack_frame.AddrFrame.Offset = myebp;
{
/*
if(GetThreadContext(thread, &gsContext))
{
memset(&stack_frame, 0, sizeof(STACKFRAME));
stack_frame.AddrPC.Mode = AddrModeFlat;
stack_frame.AddrPC.Offset = gsContext.Eip;
stack_frame.AddrStack.Mode = AddrModeFlat;
stack_frame.AddrStack.Offset = gsContext.Esp;
stack_frame.AddrFrame.Mode = AddrModeFlat;
stack_frame.AddrFrame.Offset = gsContext.Ebp;
*/
Bool stillgoing = TRUE;
// unsigned int cd = count;
// Skip some?
while (stillgoing&&skip)
{
stillgoing = DbgHelpLoader::stackWalk(IMAGE_FILE_MACHINE_I386,
process,
thread,
&stack_frame,
nullptr, //&gsContext,
nullptr,
DbgHelpLoader::symFunctionTableAccess,
DbgHelpLoader::symGetModuleBase,
nullptr) != 0;
skip--;
}
while(stillgoing&&count)
{
stillgoing = DbgHelpLoader::stackWalk(IMAGE_FILE_MACHINE_I386,
process,
thread,
&stack_frame,
nullptr, //&gsContext,
nullptr,
DbgHelpLoader::symFunctionTableAccess,
DbgHelpLoader::symGetModuleBase,
nullptr) != 0;
if (stillgoing)
{
*addresses = (void*)stack_frame.AddrPC.Offset;
addresses++;
count--;
}
}
// Fill remainder
while (count)
{
*addresses = nullptr;
addresses++;
count--;
}
}
/*
else
{
memset(addresses,nullptr,count*sizeof(void*));
}
*/
}
//*****************************************************************************
// Do full stack dump using an address array
//*****************************************************************************
void StackDumpFromAddresses(void**addresses, unsigned int count, void (*callback)(const char *))
{
if (callback == nullptr)
{
callback = StackDumpDefaultHandler;
}
if (!InitSymbolInfo())
return;
while ((count--) && (*addresses!=nullptr))
{
WriteStackLine(*addresses,callback);
addresses++;
}
}
AsciiString g_LastErrorDump;
//*****************************************************************************
//*****************************************************************************
void WriteStackLine(void*address, void (*callback)(const char*))
{
static char line[MAX_PATH];
static char function_name[512];
static char filename[MAX_PATH];
unsigned int linenumber;
unsigned int addr;
GetFunctionDetails(address, function_name, filename, &linenumber, &addr);
sprintf(line, " %s(%d) : %s 0x%08p", filename, linenumber, function_name, address);
if (g_LastErrorDump.isNotEmpty()) {
g_LastErrorDump.concat(line);
g_LastErrorDump.concat("\n");
}
callback(line);
callback("\n");
}
//*****************************************************************************
//*****************************************************************************
void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info )
{
DEBUG_LOG_RAW(("\n"));
DEBUG_LOG(( "********** EXCEPTION DUMP ****************" ));
/*
** List of possible exceptions
*/
g_LastErrorDump.clear();
static const unsigned int _codes[] = {
EXCEPTION_ACCESS_VIOLATION,
EXCEPTION_ARRAY_BOUNDS_EXCEEDED,
EXCEPTION_BREAKPOINT,
EXCEPTION_DATATYPE_MISALIGNMENT,
EXCEPTION_FLT_DENORMAL_OPERAND,
EXCEPTION_FLT_DIVIDE_BY_ZERO,
EXCEPTION_FLT_INEXACT_RESULT,
EXCEPTION_FLT_INVALID_OPERATION,
EXCEPTION_FLT_OVERFLOW,
EXCEPTION_FLT_STACK_CHECK,
EXCEPTION_FLT_UNDERFLOW,
EXCEPTION_ILLEGAL_INSTRUCTION,
EXCEPTION_IN_PAGE_ERROR,
EXCEPTION_INT_DIVIDE_BY_ZERO,
EXCEPTION_INT_OVERFLOW,
EXCEPTION_INVALID_DISPOSITION,
EXCEPTION_NONCONTINUABLE_EXCEPTION,
EXCEPTION_PRIV_INSTRUCTION,
EXCEPTION_SINGLE_STEP,
EXCEPTION_STACK_OVERFLOW,
0xffffffff
};
/*
** Information about each exception type.
*/
static char const * _code_txt[] = {
"Error code: EXCEPTION_ACCESS_VIOLATION\nDescription: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.",
"Error code: EXCEPTION_ARRAY_BOUNDS_EXCEEDED\nDescription: The thread tried to access an array element that is out of bounds and the underlying hardware supports bounds checking.",
"Error code: EXCEPTION_BREAKPOINT\nDescription: A breakpoint was encountered.",
"Error code: EXCEPTION_DATATYPE_MISALIGNMENT\nDescription: The thread tried to read or write data that is misaligned on hardware that does not provide alignment. For example, 16-bit values must be aligned on 2-byte boundaries; 32-bit values on 4-byte boundaries, and so on.",
"Error code: EXCEPTION_FLT_DENORMAL_OPERAND\nDescription: One of the operands in a floating-point operation is denormal. A denormal value is one that is too small to represent as a standard floating-point value.",
"Error code: EXCEPTION_FLT_DIVIDE_BY_ZERO\nDescription: The thread tried to divide a floating-point value by a floating-point divisor of zero.",
"Error code: EXCEPTION_FLT_INEXACT_RESULT\nDescription: The result of a floating-point operation cannot be represented exactly as a decimal fraction.",
"Error code: EXCEPTION_FLT_INVALID_OPERATION\nDescription: Some strange unknown floating point operation was attempted.",
"Error code: EXCEPTION_FLT_OVERFLOW\nDescription: The exponent of a floating-point operation is greater than the magnitude allowed by the corresponding type.",
"Error code: EXCEPTION_FLT_STACK_CHECK\nDescription: The stack overflowed or underflowed as the result of a floating-point operation.",
"Error code: EXCEPTION_FLT_UNDERFLOW\nDescription: The exponent of a floating-point operation is less than the magnitude allowed by the corresponding type.",
"Error code: EXCEPTION_ILLEGAL_INSTRUCTION\nDescription: The thread tried to execute an invalid instruction.",
"Error code: EXCEPTION_IN_PAGE_ERROR\nDescription: The thread tried to access a page that was not present, and the system was unable to load the page. For example, this exception might occur if a network connection is lost while running a program over the network.",
"Error code: EXCEPTION_INT_DIVIDE_BY_ZERO\nDescription: The thread tried to divide an integer value by an integer divisor of zero.",
"Error code: EXCEPTION_INT_OVERFLOW\nDescription: The result of an integer operation caused a carry out of the most significant bit of the result.",
"Error code: EXCEPTION_INVALID_DISPOSITION\nDescription: An exception handler returned an invalid disposition to the exception dispatcher. Programmers using a high-level language such as C should never encounter this exception.",
"Error code: EXCEPTION_NONCONTINUABLE_EXCEPTION\nDescription: The thread tried to continue execution after a noncontinuable exception occurred.",
"Error code: EXCEPTION_PRIV_INSTRUCTION\nDescription: The thread tried to execute an instruction whose operation is not allowed in the current machine mode.",
"Error code: EXCEPTION_SINGLE_STEP\nDescription: A trace trap or other single-instruction mechanism signaled that one instruction has been executed.",
"Error code: EXCEPTION_STACK_OVERFLOW\nDescription: The thread used up its stack.",
"Error code: ?????\nDescription: Unknown exception."
};
DEBUG_LOG( ("Dump exception info") );
CONTEXT *context = e_info->ContextRecord;
/*
** The following are set for access violation only
*/
int access_read_write=-1;
unsigned long access_address = 0;
AsciiString msg;
// DOUBLE_DEBUG does a DEBUG_LOG, and concats to g_LastErrorDump. jba.
#define DOUBLE_DEBUG(x) { msg.format x; g_LastErrorDump.concat(msg); DEBUG_LOG( x ); }
if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION )
{
DOUBLE_DEBUG (("Exception is access violation"));
access_read_write = e_info->ExceptionRecord->ExceptionInformation[0]; // 0=read, 1=write
access_address = e_info->ExceptionRecord->ExceptionInformation[1];
}
else
{
DOUBLE_DEBUG (("Exception code is %x", e_info->ExceptionRecord->ExceptionCode));
}
Int *winMainAddr = (Int *)WinMain;
DOUBLE_DEBUG(("WinMain at %x", winMainAddr));
/*
** Match the exception type with the error string and print it out
*/
int i=0;
for ( ; _codes[i] != 0xffffffff ; i++ )
{
if ( _codes[i] == e_info->ExceptionRecord->ExceptionCode )
{
DEBUG_LOG ( ("Found exception description") );
break;
}
}
DOUBLE_DEBUG( ("%s", _code_txt[i]));
/** For access violations, print out the violation address and if it was read or write.
*/
if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION )
{
if ( access_read_write )
{
DOUBLE_DEBUG( ("Access address:%08X was written to.", access_address));
}
else
{
DOUBLE_DEBUG( ("Access address:%08X was read from.", access_address));
}
}
DOUBLE_DEBUG (("\nStack Dump:"));
StackDumpFromContext(context->Eip, context->Esp, context->Ebp, nullptr);
DOUBLE_DEBUG (("\nDetails:"));
DOUBLE_DEBUG (("Register dump..."));
/*
** Dump the registers.
*/
DOUBLE_DEBUG ( ( "Eip:%08X\tEsp:%08X\tEbp:%08X", context->Eip, context->Esp, context->Ebp));
DOUBLE_DEBUG ( ( "Eax:%08X\tEbx:%08X\tEcx:%08X", context->Eax, context->Ebx, context->Ecx));
DOUBLE_DEBUG ( ( "Edx:%08X\tEsi:%08X\tEdi:%08X", context->Edx, context->Esi, context->Edi));
DOUBLE_DEBUG ( ( "EFlags:%08X ", context->EFlags));
DOUBLE_DEBUG ( ( "CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x", context->SegCs, context->SegSs, context->SegDs, context->SegEs, context->SegFs, context->SegGs));
/*
** Dump the bytes at EIP. This will make it easier to match the crash address with later versions of the game.
*/
char scrap[512] = {};
DOUBLE_DEBUG ( ("EIP bytes dump..."));
wsprintf (scrap, "\nBytes at CS:EIP (%08X) : ", context->Eip);
unsigned char *eip_ptr = (unsigned char *) (context->Eip);
char bytestr[32];
for (int c = 0 ; c < 32 ; c++)
{
if (IsBadReadPtr(eip_ptr, 1))
{
strlcat(scrap, "?? ", ARRAY_SIZE(scrap));
}
else
{
sprintf (bytestr, "%02X ", *eip_ptr);
strlcat(scrap, bytestr, ARRAY_SIZE(scrap));
}
eip_ptr++;
}
DOUBLE_DEBUG ( ( (scrap)));
DEBUG_LOG(( "********** END EXCEPTION DUMP ****************" ));
DEBUG_LOG_RAW(("\n"));
}
#pragma pack(pop)
#endif