1//===- MinidumpConstants.def - Iteration over minidump constants-*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#if !(defined(HANDLE_MDMP_STREAM_TYPE) || defined(HANDLE_MDMP_ARCH) || \
10 defined(HANDLE_MDMP_PLATFORM) || defined(HANDLE_MDMP_PROTECT) || \
11 defined(HANDLE_MDMP_MEMSTATE) || defined(HANDLE_MDMP_MEMTYPE))
12#error "Missing HANDLE_MDMP definition"
13#endif
14
15#ifndef HANDLE_MDMP_STREAM_TYPE
16#define HANDLE_MDMP_STREAM_TYPE(CODE, NAME)
17#endif
18
19#ifndef HANDLE_MDMP_ARCH
20#define HANDLE_MDMP_ARCH(CODE, NAME)
21#endif
22
23#ifndef HANDLE_MDMP_PLATFORM
24#define HANDLE_MDMP_PLATFORM(CODE, NAME)
25#endif
26
27#ifndef HANDLE_MDMP_PROTECT
28#define HANDLE_MDMP_PROTECT(CODE, NAME, NATIVENAME)
29#endif
30
31#ifndef HANDLE_MDMP_MEMSTATE
32#define HANDLE_MDMP_MEMSTATE(CODE, NAME, NATIVENAME)
33#endif
34
35#ifndef HANDLE_MDMP_MEMTYPE
36#define HANDLE_MDMP_MEMTYPE(CODE, NAME, NATIVENAME)
37#endif
38
39HANDLE_MDMP_STREAM_TYPE(0x0003, ThreadList)
40HANDLE_MDMP_STREAM_TYPE(0x0004, ModuleList)
41HANDLE_MDMP_STREAM_TYPE(0x0005, MemoryList)
42HANDLE_MDMP_STREAM_TYPE(0x0006, Exception)
43HANDLE_MDMP_STREAM_TYPE(0x0007, SystemInfo)
44HANDLE_MDMP_STREAM_TYPE(0x0008, ThreadExList)
45HANDLE_MDMP_STREAM_TYPE(0x0009, Memory64List)
46HANDLE_MDMP_STREAM_TYPE(0x000a, CommentA)
47HANDLE_MDMP_STREAM_TYPE(0x000b, CommentW)
48HANDLE_MDMP_STREAM_TYPE(0x000c, HandleData)
49HANDLE_MDMP_STREAM_TYPE(0x000d, FunctionTable)
50HANDLE_MDMP_STREAM_TYPE(0x000e, UnloadedModuleList)
51HANDLE_MDMP_STREAM_TYPE(0x000f, MiscInfo)
52HANDLE_MDMP_STREAM_TYPE(0x0010, MemoryInfoList)
53HANDLE_MDMP_STREAM_TYPE(0x0011, ThreadInfoList)
54HANDLE_MDMP_STREAM_TYPE(0x0012, HandleOperationList)
55HANDLE_MDMP_STREAM_TYPE(0x0013, Token)
56HANDLE_MDMP_STREAM_TYPE(0x0014, JavascriptData)
57HANDLE_MDMP_STREAM_TYPE(0x0015, SystemMemoryInfo)
58HANDLE_MDMP_STREAM_TYPE(0x0016, ProcessVMCounters)
59// Breakpad extension types. 0x4767 = "Gg"
60HANDLE_MDMP_STREAM_TYPE(0x47670001, BreakpadInfo)
61HANDLE_MDMP_STREAM_TYPE(0x47670002, AssertionInfo)
62// These are additional minidump stream values which are specific to the linux
63// breakpad implementation.
64HANDLE_MDMP_STREAM_TYPE(0x47670003, LinuxCPUInfo) // /proc/cpuinfo
65HANDLE_MDMP_STREAM_TYPE(0x47670004, LinuxProcStatus) // /proc/$x/status
66HANDLE_MDMP_STREAM_TYPE(0x47670005, LinuxLSBRelease) // /etc/lsb-release
67HANDLE_MDMP_STREAM_TYPE(0x47670006, LinuxCMDLine) // /proc/$x/cmdline
68HANDLE_MDMP_STREAM_TYPE(0x47670007, LinuxEnviron) // /proc/$x/environ
69HANDLE_MDMP_STREAM_TYPE(0x47670008, LinuxAuxv) // /proc/$x/auxv
70HANDLE_MDMP_STREAM_TYPE(0x47670009, LinuxMaps) // /proc/$x/maps
71HANDLE_MDMP_STREAM_TYPE(0x4767000A, LinuxDSODebug)
72HANDLE_MDMP_STREAM_TYPE(0x4767000B, LinuxProcStat) // /proc/$x/stat
73HANDLE_MDMP_STREAM_TYPE(0x4767000C, LinuxProcUptime) // uptime
74HANDLE_MDMP_STREAM_TYPE(0x4767000D, LinuxProcFD) // /proc/$x/fd
75// Facebook-defined stream types
76HANDLE_MDMP_STREAM_TYPE(0xFACE1CA7, FacebookLogcat)
77HANDLE_MDMP_STREAM_TYPE(0xFACECAFA, FacebookAppCustomData)
78HANDLE_MDMP_STREAM_TYPE(0xFACECAFB, FacebookBuildID)
79HANDLE_MDMP_STREAM_TYPE(0xFACECAFC, FacebookAppVersionName)
80HANDLE_MDMP_STREAM_TYPE(0xFACECAFD, FacebookJavaStack)
81HANDLE_MDMP_STREAM_TYPE(0xFACECAFE, FacebookDalvikInfo)
82HANDLE_MDMP_STREAM_TYPE(0xFACECAFF, FacebookUnwindSymbols)
83HANDLE_MDMP_STREAM_TYPE(0xFACECB00, FacebookDumpErrorLog)
84HANDLE_MDMP_STREAM_TYPE(0xFACECCCC, FacebookAppStateLog)
85HANDLE_MDMP_STREAM_TYPE(0xFACEDEAD, FacebookAbortReason)
86HANDLE_MDMP_STREAM_TYPE(0xFACEE000, FacebookThreadName)
87
88HANDLE_MDMP_ARCH(0x0000, X86) // PROCESSOR_ARCHITECTURE_INTEL
89HANDLE_MDMP_ARCH(0x0001, MIPS) // PROCESSOR_ARCHITECTURE_MIPS
90HANDLE_MDMP_ARCH(0x0002, Alpha) // PROCESSOR_ARCHITECTURE_ALPHA
91HANDLE_MDMP_ARCH(0x0003, PPC) // PROCESSOR_ARCHITECTURE_PPC
92HANDLE_MDMP_ARCH(0x0004, SHX) // PROCESSOR_ARCHITECTURE_SHX (Super-H)
93HANDLE_MDMP_ARCH(0x0005, ARM) // PROCESSOR_ARCHITECTURE_ARM
94HANDLE_MDMP_ARCH(0x0006, IA64) // PROCESSOR_ARCHITECTURE_IA64
95HANDLE_MDMP_ARCH(0x0007, Alpha64) // PROCESSOR_ARCHITECTURE_ALPHA64
96HANDLE_MDMP_ARCH(0x0008, MSIL) // PROCESSOR_ARCHITECTURE_MSIL
97HANDLE_MDMP_ARCH(0x0009, AMD64) // PROCESSOR_ARCHITECTURE_AMD64
98HANDLE_MDMP_ARCH(0x000a, X86Win64) // PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
99HANDLE_MDMP_ARCH(0x000c, ARM64) // PROCESSOR_ARCHITECTURE_ARM64
100HANDLE_MDMP_ARCH(0x8001, BP_SPARC) // Breakpad-defined value for SPARC
101HANDLE_MDMP_ARCH(0x8002, BP_PPC64) // Breakpad-defined value for PPC64
102HANDLE_MDMP_ARCH(0x8003, BP_ARM64) // Breakpad-defined value for ARM64
103HANDLE_MDMP_ARCH(0x8004, BP_MIPS64) // Breakpad-defined value for MIPS64
104
105HANDLE_MDMP_PLATFORM(0x0000, Win32S) // Win32 on Windows 3.1
106HANDLE_MDMP_PLATFORM(0x0001, Win32Windows) // Windows 95-98-Me
107HANDLE_MDMP_PLATFORM(0x0002, Win32NT) // Windows NT, 2000+
108HANDLE_MDMP_PLATFORM(0x0003, Win32CE) // Windows CE, Windows Mobile, "Handheld"
109// Breakpad-defined values.
110HANDLE_MDMP_PLATFORM(0x8000, Unix) // Generic Unix-ish
111HANDLE_MDMP_PLATFORM(0x8101, MacOSX) // Mac OS X/Darwin
112HANDLE_MDMP_PLATFORM(0x8102, IOS) // iOS
113HANDLE_MDMP_PLATFORM(0x8201, Linux) // Linux
114HANDLE_MDMP_PLATFORM(0x8202, Solaris) // Solaris
115HANDLE_MDMP_PLATFORM(0x8203, Android) // Android
116HANDLE_MDMP_PLATFORM(0x8204, PS3) // PS3
117HANDLE_MDMP_PLATFORM(0x8205, NaCl) // Native Client (NaCl)
118
119HANDLE_MDMP_PROTECT(0x01, NoAccess, PAGE_NO_ACCESS)
120HANDLE_MDMP_PROTECT(0x02, ReadOnly, PAGE_READ_ONLY)
121HANDLE_MDMP_PROTECT(0x04, ReadWrite, PAGE_READ_WRITE)
122HANDLE_MDMP_PROTECT(0x08, WriteCopy, PAGE_WRITE_COPY)
123HANDLE_MDMP_PROTECT(0x10, Execute, PAGE_EXECUTE)
124HANDLE_MDMP_PROTECT(0x20, ExecuteRead, PAGE_EXECUTE_READ)
125HANDLE_MDMP_PROTECT(0x40, ExecuteReadWrite, PAGE_EXECUTE_READ_WRITE)
126HANDLE_MDMP_PROTECT(0x80, ExeciteWriteCopy, PAGE_EXECUTE_WRITE_COPY)
127HANDLE_MDMP_PROTECT(0x100, Guard, PAGE_GUARD)
128HANDLE_MDMP_PROTECT(0x200, NoCache, PAGE_NOCACHE)
129HANDLE_MDMP_PROTECT(0x400, WriteCombine, PAGE_WRITECOMBINE)
130HANDLE_MDMP_PROTECT(0x40000000, TargetsInvalid, PAGE_TARGETS_INVALID)
131
132HANDLE_MDMP_MEMSTATE(0x01000, Commit, MEM_COMMIT)
133HANDLE_MDMP_MEMSTATE(0x02000, Reserve, MEM_RESERVE)
134HANDLE_MDMP_MEMSTATE(0x10000, Free, MEM_FREE)
135
136HANDLE_MDMP_MEMTYPE(0x0020000, Private, MEM_PRIVATE)
137HANDLE_MDMP_MEMTYPE(0x0040000, Mapped, MEM_MAPPED)
138HANDLE_MDMP_MEMTYPE(0x1000000, Image, MEM_IMAGE)
139
140#undef HANDLE_MDMP_STREAM_TYPE
141#undef HANDLE_MDMP_ARCH
142#undef HANDLE_MDMP_PLATFORM
143#undef HANDLE_MDMP_PROTECT
144#undef HANDLE_MDMP_MEMSTATE
145#undef HANDLE_MDMP_MEMTYPE
146