Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,35 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_DLFCN_INTERNAL_H_
#define CRASHPAD_COMPAT_ANDROID_DLFCN_INTERNAL_H_
namespace crashpad {
namespace internal {
//! \brief Provide a wrapper for `dlsym`.
//!
//! dlsym on Android KitKat (4.4.*) raises SIGFPE when searching for a
//! non-existent symbol. This wrapper avoids crashing in this circumstance.
//! https://code.google.com/p/android/issues/detail?id=61799
//!
//! The parameters and return value for this function are the same as for
//! `dlsym`, but a return value for `dlerror` may not be set in the event of an
//! error.
void* Dlsym(void* handle, const char* symbol);
} // namespace internal
} // namespace crashpad
#endif // CRASHPAD_COMPAT_ANDROID_DLFCN_INTERNAL_H_
@@ -0,0 +1,58 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_ELF_H_
#define CRASHPAD_COMPAT_ANDROID_ELF_H_
#include_next <elf.h>
#include <android/api-level.h>
#if !defined(ELF32_ST_VISIBILITY)
#define ELF32_ST_VISIBILITY(other) ((other) & 0x3)
#endif
#if !defined(ELF64_ST_VISIBILITY)
#define ELF64_ST_VISIBILITY(other) ELF32_ST_VISIBILITY(other)
#endif
// Android 5.0.0 (API 21) NDK
#if !defined(STT_COMMON)
#define STT_COMMON 5
#endif
#if !defined(STT_TLS)
#define STT_TLS 6
#endif
// ELF note header types are normally provided by <linux/elf.h>. While unified
// headers include <linux/elf.h> in <elf.h>, traditional headers do not, prior
// to API 21. <elf.h> and <linux/elf.h> can't both be included in the same
// translation unit due to collisions, so we provide these types here.
#if __ANDROID_API__ < 21 && !defined(__ANDROID_API_N__)
typedef struct {
Elf32_Word n_namesz;
Elf32_Word n_descsz;
Elf32_Word n_type;
} Elf32_Nhdr;
typedef struct {
Elf64_Word n_namesz;
Elf64_Word n_descsz;
Elf64_Word n_type;
} Elf64_Nhdr;
#endif // __ANDROID_API__ < 21 && !defined(NT_PRSTATUS)
#endif // CRASHPAD_COMPAT_ANDROID_ELF_H_
@@ -0,0 +1,38 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_LINUX_ELF_H_
#define CRASHPAD_COMPAT_ANDROID_LINUX_ELF_H_
#include_next <linux/elf.h>
// Android 5.0.0 (API 21) NDK
#if defined(__i386__) || defined(__x86_64__)
#if !defined(NT_386_TLS)
#define NT_386_TLS 0x200
#endif
#endif // __i386__ || __x86_64__
#if defined(__ARMEL__) || defined(__aarch64__)
#if !defined(NT_ARM_VFP)
#define NT_ARM_VFP 0x400
#endif
#if !defined(NT_ARM_TLS)
#define NT_ARM_TLS 0x401
#endif
#endif // __ARMEL__ || __aarch64__
#endif // CRASHPAD_COMPAT_ANDROID_LINUX_ELF_H_
@@ -0,0 +1,25 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_LINUX_PRCTL_H_
#define CRASHPAD_COMPAT_ANDROID_LINUX_PRCTL_H_
#include_next <linux/prctl.h>
// Android 5.0.0 (API 21) NDK
#if !defined(PR_SET_PTRACER)
#define PR_SET_PTRACER 0x59616d61
#endif
#endif // CRASHPAD_COMPAT_ANDROID_LINUX_PRCTL_H_
@@ -0,0 +1,25 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_LINUX_PTRACE_H_
#define CRASHPAD_COMPAT_ANDROID_LINUX_PTRACE_H_
#include_next <linux/ptrace.h>
// Android 5.0.0 (API 21) NDK
#if !defined(PTRACE_GETREGSET)
#define PTRACE_GETREGSET 0x4204
#endif
#endif // CRASHPAD_COMPAT_ANDROID_LINUX_PTRACE_H_
@@ -0,0 +1,30 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_SCHED_H_
#define CRASHPAD_COMPAT_ANDROID_SCHED_H_
#include_next <sched.h>
// Android 5.0.0 (API 21) NDK
#if !defined(SCHED_BATCH)
#define SCHED_BATCH 3
#endif
#if !defined(SCHED_IDLE)
#define SCHED_IDLE 5
#endif
#endif // CRASHPAD_COMPAT_ANDROID_SCHED_H_
@@ -0,0 +1,50 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_SYS_EPOLL_H_
#define CRASHPAD_COMPAT_ANDROID_SYS_EPOLL_H_
#include_next <sys/epoll.h>
#include <android/api-level.h>
#include <fcntl.h>
// This is missing from traditional headers before API 21.
#if !defined(EPOLLRDHUP)
#define EPOLLRDHUP 0x00002000
#endif
// EPOLL_CLOEXEC is undefined in traditional headers before API 21 and removed
// from unified headers at API levels < 21 as a means to indicate that
// epoll_create1 is missing from the C library, but the raw system call should
// still be available.
#if !defined(EPOLL_CLOEXEC)
#define EPOLL_CLOEXEC O_CLOEXEC
#endif
#if __ANDROID_API__ < 21
#ifdef __cplusplus
extern "C" {
#endif
int epoll_create1(int flags);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // __ANDROID_API__ < 21
#endif // CRASHPAD_COMPAT_ANDROID_SYS_EPOLL_H_
@@ -0,0 +1,43 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_SYS_MMAN_H_
#define CRASHPAD_COMPAT_ANDROID_SYS_MMAN_H_
#include_next <sys/mman.h>
#include <android/api-level.h>
#include <sys/cdefs.h>
// Theres no mmap() wrapper compatible with a 64-bit off_t for 32-bit code
// until API 21 (Android 5.0/“Lollipop”). A custom mmap() wrapper is provided
// here. Note that this scenario is only possible with NDK unified headers.
//
// https://android.googlesource.com/platform/bionic/+/0bfcbaf4d069e005d6e959d97f8d11c77722b70d/docs/32-bit-abi.md#is-32_bit-1
#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ < 21
#ifdef __cplusplus
extern "C" {
#endif
void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // defined(__USE_FILE_OFFSET64) && __ANDROID_API__ < 21
#endif // CRASHPAD_COMPAT_ANDROID_SYS_MMAN_H_
@@ -0,0 +1,42 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_SYS_SYSCALL_H_
#define CRASHPAD_COMPAT_ANDROID_SYS_SYSCALL_H_
#include_next <sys/syscall.h>
// Android 5.0.0 (API 21) NDK
#if !defined(SYS_epoll_create1)
#define SYS_epoll_create1 __NR_epoll_create1
#endif
#if !defined(SYS_gettid)
#define SYS_gettid __NR_gettid
#endif
#if !defined(SYS_timer_create)
#define SYS_timer_create __NR_timer_create
#endif
#if !defined(SYS_timer_getoverrun)
#define SYS_timer_getoverrun __NR_timer_getoverrun
#endif
#if !defined(SYS_timer_settime)
#define SYS_timer_settime __NR_timer_settime
#endif
#endif // CRASHPAD_COMPAT_ANDROID_SYS_SYSCALL_H_
@@ -0,0 +1,23 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_ANDROID_SYS_USER_H_
#define CRASHPAD_COMPAT_ANDROID_SYS_USER_H_
// This is needed for traditional headers.
#include <sys/types.h>
#include_next <sys/user.h>
#endif // CRASHPAD_COMPAT_ANDROID_SYS_USER_H_
@@ -0,0 +1,27 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_LINUX_SIGNAL_H_
#define CRASHPAD_COMPAT_LINUX_SIGNAL_H_
#include_next <signal.h>
// Missing from glibc and bionic-x86_64
#if defined(__x86_64__) || defined(__i386__)
#if !defined(X86_FXSR_MAGIC)
#define X86_FXSR_MAGIC 0x0000
#endif
#endif // __x86_64__ || __i386__
#endif // CRASHPAD_COMPAT_LINUX_SIGNAL_H_
@@ -0,0 +1,30 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_LINUX_SYS_PTRACE_H_
#define CRASHPAD_COMPAT_LINUX_SYS_PTRACE_H_
#include_next <sys/ptrace.h>
#include <sys/cdefs.h>
// https://sourceware.org/bugzilla/show_bug.cgi?id=22433
#if !defined(PTRACE_GET_THREAD_AREA) && \
defined(__GLIBC__) && (defined(__i386__) || defined(__x86_64__))
static constexpr __ptrace_request PTRACE_GET_THREAD_AREA =
static_cast<__ptrace_request>(25);
#define PTRACE_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
#endif // !PTRACE_GET_THREAD_AREA && __GLIBC__ && (__i386__ || __x86_64__)
#endif // CRASHPAD_COMPAT_LINUX_SYS_PTRACE_H_
@@ -0,0 +1,62 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_MAC_AVAILABILITYMACROS_H_
#define CRASHPAD_COMPAT_MAC_AVAILABILITYMACROS_H_
#include_next <AvailabilityMacros.h>
// 10.7 SDK
#ifndef MAC_OS_X_VERSION_10_7
#define MAC_OS_X_VERSION_10_7 1070
#endif
// 10.8 SDK
#ifndef MAC_OS_X_VERSION_10_8
#define MAC_OS_X_VERSION_10_8 1080
#endif
// 10.9 SDK
#ifndef MAC_OS_X_VERSION_10_9
#define MAC_OS_X_VERSION_10_9 1090
#endif
// 10.10 SDK
#ifndef MAC_OS_X_VERSION_10_10
#define MAC_OS_X_VERSION_10_10 101000
#endif
// 10.11 SDK
#ifndef MAC_OS_X_VERSION_10_11
#define MAC_OS_X_VERSION_10_11 101100
#endif
// 10.12 SDK
#ifndef MAC_OS_X_VERSION_10_12
#define MAC_OS_X_VERSION_10_12 101200
#endif
// 10.13 SDK
#ifndef MAC_OS_X_VERSION_10_13
#define MAC_OS_X_VERSION_10_13 101300
#endif
#endif // CRASHPAD_COMPAT_MAC_AVAILABILITYMACROS_H_
@@ -0,0 +1,76 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_MAC_KERN_EXC_RESOURCE_H_
#define CRASHPAD_COMPAT_MAC_KERN_EXC_RESOURCE_H_
#if __has_include_next(<kern/exc_resource.h>)
#include_next <kern/exc_resource.h>
#endif
// 10.9 SDK
#ifndef EXC_RESOURCE_DECODE_RESOURCE_TYPE
#define EXC_RESOURCE_DECODE_RESOURCE_TYPE(code) (((code) >> 61) & 0x7ull)
#endif
#ifndef EXC_RESOURCE_DECODE_FLAVOR
#define EXC_RESOURCE_DECODE_FLAVOR(code) (((code) >> 58) & 0x7ull)
#endif
#ifndef RESOURCE_TYPE_CPU
#define RESOURCE_TYPE_CPU 1
#endif
#ifndef RESOURCE_TYPE_WAKEUPS
#define RESOURCE_TYPE_WAKEUPS 2
#endif
#ifndef RESOURCE_TYPE_MEMORY
#define RESOURCE_TYPE_MEMORY 3
#endif
#ifndef FLAVOR_CPU_MONITOR
#define FLAVOR_CPU_MONITOR 1
#endif
#ifndef FLAVOR_WAKEUPS_MONITOR
#define FLAVOR_WAKEUPS_MONITOR 1
#endif
#ifndef FLAVOR_HIGH_WATERMARK
#define FLAVOR_HIGH_WATERMARK 1
#endif
// 10.10 SDK
#ifndef FLAVOR_CPU_MONITOR_FATAL
#define FLAVOR_CPU_MONITOR_FATAL 2
#endif
// 10.12 SDK
#ifndef RESOURCE_TYPE_IO
#define RESOURCE_TYPE_IO 4
#endif
#ifndef FLAVOR_IO_PHYSICAL_WRITES
#define FLAVOR_IO_PHYSICAL_WRITES 1
#endif
#ifndef FLAVOR_IO_LOGICAL_WRITES
#define FLAVOR_IO_LOGICAL_WRITES 2
#endif
#endif // CRASHPAD_COMPAT_MAC_KERN_EXC_RESOURCE_H_
@@ -0,0 +1,32 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_MAC_MACH_O_LOADER_H_
#define CRASHPAD_COMPAT_MAC_MACH_O_LOADER_H_
#include_next <mach-o/loader.h>
// 10.7 SDK
#ifndef S_THREAD_LOCAL_ZEROFILL
#define S_THREAD_LOCAL_ZEROFILL 0x12
#endif
// 10.8 SDK
#ifndef LC_SOURCE_VERSION
#define LC_SOURCE_VERSION 0x2a
#endif
#endif // CRASHPAD_COMPAT_MAC_MACH_O_LOADER_H_
@@ -0,0 +1,28 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_MAC_MACH_I386_THREAD_STATE_H_
#define CRASHPAD_COMPAT_MAC_MACH_I386_THREAD_STATE_H_
#include_next <mach/i386/thread_state.h>
// 10.13 SDK
//
// This was defined as 244 in the 10.7 through 10.12 SDKs, and 144 previously.
#if I386_THREAD_STATE_MAX < 614
#undef I386_THREAD_STATE_MAX
#define I386_THREAD_STATE_MAX (614)
#endif
#endif // CRASHPAD_COMPAT_MAC_MACH_I386_THREAD_STATE_H_
@@ -0,0 +1,120 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_MAC_MACH_MACH_H_
#define CRASHPAD_COMPAT_MAC_MACH_MACH_H_
#include_next <mach/mach.h>
// <mach/exception_types.h>
// 10.8 SDK
#ifndef EXC_RESOURCE
#define EXC_RESOURCE 11
#endif
#ifndef EXC_MASK_RESOURCE
#define EXC_MASK_RESOURCE (1 << EXC_RESOURCE)
#endif
// 10.9 SDK
#ifndef EXC_GUARD
#define EXC_GUARD 12
#endif
#ifndef EXC_MASK_GUARD
#define EXC_MASK_GUARD (1 << EXC_GUARD)
#endif
// 10.11 SDK
#ifndef EXC_CORPSE_NOTIFY
#define EXC_CORPSE_NOTIFY 13
#endif
#ifndef EXC_MASK_CORPSE_NOTIFY
#define EXC_MASK_CORPSE_NOTIFY (1 << EXC_CORPSE_NOTIFY)
#endif
// Dont expose EXC_MASK_ALL at all, because its definition varies with SDK, and
// older kernels will reject values that they dont understand. Instead, use
// crashpad::ExcMaskAll(), which computes the correct value of EXC_MASK_ALL for
// the running system.
#undef EXC_MASK_ALL
#if defined(__i386__) || defined(__x86_64__)
// <mach/i386/exception.h>
// 10.11 SDK
#if EXC_TYPES_COUNT > 14 // Definition varies with SDK
#error Update this file for new exception types
#elif EXC_TYPES_COUNT != 14
#undef EXC_TYPES_COUNT
#define EXC_TYPES_COUNT 14
#endif
// <mach/i386/thread_status.h>
// 10.6 SDK
//
// Earlier versions of this SDK didnt have AVX definitions. They didnt appear
// until the version of the 10.6 SDK that shipped with Xcode 4.2, although
// versions of this SDK appeared with Xcode releases as early as Xcode 3.2.
// Similarly, the kernel didnt handle AVX state until Mac OS X 10.6.8
// (xnu-1504.15.3) and presumably the hardware-specific versions of Mac OS X
// 10.6.7 intended to run on processors with AVX.
#ifndef x86_AVX_STATE32
#define x86_AVX_STATE32 16
#endif
#ifndef x86_AVX_STATE64
#define x86_AVX_STATE64 17
#endif
// 10.8 SDK
#ifndef x86_AVX_STATE
#define x86_AVX_STATE 18
#endif
// 10.13 SDK
#ifndef x86_AVX512_STATE32
#define x86_AVX512_STATE32 19
#endif
#ifndef x86_AVX512_STATE64
#define x86_AVX512_STATE64 20
#endif
#ifndef x86_AVX512_STATE
#define x86_AVX512_STATE 21
#endif
#endif // defined(__i386__) || defined(__x86_64__)
// <mach/thread_status.h>
// 10.8 SDK
#ifndef THREAD_STATE_FLAVOR_LIST_10_9
#define THREAD_STATE_FLAVOR_LIST_10_9 129
#endif
#endif // CRASHPAD_COMPAT_MAC_MACH_MACH_H_
@@ -0,0 +1,26 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_MAC_SYS_RESOURCE_H_
#define CRASHPAD_COMPAT_MAC_SYS_RESOURCE_H_
#include_next <sys/resource.h>
// 10.9 SDK
#ifndef WAKEMON_MAKE_FATAL
#define WAKEMON_MAKE_FATAL 0x10
#endif
#endif // CRASHPAD_COMPAT_MAC_SYS_RESOURCE_H_
@@ -0,0 +1,44 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_NON_MAC_MACH_MACH_H_
#define CRASHPAD_COMPAT_NON_MAC_MACH_MACH_H_
//! \file
// <mach/exception_types.h>
//! \anchor EXC_x
//! \name EXC_*
//!
//! \brief Mach exception type definitions.
//! \{
#define EXC_BAD_ACCESS 1
#define EXC_BAD_INSTRUCTION 2
#define EXC_ARITHMETIC 3
#define EXC_EMULATION 4
#define EXC_SOFTWARE 5
#define EXC_BREAKPOINT 6
#define EXC_SYSCALL 7
#define EXC_MACH_SYSCALL 8
#define EXC_RPC_ALERT 9
#define EXC_CRASH 10
#define EXC_RESOURCE 11
#define EXC_GUARD 12
#define EXC_CORPSE_NOTIFY 13
#define EXC_TYPES_COUNT 14
//! \}
#endif // CRASHPAD_COMPAT_NON_MAC_MACH_MACH_H_
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,49 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_NON_WIN_MINWINBASE_H_
#define CRASHPAD_COMPAT_NON_WIN_MINWINBASE_H_
#include <stdint.h>
//! \brief Represents a date and time.
struct SYSTEMTIME {
//! \brief The year, represented fully.
//!
//! The year 2014 would be represented in this field as `2014`.
uint16_t wYear;
//! \brief The month of the year, `1` for January and `12` for December.
uint16_t wMonth;
//! \brief The day of the week, `0` for Sunday and `6` for Saturday.
uint16_t wDayOfWeek;
//! \brief The day of the month, `1` through `31`.
uint16_t wDay;
//! \brief The hour of the day, `0` through `23`.
uint16_t wHour;
//! \brief The minute of the hour, `0` through `59`.
uint16_t wMinute;
//! \brief The second of the minute, `0` through `60`.
uint16_t wSecond;
//! \brief The millisecond of the second, `0` through `999`.
uint16_t wMilliseconds;
};
#endif // CRASHPAD_COMPAT_NON_WIN_MINWINBASE_H_
@@ -0,0 +1,61 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_NON_WIN_TIMEZONEAPI_H_
#define CRASHPAD_COMPAT_NON_WIN_TIMEZONEAPI_H_
#include <stdint.h>
#include "base/strings/string16.h"
#include "compat/non_win/minwinbase.h"
//! \brief Information about a time zone and its daylight saving rules.
struct TIME_ZONE_INFORMATION {
//! \brief The number of minutes west of UTC.
int32_t Bias;
//! \brief The UTF-16-encoded name of the time zone when observing standard
//! time.
base::char16 StandardName[32];
//! \brief The date and time to switch from daylight saving time to standard
//! time.
//!
//! This can be a specific time, or with SYSTEMTIME::wYear set to `0`, it can
//! reflect an annual recurring transition. In that case, SYSTEMTIME::wDay in
//! the range `1` to `5` is interpreted as the given occurrence of
//! SYSTEMTIME::wDayOfWeek within the month, `1` being the first occurrence
//! and `5` being the last (even if there are fewer than 5).
SYSTEMTIME StandardDate;
//! \brief The bias relative to #Bias to be applied when observing standard
//! time.
int32_t StandardBias;
//! \brief The UTF-16-encoded name of the time zone when observing daylight
//! saving time.
base::char16 DaylightName[32];
//! \brief The date and time to switch from standard time to daylight saving
//! time.
//!
//! This field is specified in the same manner as #StandardDate.
SYSTEMTIME DaylightDate;
//! \brief The bias relative to #Bias to be applied when observing daylight
//! saving time.
int32_t DaylightBias;
};
#endif // CRASHPAD_COMPAT_NON_WIN_TIMEZONEAPI_H_
@@ -0,0 +1,184 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_NON_WIN_VERRSRC_H_
#define CRASHPAD_COMPAT_NON_WIN_VERRSRC_H_
#include <stdint.h>
//! \file
//! \brief The magic number for a VS_FIXEDFILEINFO structure, stored in
//! VS_FIXEDFILEINFO::dwSignature.
#define VS_FFI_SIGNATURE 0xfeef04bd
//! \brief The version of a VS_FIXEDFILEINFO structure, stored in
//! VS_FIXEDFILEINFO::dwStrucVersion.
#define VS_FFI_STRUCVERSION 0x00010000
//! \anchor VS_FF_x
//! \name VS_FF_*
//!
//! \brief File attribute values for VS_FIXEDFILEINFO::dwFileFlags and
//! VS_FIXEDFILEINFO::dwFileFlagsMask.
//! \{
#define VS_FF_DEBUG 0x00000001
#define VS_FF_PRERELEASE 0x00000002
#define VS_FF_PATCHED 0x00000004
#define VS_FF_PRIVATEBUILD 0x00000008
#define VS_FF_INFOINFERRED 0x00000010
#define VS_FF_SPECIALBUILD 0x00000020
//! \}
//! \anchor VOS_x
//! \name VOS_*
//!
//! \brief Operating system values for VS_FIXEDFILEINFO::dwFileOS.
//! \{
#define VOS_UNKNOWN 0x00000000
#define VOS_DOS 0x00010000
#define VOS_OS216 0x00020000
#define VOS_OS232 0x00030000
#define VOS_NT 0x00040000
#define VOS_WINCE 0x00050000
#define VOS__BASE 0x00000000
#define VOS__WINDOWS16 0x00000001
#define VOS__PM16 0x00000002
#define VOS__PM32 0x00000003
#define VOS__WINDOWS32 0x00000004
#define VOS_DOS_WINDOWS16 0x00010001
#define VOS_DOS_WINDOWS32 0x00010004
#define VOS_OS216_PM16 0x00020002
#define VOS_OS232_PM32 0x00030003
#define VOS_NT_WINDOWS32 0x00040004
//! \}
//! \anchor VFT_x
//! \name VFT_*
//!
//! \brief File type values for VS_FIXEDFILEINFO::dwFileType.
//! \{
#define VFT_UNKNOWN 0x00000000
#define VFT_APP 0x00000001
#define VFT_DLL 0x00000002
#define VFT_DRV 0x00000003
#define VFT_FONT 0x00000004
#define VFT_VXD 0x00000005
#define VFT_STATIC_LIB 0x00000007
//! \}
//! \anchor VFT2_x
//! \name VFT2_*
//!
//! \brief File subtype values for VS_FIXEDFILEINFO::dwFileSubtype.
//! \{
#define VFT2_UNKNOWN 0x00000000
#define VFT2_DRV_PRINTER 0x00000001
#define VFT2_DRV_KEYBOARD 0x00000002
#define VFT2_DRV_LANGUAGE 0x00000003
#define VFT2_DRV_DISPLAY 0x00000004
#define VFT2_DRV_MOUSE 0x00000005
#define VFT2_DRV_NETWORK 0x00000006
#define VFT2_DRV_SYSTEM 0x00000007
#define VFT2_DRV_INSTALLABLE 0x00000008
#define VFT2_DRV_SOUND 0x00000009
#define VFT2_DRV_COMM 0x0000000A
#define VFT2_DRV_INPUTMETHOD 0x0000000B
#define VFT2_DRV_VERSIONED_PRINTER 0x0000000C
#define VFT2_FONT_RASTER 0x00000001
#define VFT2_FONT_VECTOR 0x00000002
#define VFT2_FONT_TRUETYPE 0x00000003
//! \}
//! \brief Version information for a file.
//!
//! On Windows, this information is derived from a files version information
//! resource, and is obtained by calling `VerQueryValue()` with an `lpSubBlock`
//! argument of `"\"` (a single backslash).
struct VS_FIXEDFILEINFO {
//! \brief The structures magic number, ::VS_FFI_SIGNATURE.
uint32_t dwSignature;
//! \brief The structures version, ::VS_FFI_STRUCVERSION.
uint32_t dwStrucVersion;
//! \brief The more-significant portion of the files version number.
//!
//! This field contains the first two components of a four-component version
//! number. For a file whose version is 1.2.3.4, this field would be
//! `0x00010002`.
//!
//! \sa dwFileVersionLS
uint32_t dwFileVersionMS;
//! \brief The less-significant portion of the files version number.
//!
//! This field contains the last two components of a four-component version
//! number. For a file whose version is 1.2.3.4, this field would be
//! `0x00030004`.
//!
//! \sa dwFileVersionMS
uint32_t dwFileVersionLS;
//! \brief The more-significant portion of the products version number.
//!
//! This field contains the first two components of a four-component version
//! number. For a product whose version is 1.2.3.4, this field would be
//! `0x00010002`.
//!
//! \sa dwProductVersionLS
uint32_t dwProductVersionMS;
//! \brief The less-significant portion of the products version number.
//!
//! This field contains the last two components of a four-component version
//! number. For a product whose version is 1.2.3.4, this field would be
//! `0x00030004`.
//!
//! \sa dwProductVersionMS
uint32_t dwProductVersionLS;
//! \brief A bitmask of \ref VS_FF_x "VS_FF_*" values indicating which bits in
//! #dwFileFlags are valid.
uint32_t dwFileFlagsMask;
//! \brief A bitmask of \ref VS_FF_x "VS_FF_*" values identifying attributes
//! of the file. Only bits present in #dwFileFlagsMask are valid.
uint32_t dwFileFlags;
//! \brief The files intended operating system, a value of \ref VOS_x
//! "VOS_*".
uint32_t dwFileOS;
//! \brief The files type, a value of \ref VFT_x "VFT_*".
uint32_t dwFileType;
//! \brief The files subtype, a value of \ref VFT2_x "VFT2_*" corresponding
//! to its #dwFileType, if the file type has subtypes.
uint32_t dwFileSubtype;
//! \brief The more-significant portion of the files creation date.
//!
//! The intended encoding of this field is unknown. This field is unused and
//! always has the value `0`.
uint32_t dwFileDateMS;
//! \brief The less-significant portion of the files creation date.
//!
//! The intended encoding of this field is unknown. This field is unused and
//! always has the value `0`.
uint32_t dwFileDateLS;
};
#endif // CRASHPAD_COMPAT_NON_WIN_VERRSRC_H_
@@ -0,0 +1,17 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// dbghelp.h on Windows requires inclusion of windows.h before it. To avoid
// cluttering all inclusions of dbghelp.h with #ifdefs, always include windows.h
// and have an empty one on non-Windows platforms.
@@ -0,0 +1,250 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_NON_WIN_WINNT_H_
#define CRASHPAD_COMPAT_NON_WIN_WINNT_H_
#include <stdint.h>
//! \file
//! \anchor VER_SUITE_x
//! \name VER_SUITE_*
//!
//! \brief Installable product values for MINIDUMP_SYSTEM_INFO::SuiteMask.
//! \{
#define VER_SUITE_SMALLBUSINESS 0x0001
#define VER_SUITE_ENTERPRISE 0x0002
#define VER_SUITE_BACKOFFICE 0x0004
#define VER_SUITE_COMMUNICATIONS 0x0008
#define VER_SUITE_TERMINAL 0x0010
#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x0020
#define VER_SUITE_EMBEDDEDNT 0x0040
#define VER_SUITE_DATACENTER 0x0080
#define VER_SUITE_SINGLEUSERTS 0x0100
#define VER_SUITE_PERSONAL 0x0200
#define VER_SUITE_BLADE 0x0400
#define VER_SUITE_EMBEDDED_RESTRICTED 0x0800
#define VER_SUITE_SECURITY_APPLIANCE 0x1000
#define VER_SUITE_STORAGE_SERVER 0x2000
#define VER_SUITE_COMPUTE_SERVER 0x4000
#define VER_SUITE_WH_SERVER 0x8000
//! \}
//! \brief The maximum number of exception parameters present in the
//! MINIDUMP_EXCEPTION::ExceptionInformation array.
#define EXCEPTION_MAXIMUM_PARAMETERS 15
//! \anchor PROCESSOR_ARCHITECTURE_x
//! \name PROCESSOR_ARCHITECTURE_*
//!
//! \brief CPU type values for MINIDUMP_SYSTEM_INFO::ProcessorArchitecture.
//!
//! \sa crashpad::MinidumpCPUArchitecture
//! \{
#define PROCESSOR_ARCHITECTURE_INTEL 0
#define PROCESSOR_ARCHITECTURE_MIPS 1
#define PROCESSOR_ARCHITECTURE_ALPHA 2
#define PROCESSOR_ARCHITECTURE_PPC 3
#define PROCESSOR_ARCHITECTURE_SHX 4
#define PROCESSOR_ARCHITECTURE_ARM 5
#define PROCESSOR_ARCHITECTURE_IA64 6
#define PROCESSOR_ARCHITECTURE_ALPHA64 7
#define PROCESSOR_ARCHITECTURE_MSIL 8
#define PROCESSOR_ARCHITECTURE_AMD64 9
#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10
#define PROCESSOR_ARCHITECTURE_NEUTRAL 11
#define PROCESSOR_ARCHITECTURE_ARM64 12
#define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13
#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xffff
//! \}
//! \anchor PF_x
//! \name PF_*
//!
//! \brief CPU feature values for \ref CPU_INFORMATION::ProcessorFeatures
//! "CPU_INFORMATION::OtherCpuInfo::ProcessorFeatures".
//!
//! \{
#define PF_FLOATING_POINT_PRECISION_ERRATA 0
#define PF_FLOATING_POINT_EMULATED 1
#define PF_COMPARE_EXCHANGE_DOUBLE 2
#define PF_MMX_INSTRUCTIONS_AVAILABLE 3
#define PF_PPC_MOVEMEM_64BIT_OK 4
#define PF_ALPHA_BYTE_INSTRUCTIONS 5
#define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
#define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
#define PF_RDTSC_INSTRUCTION_AVAILABLE 8
#define PF_PAE_ENABLED 9
#define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
#define PF_SSE_DAZ_MODE_AVAILABLE 11
#define PF_NX_ENABLED 12
#define PF_SSE3_INSTRUCTIONS_AVAILABLE 13
#define PF_COMPARE_EXCHANGE128 14
#define PF_COMPARE64_EXCHANGE128 15
#define PF_CHANNELS_ENABLED 16
#define PF_XSAVE_ENABLED 17
#define PF_ARM_VFP_32_REGISTERS_AVAILABLE 18
#define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19
#define PF_SECOND_LEVEL_ADDRESS_TRANSLATION 20
#define PF_VIRT_FIRMWARE_ENABLED 21
#define PF_RDWRFSGSBASE_AVAILABLE 22
#define PF_FASTFAIL_AVAILABLE 23
#define PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE 24
#define PF_ARM_64BIT_LOADSTORE_ATOMIC 25
#define PF_ARM_EXTERNAL_CACHE_AVAILABLE 26
#define PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE 27
#define PF_RDRAND_INSTRUCTION_AVAILABLE 28
#define PF_ARM_V8_INSTRUCTIONS_AVAILABLE 29
#define PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE 30
#define PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE 31
#define PF_RDTSCP_INSTRUCTION_AVAILABLE 32
//! \}
//! \anchor PAGE_x
//! \name PAGE_*
//!
//! \brief Memory protection constants for MINIDUMP_MEMORY_INFO::Protect and
//! MINIDUMP_MEMORY_INFO::AllocationProtect.
//! \{
#define PAGE_NOACCESS 0x1
#define PAGE_READONLY 0x2
#define PAGE_READWRITE 0x4
#define PAGE_WRITECOPY 0x8
#define PAGE_EXECUTE 0x10
#define PAGE_EXECUTE_READ 0x20
#define PAGE_EXECUTE_READWRITE 0x40
#define PAGE_EXECUTE_WRITECOPY 0x80
#define PAGE_GUARD 0x100
#define PAGE_NOCACHE 0x200
#define PAGE_WRITECOMBINE 0x400
//! \}
//! \anchor MEM_x
//! \name MEM_*
//!
//! \brief Memory state and type constants for MINIDUMP_MEMORY_INFO::State and
//! MINIDUMP_MEMORY_INFO::Type.
//! \{
#define MEM_COMMIT 0x1000
#define MEM_RESERVE 0x2000
#define MEM_DECOMMIT 0x4000
#define MEM_RELEASE 0x8000
#define MEM_FREE 0x10000
#define MEM_PRIVATE 0x20000
#define MEM_MAPPED 0x40000
#define MEM_RESET 0x80000
//! \}
//! \brief The maximum number of distinct identifiable features that could
//! possibly be carried in an XSAVE area.
//!
//! This corresponds to the number of bits in the XSAVE state-component bitmap,
//! XSAVE_BV. See Intel Software Developers Manual, Volume 1: Basic
//! Architecture (253665-060), 13.4.2 “XSAVE Header”.
#define MAXIMUM_XSTATE_FEATURES (64)
//! \brief The location of a single state component within an XSAVE area.
struct XSTATE_FEATURE {
//! \brief The location of a state component within a CPU-specific context
//! structure.
//!
//! This is equivalent to the difference (`ptrdiff_t`) between the return
//! value of `LocateXStateFeature()` and its \a Context argument.
uint32_t Offset;
//! \brief The size of a state component with a CPU-specific context
//! structure.
//!
//! This is equivalent to the size returned by `LocateXStateFeature()` in \a
//! Length.
uint32_t Size;
};
//! \anchor IMAGE_DEBUG_MISC_x
//! \name IMAGE_DEBUG_MISC_*
//!
//! Data type values for IMAGE_DEBUG_MISC::DataType.
//! \{
//! \brief A pointer to a `.dbg` file.
//!
//! IMAGE_DEBUG_MISC::Data will contain the path or file name of the `.dbg` file
//! associated with the module.
#define IMAGE_DEBUG_MISC_EXENAME 1
//! \}
//! \brief Miscellaneous debugging record.
//!
//! This structure is referenced by MINIDUMP_MODULE::MiscRecord. It is obsolete,
//! superseded by the CodeView record.
struct IMAGE_DEBUG_MISC {
//! \brief The type of data carried in the #Data field.
//!
//! This is a value of \ref IMAGE_DEBUG_MISC_x "IMAGE_DEBUG_MISC_*".
uint32_t DataType;
//! \brief The length of this structure in bytes, including the entire #Data
//! field and its `NUL` terminator.
//!
//! \note The Windows documentation states that this field is rounded up to
//! nearest nearest 4-byte multiple.
uint32_t Length;
//! \brief The encoding of the #Data field.
//!
//! If this field is `0`, #Data contains narrow or multibyte character data.
//! If this field is `1`, #Data is UTF-16-encoded.
//!
//! On Windows, with this field set to `0`, #Data will be encoded in the code
//! page of the system that linked the module. On other operating systems,
//! UTF-8 may be used.
uint8_t Unicode;
uint8_t Reserved[3];
//! \brief The data carried within this structure.
//!
//! For string data, this field will be `NUL`-terminated. If #Unicode is `1`,
//! this field is UTF-16-encoded, and will be terminated by a UTF-16 `NUL`
//! code unit (two `NUL` bytes).
uint8_t Data[1];
};
//! \anchor VER_NT_x
//! \name VER_NT_*
//!
//! \brief Operating system type values for MINIDUMP_SYSTEM_INFO::ProductType.
//!
//! \sa crashpad::MinidumpOSType
//! \{
#define VER_NT_WORKSTATION 1
#define VER_NT_DOMAIN_CONTROLLER 2
#define VER_NT_SERVER 3
//! \}
//! \anchor VER_PLATFORM_x
//! \name VER_PLATFORM_*
//!
//! \brief Operating system family values for MINIDUMP_SYSTEM_INFO::PlatformId.
//!
//! \sa crashpad::MinidumpOS
//! \{
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2
//! \}
#endif // CRASHPAD_COMPAT_NON_WIN_WINNT_H_
@@ -0,0 +1,20 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_GETOPT_H_
#define CRASHPAD_COMPAT_WIN_GETOPT_H_
#include "third_party/getopt/getopt.h"
#endif // CRASHPAD_COMPAT_WIN_GETOPT_H_
@@ -0,0 +1,28 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_STRINGS_H_
#define CRASHPAD_COMPAT_WIN_STRINGS_H_
#ifdef __cplusplus
extern "C" {
#endif
int strcasecmp(const char* s1, const char* s2);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // CRASHPAD_COMPAT_WIN_STRINGS_H_
@@ -0,0 +1,20 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_SYS_TIME_H_
#define CRASHPAD_COMPAT_WIN_SYS_TIME_H_
#include <winsock2.h>
#endif // CRASHPAD_COMPAT_WIN_SYS_TIME_H_
@@ -0,0 +1,23 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_SYS_TYPES_H_
#define CRASHPAD_COMPAT_WIN_SYS_TYPES_H_
// This is intended to be roughly equivalent to #include_next.
#include <../ucrt/sys/types.h>
#include <stdint.h>
#endif // CRASHPAD_COMPAT_WIN_SYS_TYPES_H_
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_TIME_H_
#define CRASHPAD_COMPAT_WIN_TIME_H_
// This is intended to be roughly equivalent to #include_next.
#include <../ucrt/time.h>
#ifdef __cplusplus
extern "C" {
#endif
struct tm* gmtime_r(const time_t* timep, struct tm* result);
struct tm* localtime_r(const time_t* timep, struct tm* result);
const char* strptime(const char* buf, const char* format, struct tm* tm);
time_t timegm(struct tm* tm);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // CRASHPAD_COMPAT_WIN_TIME_H_
@@ -0,0 +1,27 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_WINBASE_H_
#define CRASHPAD_COMPAT_WIN_WINBASE_H_
// include_next <winbase.h>
#include <../um/winbase.h>
// 10.0.15063.0 SDK
#ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE (0x2)
#endif
#endif // CRASHPAD_COMPAT_WIN_WINBASE_H_
+60
View File
@@ -0,0 +1,60 @@
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_WINNT_H_
#define CRASHPAD_COMPAT_WIN_WINNT_H_
// include_next <winnt.h>
#include <../um/winnt.h>
// https://msdn.microsoft.com/library/aa373184.aspx: "Note that this structure
// definition was accidentally omitted from WinNT.h."
struct PROCESSOR_POWER_INFORMATION {
ULONG Number;
ULONG MaxMhz;
ULONG CurrentMhz;
ULONG MhzLimit;
ULONG MaxIdleState;
ULONG CurrentIdleState;
};
// 10.0.10240.0 SDK
#ifndef PROCESSOR_ARCHITECTURE_ARM64
#define PROCESSOR_ARCHITECTURE_ARM64 12
#endif
#ifndef PF_ARM_V8_INSTRUCTIONS_AVAILABLE
#define PF_ARM_V8_INSTRUCTIONS_AVAILABLE 29
#endif
#ifndef PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE
#define PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE 30
#endif
#ifndef PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE
#define PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE 31
#endif
#ifndef PF_RDTSCP_INSTRUCTION_AVAILABLE
#define PF_RDTSCP_INSTRUCTION_AVAILABLE 32
#endif
// 10.0.14393.0 SDK
#ifndef PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64
#define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13
#endif
#endif // CRASHPAD_COMPAT_WIN_WINNT_H_
@@ -0,0 +1,25 @@
// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_COMPAT_WIN_WINTERNL_H_
#define CRASHPAD_COMPAT_WIN_WINTERNL_H_
// include_next <winternl.h>
#include <../um/winternl.h>
// 10.0.16299.0 SDK
typedef struct _CLIENT_ID CLIENT_ID;
#endif // CRASHPAD_COMPAT_WIN_WINTERNL_H_