mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-13 16:58:04 +08:00
Migrate to NOTREACHED()
This was tested locally by adding "-Wunreachable-code-aggressive" after making NOTREACHED() [[noreturn]] in mini_chromium and then getting that to compile. Bug: chromium:40580068 Change-Id: I7ec1c72be1d73436d128660a621e9060eaebaee8 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5780891 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
cc54fcc7f5
commit
6265674c98
@ -760,12 +760,12 @@ class StartHandlerForChildTest : public Multiprocess {
|
|||||||
test_state_.ExpectReport();
|
test_state_.ExpectReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiprocessChild() {
|
[[noreturn]] void MultiprocessChild() {
|
||||||
CHECK(test_state_.InstallHandler());
|
CHECK(test_state_.InstallHandler());
|
||||||
|
|
||||||
__builtin_trap();
|
__builtin_trap();
|
||||||
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
StartHandlerForClientTest test_state_;
|
StartHandlerForClientTest test_state_;
|
||||||
|
@ -122,10 +122,8 @@ bool BinaryPruneCondition::ShouldPruneReport(
|
|||||||
return lhs_->ShouldPruneReport(report) && rhs_->ShouldPruneReport(report);
|
return lhs_->ShouldPruneReport(report) && rhs_->ShouldPruneReport(report);
|
||||||
case OR:
|
case OR:
|
||||||
return lhs_->ShouldPruneReport(report) || rhs_->ShouldPruneReport(report);
|
return lhs_->ShouldPruneReport(report) || rhs_->ShouldPruneReport(report);
|
||||||
default:
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -292,8 +292,7 @@ FileHandle Settings::GetHandleFromOptions(
|
|||||||
return OpenFileForReadAndWrite(
|
return OpenFileForReadAndWrite(
|
||||||
file_path, options.mode, options.permissions);
|
file_path, options.mode, options.permissions);
|
||||||
}
|
}
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return kInvalidFileHandle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings::ScopedLockedFileHandle Settings::OpenForReading() {
|
Settings::ScopedLockedFileHandle Settings::OpenForReading() {
|
||||||
|
@ -236,8 +236,7 @@ void CrashReportUploadThread::ProcessPendingReport(
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case CrashReportDatabase::kCannotRequestUpload:
|
case CrashReportDatabase::kCannotRequestUpload:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string response_body;
|
std::string response_body;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
DWORD WINAPI Thread1(LPVOID context) {
|
[[noreturn]] DWORD WINAPI Thread1(LPVOID context) {
|
||||||
HANDLE event = context;
|
HANDLE event = context;
|
||||||
|
|
||||||
// Increase the thread priority as a hacky way to signal to
|
// Increase the thread priority as a hacky way to signal to
|
||||||
@ -40,17 +40,15 @@ DWORD WINAPI Thread1(LPVOID context) {
|
|||||||
|
|
||||||
Sleep(INFINITE);
|
Sleep(INFINITE);
|
||||||
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI Thread2(LPVOID dummy) {
|
[[noreturn]] DWORD WINAPI Thread2(LPVOID dummy) {
|
||||||
Sleep(INFINITE);
|
Sleep(INFINITE);
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI Thread3(LPVOID context) {
|
[[noreturn]] DWORD WINAPI Thread3(LPVOID context) {
|
||||||
// This is a convenient way to pass the event handle to loader_lock_dll.dll.
|
// This is a convenient way to pass the event handle to loader_lock_dll.dll.
|
||||||
HANDLE event = context;
|
HANDLE event = context;
|
||||||
PCHECK(SetEnvironmentVariable(
|
PCHECK(SetEnvironmentVariable(
|
||||||
@ -58,15 +56,12 @@ DWORD WINAPI Thread3(LPVOID context) {
|
|||||||
base::UTF8ToWide(base::StringPrintf("%p", event)).c_str()));
|
base::UTF8ToWide(base::StringPrintf("%p", event)).c_str()));
|
||||||
|
|
||||||
HMODULE dll = LoadLibrary(L"loader_lock_dll.dll");
|
HMODULE dll = LoadLibrary(L"loader_lock_dll.dll");
|
||||||
if (!dll)
|
PCHECK(dll) << "LoadLibrary";
|
||||||
PLOG(FATAL) << "LoadLibrary";
|
|
||||||
|
|
||||||
// This call is not expected to return.
|
// This call is not expected to return.
|
||||||
if (!FreeLibrary(dll))
|
PCHECK(FreeLibrary(dll));
|
||||||
PLOG(FATAL) << "FreeLibrary";
|
|
||||||
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -50,14 +50,8 @@ class TestTypeNames {
|
|||||||
public:
|
public:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static std::string GetName(int) {
|
static std::string GetName(int) {
|
||||||
if (std::is_same<T, RVA>()) {
|
static_assert(std::is_same<T, RVA>() || std::is_same<T, RVA64>());
|
||||||
return "RVA";
|
return std::is_same<T, RVA>() ? "RVA" : "RVA64";
|
||||||
}
|
|
||||||
if (std::is_same<T, RVA64>()) {
|
|
||||||
return "RVA64";
|
|
||||||
}
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,14 +36,8 @@ class TestTypeNames {
|
|||||||
public:
|
public:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static std::string GetName(int) {
|
static std::string GetName(int) {
|
||||||
if (std::is_same<T, RVA>()) {
|
static_assert(std::is_same<T, RVA>() || std::is_same<T, RVA64>());
|
||||||
return "RVA";
|
return std::is_same<T, RVA>() ? "RVA" : "RVA64";
|
||||||
}
|
|
||||||
if (std::is_same<T, RVA64>()) {
|
|
||||||
return "RVA64";
|
|
||||||
}
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -136,9 +136,7 @@ void MinidumpSystemInfoWriter::InitializeFromSnapshot(
|
|||||||
cpu_architecture = kMinidumpCPUArchitectureRISCV64Breakpad;
|
cpu_architecture = kMinidumpCPUArchitectureRISCV64Breakpad;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
cpu_architecture = kMinidumpCPUArchitectureUnknown;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
SetCPUArchitecture(cpu_architecture);
|
SetCPUArchitecture(cpu_architecture);
|
||||||
|
|
||||||
@ -185,9 +183,7 @@ void MinidumpSystemInfoWriter::InitializeFromSnapshot(
|
|||||||
operating_system = kMinidumpOSIOS;
|
operating_system = kMinidumpOSIOS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
operating_system = kMinidumpOSUnknown;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
SetOS(operating_system);
|
SetOS(operating_system);
|
||||||
|
|
||||||
|
@ -174,8 +174,7 @@ uint64_t CPUContext::InstructionPointer() const {
|
|||||||
case kCPUArchitectureRISCV64:
|
case kCPUArchitectureRISCV64:
|
||||||
return riscv64->pc;
|
return riscv64->pc;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return ~0ull;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,8 +191,7 @@ uint64_t CPUContext::StackPointer() const {
|
|||||||
case kCPUArchitectureRISCV64:
|
case kCPUArchitectureRISCV64:
|
||||||
return riscv64->regs[1];
|
return riscv64->regs[1];
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return ~0ull;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,13 +200,11 @@ uint64_t CPUContext::ShadowStackPointer() const {
|
|||||||
case kCPUArchitectureX86:
|
case kCPUArchitectureX86:
|
||||||
case kCPUArchitectureARM:
|
case kCPUArchitectureARM:
|
||||||
case kCPUArchitectureARM64:
|
case kCPUArchitectureARM64:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
case kCPUArchitectureX86_64:
|
case kCPUArchitectureX86_64:
|
||||||
return x86_64->xstate.cet_u.ssp;
|
return x86_64->xstate.cet_u.ssp;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return ~0ull;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,8 +217,7 @@ bool CPUContext::HasShadowStack() const {
|
|||||||
case kCPUArchitectureX86_64:
|
case kCPUArchitectureX86_64:
|
||||||
return x86_64->xstate.cet_u.cetmsr != 0;
|
return x86_64->xstate.cet_u.cetmsr != 0;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,8 +233,7 @@ bool CPUContext::Is64Bit() const {
|
|||||||
case kCPUArchitectureMIPSEL:
|
case kCPUArchitectureMIPSEL:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,8 +115,7 @@ crashpad::ProcessID ProcessSnapshotFuchsia::ProcessID() const {
|
|||||||
crashpad::ProcessID ProcessSnapshotFuchsia::ParentProcessID() const {
|
crashpad::ProcessID ProcessSnapshotFuchsia::ParentProcessID() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
// TODO(scottmg): https://crashpad.chromium.org/bug/196
|
// TODO(scottmg): https://crashpad.chromium.org/bug/196
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessSnapshotFuchsia::SnapshotTime(timeval* snapshot_time) const {
|
void ProcessSnapshotFuchsia::SnapshotTime(timeval* snapshot_time) const {
|
||||||
|
@ -108,8 +108,7 @@ uint32_t SystemSnapshotFuchsia::CPUX86Signature() const {
|
|||||||
#if defined(ARCH_CPU_X86_64)
|
#if defined(ARCH_CPU_X86_64)
|
||||||
return cpuid_.Signature();
|
return cpuid_.Signature();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,8 +117,7 @@ uint64_t SystemSnapshotFuchsia::CPUX86Features() const {
|
|||||||
#if defined(ARCH_CPU_X86_64)
|
#if defined(ARCH_CPU_X86_64)
|
||||||
return cpuid_.Features();
|
return cpuid_.Features();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,8 +126,7 @@ uint64_t SystemSnapshotFuchsia::CPUX86ExtendedFeatures() const {
|
|||||||
#if defined(ARCH_CPU_X86_64)
|
#if defined(ARCH_CPU_X86_64)
|
||||||
return cpuid_.ExtendedFeatures();
|
return cpuid_.ExtendedFeatures();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,8 +134,7 @@ uint32_t SystemSnapshotFuchsia::CPUX86Leaf7Features() const {
|
|||||||
#if defined(ARCH_CPU_X86_64)
|
#if defined(ARCH_CPU_X86_64)
|
||||||
return cpuid_.Leaf7Features();
|
return cpuid_.Leaf7Features();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,8 +143,7 @@ bool SystemSnapshotFuchsia::CPUX86SupportsDAZ() const {
|
|||||||
#if defined(ARCH_CPU_X86_64)
|
#if defined(ARCH_CPU_X86_64)
|
||||||
return cpuid_.SupportsDAZ();
|
return cpuid_.SupportsDAZ();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return false;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,8 +276,7 @@ uint32_t SystemSnapshotLinux::CPUX86Signature() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return cpuid_.Signature();
|
return cpuid_.Signature();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,8 +285,7 @@ uint64_t SystemSnapshotLinux::CPUX86Features() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return cpuid_.Features();
|
return cpuid_.Features();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,8 +294,7 @@ uint64_t SystemSnapshotLinux::CPUX86ExtendedFeatures() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return cpuid_.ExtendedFeatures();
|
return cpuid_.ExtendedFeatures();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,8 +303,7 @@ uint32_t SystemSnapshotLinux::CPUX86Leaf7Features() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return cpuid_.Leaf7Features();
|
return cpuid_.Leaf7Features();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,8 +312,7 @@ bool SystemSnapshotLinux::CPUX86SupportsDAZ() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return cpuid_.SupportsDAZ();
|
return cpuid_.SupportsDAZ();
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return false;
|
|
||||||
#endif // ARCH_CPU_X86_FMAILY
|
#endif // ARCH_CPU_X86_FMAILY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,8 +196,7 @@ thread_state_flavor_t InitializeCPUContextX86Flavor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return THREAD_STATE_NONE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -377,8 +376,7 @@ thread_state_flavor_t InitializeCPUContextX86_64Flavor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return THREAD_STATE_NONE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -553,8 +551,7 @@ thread_state_flavor_t InitializeCPUContextARM64Flavor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return THREAD_STATE_NONE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,8 +204,7 @@ uint32_t SystemSnapshotMac::CPUX86Signature() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return ReadIntSysctlByName<uint32_t>("machdep.cpu.signature", 0);
|
return ReadIntSysctlByName<uint32_t>("machdep.cpu.signature", 0);
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,8 +214,7 @@ uint64_t SystemSnapshotMac::CPUX86Features() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return ReadIntSysctlByName<uint64_t>("machdep.cpu.feature_bits", 0);
|
return ReadIntSysctlByName<uint64_t>("machdep.cpu.feature_bits", 0);
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,8 +224,7 @@ uint64_t SystemSnapshotMac::CPUX86ExtendedFeatures() const {
|
|||||||
#if defined(ARCH_CPU_X86_FAMILY)
|
#if defined(ARCH_CPU_X86_FAMILY)
|
||||||
return ReadIntSysctlByName<uint64_t>("machdep.cpu.extfeature_bits", 0);
|
return ReadIntSysctlByName<uint64_t>("machdep.cpu.extfeature_bits", 0);
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,8 +248,7 @@ uint32_t SystemSnapshotMac::CPUX86Leaf7Features() const {
|
|||||||
CallCPUID(7, &eax, &ebx, &ecx, &edx);
|
CallCPUID(7, &eax, &ebx, &ecx, &edx);
|
||||||
return ebx;
|
return ebx;
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,8 +286,7 @@ bool SystemSnapshotMac::CPUX86SupportsDAZ() const {
|
|||||||
// Test the DAZ bit.
|
// Test the DAZ bit.
|
||||||
return fxsave.mxcsr_mask & (1 << 6);
|
return fxsave.mxcsr_mask & (1 << 6);
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return false;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,15 +228,13 @@ std::vector<AnnotationSnapshot> ModuleSnapshotMinidump::AnnotationObjects()
|
|||||||
std::set<CheckedRange<uint64_t>> ModuleSnapshotMinidump::ExtraMemoryRanges()
|
std::set<CheckedRange<uint64_t>> ModuleSnapshotMinidump::ExtraMemoryRanges()
|
||||||
const {
|
const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return std::set<CheckedRange<uint64_t>>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<const UserMinidumpStream*>
|
std::vector<const UserMinidumpStream*>
|
||||||
ModuleSnapshotMinidump::CustomMinidumpStreams() const {
|
ModuleSnapshotMinidump::CustomMinidumpStreams() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return std::vector<const UserMinidumpStream*>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModuleSnapshotMinidump::InitializeModuleCrashpadInfo(
|
bool ModuleSnapshotMinidump::InitializeModuleCrashpadInfo(
|
||||||
|
@ -135,8 +135,7 @@ crashpad::ProcessID ProcessSnapshotMinidump::ProcessID() const {
|
|||||||
|
|
||||||
crashpad::ProcessID ProcessSnapshotMinidump::ParentProcessID() const {
|
crashpad::ProcessID ProcessSnapshotMinidump::ParentProcessID() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessSnapshotMinidump::SnapshotTime(timeval* snapshot_time) const {
|
void ProcessSnapshotMinidump::SnapshotTime(timeval* snapshot_time) const {
|
||||||
@ -208,8 +207,7 @@ std::vector<const ModuleSnapshot*> ProcessSnapshotMinidump::Modules() const {
|
|||||||
std::vector<UnloadedModuleSnapshot> ProcessSnapshotMinidump::UnloadedModules()
|
std::vector<UnloadedModuleSnapshot> ProcessSnapshotMinidump::UnloadedModules()
|
||||||
const {
|
const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return unloaded_modules_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ExceptionSnapshot* ProcessSnapshotMinidump::Exception() const {
|
const ExceptionSnapshot* ProcessSnapshotMinidump::Exception() const {
|
||||||
@ -229,8 +227,7 @@ std::vector<const MemoryMapRegionSnapshot*> ProcessSnapshotMinidump::MemoryMap()
|
|||||||
|
|
||||||
std::vector<HandleSnapshot> ProcessSnapshotMinidump::Handles() const {
|
std::vector<HandleSnapshot> ProcessSnapshotMinidump::Handles() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return std::vector<HandleSnapshot>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<const MemorySnapshot*> ProcessSnapshotMinidump::ExtraMemory()
|
std::vector<const MemorySnapshot*> ProcessSnapshotMinidump::ExtraMemory()
|
||||||
|
@ -100,37 +100,32 @@ std::string SystemSnapshotMinidump::CPUVendor() const {
|
|||||||
void SystemSnapshotMinidump::CPUFrequency(uint64_t* current_hz,
|
void SystemSnapshotMinidump::CPUFrequency(uint64_t* current_hz,
|
||||||
uint64_t* max_hz) const {
|
uint64_t* max_hz) const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t SystemSnapshotMinidump::CPUX86Signature() const {
|
uint32_t SystemSnapshotMinidump::CPUX86Signature() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t SystemSnapshotMinidump::CPUX86Features() const {
|
uint64_t SystemSnapshotMinidump::CPUX86Features() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t SystemSnapshotMinidump::CPUX86ExtendedFeatures() const {
|
uint64_t SystemSnapshotMinidump::CPUX86ExtendedFeatures() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t SystemSnapshotMinidump::CPUX86Leaf7Features() const {
|
uint32_t SystemSnapshotMinidump::CPUX86Leaf7Features() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemSnapshotMinidump::CPUX86SupportsDAZ() const {
|
bool SystemSnapshotMinidump::CPUX86SupportsDAZ() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemSnapshot::OperatingSystem SystemSnapshotMinidump::GetOperatingSystem()
|
SystemSnapshot::OperatingSystem SystemSnapshotMinidump::GetOperatingSystem()
|
||||||
@ -178,14 +173,12 @@ std::string SystemSnapshotMinidump::OSVersionFull() const {
|
|||||||
|
|
||||||
std::string SystemSnapshotMinidump::MachineDescription() const {
|
std::string SystemSnapshotMinidump::MachineDescription() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return std::string();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemSnapshotMinidump::NXEnabled() const {
|
bool SystemSnapshotMinidump::NXEnabled() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSnapshotMinidump::TimeZone(DaylightSavingTimeStatus* dst_status,
|
void SystemSnapshotMinidump::TimeZone(DaylightSavingTimeStatus* dst_status,
|
||||||
@ -194,13 +187,12 @@ void SystemSnapshotMinidump::TimeZone(DaylightSavingTimeStatus* dst_status,
|
|||||||
std::string* standard_name,
|
std::string* standard_name,
|
||||||
std::string* daylight_name) const {
|
std::string* daylight_name) const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t SystemSnapshotMinidump::AddressMask() const {
|
uint64_t SystemSnapshotMinidump::AddressMask() const {
|
||||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||||
NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10
|
NOTREACHED(); // https://crashpad.chromium.org/bug/10
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -129,8 +129,9 @@ void ChildTestFunction() {
|
|||||||
|
|
||||||
CRASHPAD_CHILD_TEST_MAIN(ChildToBeSanitized) {
|
CRASHPAD_CHILD_TEST_MAIN(ChildToBeSanitized) {
|
||||||
ChildTestFunction();
|
ChildTestFunction();
|
||||||
NOTREACHED_IN_MIGRATION();
|
|
||||||
return EXIT_SUCCESS;
|
// This isn't reachable unless assertions inside ChildTestFunction fail.
|
||||||
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExpectAnnotations(ProcessSnapshot* snapshot, bool sanitized) {
|
void ExpectAnnotations(ProcessSnapshot* snapshot, bool sanitized) {
|
||||||
|
@ -360,8 +360,7 @@ uint32_t SystemSnapshotWin::CPUX86Signature() const {
|
|||||||
__cpuid(cpu_info, 1);
|
__cpuid(cpu_info, 1);
|
||||||
return cpu_info[0];
|
return cpu_info[0];
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,8 +374,7 @@ uint64_t SystemSnapshotWin::CPUX86Features() const {
|
|||||||
return (static_cast<uint64_t>(cpu_info[2]) << 32) |
|
return (static_cast<uint64_t>(cpu_info[2]) << 32) |
|
||||||
static_cast<uint64_t>(cpu_info[3]);
|
static_cast<uint64_t>(cpu_info[3]);
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,8 +389,7 @@ uint64_t SystemSnapshotWin::CPUX86ExtendedFeatures() const {
|
|||||||
return (static_cast<uint64_t>(cpu_info[2]) << 32) |
|
return (static_cast<uint64_t>(cpu_info[2]) << 32) |
|
||||||
static_cast<uint64_t>(cpu_info[3]);
|
static_cast<uint64_t>(cpu_info[3]);
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,8 +407,7 @@ uint32_t SystemSnapshotWin::CPUX86Leaf7Features() const {
|
|||||||
__cpuidex(cpu_info, 7, 0);
|
__cpuidex(cpu_info, 7, 0);
|
||||||
return cpu_info[1];
|
return cpu_info[1];
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,8 +437,7 @@ bool SystemSnapshotWin::CPUX86SupportsDAZ() const {
|
|||||||
// Test the DAZ bit.
|
// Test the DAZ bit.
|
||||||
return (mxcsr_mask & (1 << 6)) != 0;
|
return (mxcsr_mask & (1 << 6)) != 0;
|
||||||
#else
|
#else
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,15 +90,13 @@ ProcessMemoryLinux* FakePtraceConnection::Memory() {
|
|||||||
|
|
||||||
bool FakePtraceConnection::Threads(std::vector<pid_t>* threads) {
|
bool FakePtraceConnection::Threads(std::vector<pid_t>* threads) {
|
||||||
// TODO(jperaza): Implement this if/when it's needed.
|
// TODO(jperaza): Implement this if/when it's needed.
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t FakePtraceConnection::ReadUpTo(VMAddress address,
|
ssize_t FakePtraceConnection::ReadUpTo(VMAddress address,
|
||||||
size_t size,
|
size_t size,
|
||||||
void* buffer) {
|
void* buffer) {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
@ -276,8 +276,7 @@ FileHandle StdioFileHandle(StdioStream stdio_stream) {
|
|||||||
return STDERR_FILENO;
|
return STDERR_FILENO;
|
||||||
}
|
}
|
||||||
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return kInvalidFileHandle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -230,8 +230,7 @@ FileOffset LoggingSeekFile(FileHandle file, FileOffset offset, int whence) {
|
|||||||
method = FILE_END;
|
method = FILE_END;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LARGE_INTEGER distance_to_move;
|
LARGE_INTEGER distance_to_move;
|
||||||
@ -283,8 +282,7 @@ FileHandle StdioFileHandle(StdioStream stdio_stream) {
|
|||||||
standard_handle = STD_ERROR_HANDLE;
|
standard_handle = STD_ERROR_HANDLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return INVALID_HANDLE_VALUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE handle = GetStdHandle(standard_handle);
|
HANDLE handle = GetStdHandle(standard_handle);
|
||||||
|
@ -56,8 +56,7 @@ bool OutputStreamFileWriter::WriteIoVec(std::vector<WritableIoVec>* iovecs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileOffset OutputStreamFileWriter::Seek(FileOffset offset, int whence) {
|
FileOffset OutputStreamFileWriter::Seek(FileOffset offset, int whence) {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OutputStreamFileWriter::Flush() {
|
bool OutputStreamFileWriter::Flush() {
|
||||||
|
@ -207,8 +207,7 @@ int MacOSVersionNumber() {
|
|||||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13_4
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13_4
|
||||||
// On macOS 10.13.4 and later, the sysctlbyname above should have been
|
// On macOS 10.13.4 and later, the sysctlbyname above should have been
|
||||||
// successful.
|
// successful.
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return -1;
|
|
||||||
#else // DT >= 10.13.4
|
#else // DT >= 10.13.4
|
||||||
// The Darwin major version is always 4 greater than the macOS minor version
|
// The Darwin major version is always 4 greater than the macOS minor version
|
||||||
// for Darwin versions beginning with 6, corresponding to Mac OS X 10.2,
|
// for Darwin versions beginning with 6, corresponding to Mac OS X 10.2,
|
||||||
|
@ -256,8 +256,7 @@ mach_port_t ChildPortHandshakeServer::RunServer(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,8 +123,7 @@ kern_return_t UniversalExceptionRaise(exception_behavior_t behavior,
|
|||||||
new_state_count);
|
new_state_count);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
return KERN_INVALID_ARGUMENT;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,12 +80,7 @@ ExceptionPorts::ExceptionPorts(TargetType target_type, mach_port_t target_port)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
get_exception_ports_ = nullptr;
|
|
||||||
set_exception_ports_ = nullptr;
|
|
||||||
target_name_ = nullptr;
|
|
||||||
target_port_ = MACH_PORT_NULL;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,8 +188,7 @@ class TestExceptionPorts : public MachMultiprocess,
|
|||||||
} else if (who_crashes_ == kOtherThreadCrashes) {
|
} else if (who_crashes_ == kOtherThreadCrashes) {
|
||||||
expect_behavior = EXCEPTION_STATE_IDENTITY;
|
expect_behavior = EXCEPTION_STATE_IDENTITY;
|
||||||
} else {
|
} else {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
expect_behavior = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPECT_EQ(behavior, expect_behavior);
|
EXPECT_EQ(behavior, expect_behavior);
|
||||||
@ -286,7 +285,7 @@ class TestExceptionPorts : public MachMultiprocess,
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -369,7 +368,7 @@ class TestExceptionPorts : public MachMultiprocess,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -520,7 +519,7 @@ class TestExceptionPorts : public MachMultiprocess,
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ class ScopedSpinGuard final {
|
|||||||
SleepNanoseconds(kSpinGuardSleepTimeNanos);
|
SleepNanoseconds(kSpinGuardSleepTimeNanos);
|
||||||
}
|
}
|
||||||
|
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
~ScopedSpinGuard() {
|
~ScopedSpinGuard() {
|
||||||
|
@ -98,8 +98,7 @@ void CheckAce(PACL acl,
|
|||||||
mask = label_ace->Mask;
|
mask = label_ace->Mask;
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
NOTREACHED_IN_MIGRATION();
|
NOTREACHED();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT_EQ(check_mask, mask);
|
ASSERT_EQ(check_mask, mask);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user