-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
specialdiaginfo.h
35 lines (29 loc) · 1.3 KB
/
specialdiaginfo.h
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ******************************************************************************
// WARNING!!!: This code is also used by SOS in the diagnostics repo. Should be
// updated in a backwards and forwards compatible way.
// See: https://github.com/dotnet/diagnostics/blob/main/src/SOS/inc/specialdiaginfo.h
// ******************************************************************************
// This is a special memory region added to ELF and MachO dumps that contains extra diagnostics
// information like the exception record address for a NativeAOT app crash or the runtime module
// base address. The exception record contains the pointer to the JSON formatted crash info.
#define SPECIAL_DIAGINFO_SIGNATURE "DIAGINFOHEADER"
#define SPECIAL_DIAGINFO_VERSION 2
#ifdef __APPLE__
const uint64_t SpecialDiagInfoAddress = 0x7fffffff10000000;
#else
#if TARGET_64BIT
const uint64_t SpecialDiagInfoAddress = 0x00007ffffff10000;
#else
const uint64_t SpecialDiagInfoAddress = 0x7fff1000;
#endif
#endif
const uint64_t SpecialDiagInfoSize = 0x1000;
struct SpecialDiagInfoHeader
{
char Signature[16];
int32_t Version;
uint64_t ExceptionRecordAddress;
uint64_t RuntimeBaseAddress;
};