Subversion Repositories Games.Carmageddon

Rev

Rev 11 | Rev 18 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 14
Line 42... Line 42...
42
    fprintf(stderr, "%d: ", stack_nbr++);
42
    fprintf(stderr, "%d: ", stack_nbr++);
43
    return system(addr2line_cmd);
43
    return system(addr2line_cmd);
44
}
44
}
45
 
45
 
46
static void print_stacktrace(CONTEXT* context) {
46
static void print_stacktrace(CONTEXT* context) {
47
#ifndef _WIN32 // Pierre-Marie Baty -- looks like this doesn't build right away on Windows
47
#if 0 // Pierre-Marie Baty -- looks like this doesn't build right away on Windows
48
    SymInitialize(GetCurrentProcess(), 0, true);
48
    SymInitialize(GetCurrentProcess(), 0, true);
49
 
49
 
50
    STACKFRAME frame = { 0 };
50
    STACKFRAME frame = { 0 };
51
 
51
 
52
    /* setup initial stack frame */
52
    /* setup initial stack frame */
Line 68... Line 68...
68
        0)) {
68
        0)) {
69
        addr2line(windows_program_name, (void*)frame.AddrPC.Offset);
69
        addr2line(windows_program_name, (void*)frame.AddrPC.Offset);
70
    }
70
    }
71
 
71
 
72
    SymCleanup(GetCurrentProcess());
72
    SymCleanup(GetCurrentProcess());
73
#endif // !_WIN32
73
#endif // 0
74
}
74
}
75
 
75
 
76
static LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS* ExceptionInfo) {
76
static LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS* ExceptionInfo) {
77
    switch (ExceptionInfo->ExceptionRecord->ExceptionCode) {
77
    switch (ExceptionInfo->ExceptionRecord->ExceptionCode) {
78
    case EXCEPTION_ACCESS_VIOLATION:
78
    case EXCEPTION_ACCESS_VIOLATION: