Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/POSIX/CrashReason.cpp
39644 views
//===-- CrashReason.cpp ---------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "CrashReason.h"910#include "lldb/Target/UnixSignals.h"1112std::string GetCrashReasonString(const siginfo_t &info) {13#if defined(si_lower) && defined(si_upper)14std::optional<lldb::addr_t> lower =15reinterpret_cast<lldb::addr_t>(info.si_lower);16std::optional<lldb::addr_t> upper =17reinterpret_cast<lldb::addr_t>(info.si_upper);18#else19std::optional<lldb::addr_t> lower;20std::optional<lldb::addr_t> upper;21#endif2223std::string description =24lldb_private::UnixSignals::CreateForHost()->GetSignalDescription(25info.si_signo, info.si_code,26reinterpret_cast<uintptr_t>(info.si_addr), lower, upper);27assert(description.size() && "unexpected signal");2829return "signal " + description;30}313233