Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DebugEvents.h « inc « Runtime « Native « src - github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8753b707618f8527ce00ffd6af6535ef62c0b1f2 (plain)
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

// -----------------------------------------------------------------------------------------------------------
// This defines the payload of debug events that are emited by Redhawk runtime and
// received by the debugger. These payloads are referenced by 1st chance SEH exceptions


// -----------------------------------------------------------------------------------------------------------
// This version of holder does not have a default constructor.
#ifndef __DEBUG_EVENTS_H_
#define __DEBUG_EVENTS_H_

// Special Exception code for RH to communicate to debugger
// RH will raise this exception to communicate managed debug events.
// Exception codes can't use bit 0x10000000, that's reserved by OS.
// NOTE: This is intentionally different than CLR's exception code (0x04242420)
// Perhaps it is because now we are in building 40? Who would know
#define CLRDBG_NOTIFICATION_EXCEPTION_CODE  ((int) 0x04040400)

// This is exception argument 0 included in debugger notification events. 
// The debugger uses this as a sanity check.
// This could be very volatile data that changes between builds.
// NOTE: Again intentionally different than CLR's checksum (0x31415927)
//       It doesn't have to be, but if anyone is manually looking at these
//       exception payloads I am trying to make it obvious that they aren't
//       the same.
#define CLRDBG_EXCEPTION_DATA_CHECKSUM ((int) 0x27182818)

typedef enum 
{
    DEBUG_EVENT_TYPE_INVALID = 0,
    DEBUG_EVENT_TYPE_LOAD_MODULE = 1,
    DEBUG_EVENT_TYPE_UNLOAD_MODULE = 2,
    DEBUG_EVENT_TYPE_EXCEPTION_THROWN = 3,
    DEBUG_EVENT_TYPE_EXCEPTION_FIRST_PASS_FRAME_ENTER = 4,
    DEBUG_EVENT_TYPE_EXCEPTION_CATCH_HANDLER_FOUND = 5,
    DEBUG_EVENT_TYPE_EXCEPTION_UNHANDLED = 6,
    DEBUG_EVENT_TYPE_CUSTOM = 7,
    DEBUG_EVENT_TYPE_MAX = 8
} DebugEventType;

typedef unsigned int ULONG32;

struct DebugEventPayload
{
    DebugEventType type;
    union
    {
        struct 
        {
            CORDB_ADDRESS pModuleHeader; //ModuleHeader*
        } ModuleLoadUnload;
        struct
        {
            CORDB_ADDRESS ip;
            CORDB_ADDRESS sp;
        } Exception;
        struct
        {
            CORDB_ADDRESS payload;
            ULONG32 length;
        } Custom;
    };
};


#endif // __DEBUG_EVENTS_H_